-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: fix cross-crate impl Sized
& impl ?Sized
#114059
Conversation
r? @jsha (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
); | ||
|
||
let proj = projection.map(|p| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a refactor. I found the map
followed by and_then
, try-operator and if-let quite hairy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This further enlarges the preexisting bound cleaning duplication of clean_ty_generics
and clean_middle_opaque_bounds
. Let me know if this is okay for the time being, I plan on consolidating these implementations when I overhaul bound cleaning next to fix #113015.
This comment was marked as outdated.
This comment was marked as outdated.
7061f7a
to
28d40f1
Compare
if b.is_sized_bound(cx) { | ||
has_sized = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this, I don't think it handles ~const Sized
(TraitBoundModifier::MaybeConst
) correctly.
I pretty sure it results in has_sized == false
making us add + ?Sized
to it.
Let me know if I should fix it here or in a follow-up (I guess there might be some more misuses of is_sized_bound
).
Edit: impl ~const Sized
is actually not allowed (at the moment?) since Sized
is not a #[const_trait]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That answers the question then. ;)
Thanks! @bors r+ rollup |
…llaumeGomez Rollup of 7 pull requests Successful merges: - rust-lang#114032 (typos) - rust-lang#114059 (rustdoc: fix cross-crate `impl Sized` & `impl ?Sized`) - rust-lang#114088 (Bump syn dependency) - rust-lang#114091 (docs: fmt::Debug*: Fix comments for finish method.) - rust-lang#114109 (Docs: Fix URL for `rmatches`) - rust-lang#114117 (Restore region uniquification in the new solver 🎉 ) - rust-lang#114123 (Turns out opaque types can have hidden types registered during mir validation) r? `@ghost` `@rustbot` modify labels: rollup
Previously, cross-crate impl-Trait (APIT, RPIT, etc.) that only consists of a single
Sized
bound (modulo outlives-bounds) and ones that are?Sized
were incorrectly rendered. To give you a taste (before vs. after):Moreover, we now surround impl-Trait that has multiple bounds with parentheses if they're the pointee of a reference or raw pointer type. This affects both local and cross-crate docs. The current output isn't correct (rustc would emit the error ambiguous
+
in a type if we fed the rendered code back to it).Best reviewed commit by commit :)
@rustbot label A-cross-crate-reexports