-
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
Fix ?Sized where bound not being displayed at the correct place #46786
Conversation
src/librustdoc/clean/mod.rs
Outdated
for type_params in &mut g.type_params { | ||
if &type_params.name == name { | ||
*bounds = type_params.bounds.clone(); | ||
type_params.bounds.clear(); |
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.
You could simply move the ownership away, either with
*bounds = mem::replace(&mut type_params.bounds, HirVec::new())
or, since bounds.is_empty()
,
mem::swap(&mut bounds, &mut type_params.bounds);
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.
Oh nice!
5d7d43d
to
0df39bf
Compare
Updated. |
@bors r+ rollup |
📌 Commit 0df39bf has been approved by |
… r=QuietMisdreavus Fix ?Sized where bound not being displayed at the correct place Fixes rust-lang#46726. r? @QuietMisdreavus
Fixes #46726.
r? @QuietMisdreavus