-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Fnty args rustdoc #44892
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
Fnty args rustdoc #44892
Conversation
src/librustc/hir/mod.rs
Outdated
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.
When we discussed it, you were supposed to put it in BareFnTy. That should simplify things.
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.
Ah damn, got tricked by this message.
a644487 to
075c90a
Compare
|
Updated. |
src/librustc/hir/mod.rs
Outdated
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.
arg_names
src/librustdoc/clean/mod.rs
Outdated
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.
Changing this impl means you've done something wrong...
src/librustdoc/clean/mod.rs
Outdated
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.
BareFnTy has its own Clean impl, you should be changing that, not this - this is why I didn't want you to change the enum variant, but the struct.
075c90a to
81c2eff
Compare
|
Updated. |
src/librustdoc/clean/mod.rs
Outdated
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.
Why was this moved at all?
src/librustdoc/clean/mod.rs
Outdated
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.
The existing impls are already powerful enough for this (unless I wasn't careful), all you need is to replace &[][..] with &self.arg_names.
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.
Not exactly:
no method named `clean` found for type `(&rustc::hir::FnDecl, &syntax::ptr::P<[syntax::codemap::Spanned<syntax::ast::Symbol>]>)` in the current scope
--> src/librustdoc/clean/mod.rs:2507:50
|
2507 | decl: (&*self.decl, &self.arg_names).clean(cx),
| ^^^^^
|
= note: the method `clean` exists but the following trait bounds were not satisfied:
`(&[syntax::ptr::P<rustc::hir::Ty>], &syntax::ptr::P<[syntax::codemap::Spanned<syntax::ast::Symbol>]>) : clean::Clean<clean::Arguments>`
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `clean`, perhaps you need to implement it:
candidate #1: `clean::Clean`
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.
Sounds like you need &self.arg_names[..] instead?
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.
Like, look for ForeignItemFn, it starts off with the same information but it doesn't implement the cleaning itself.
1b80222 to
56c3dda
Compare
56c3dda to
fe24e81
Compare
|
Updated. |
|
@bors r+ |
|
📌 Commit fe24e81 has been approved by |
Fnty args rustdoc Fixes #44570. cc @QuietMisdreavus cc @rust-lang/dev-tools Considering the impact on the `hir` libs, I'll put @eddyb as reviewer. r? @eddyb
|
☀️ Test successful - status-appveyor, status-travis |
Fixes #44570.
cc @QuietMisdreavus
cc @rust-lang/dev-tools
Considering the impact on the
hirlibs, I'll put @eddyb as reviewer.r? @eddyb