-
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
Don't use underscores in argument names for derive output #49676
Conversation
Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Also fixed this hygiene issue |
Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
0fcb9ff
to
19e83c8
Compare
Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
19e83c8
to
bdb99e4
Compare
Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Argh I need a clean way to do this. I guess I can just check the span but that's kinda cheating :/ |
Oh, that's an older failure. @TimNN looks like the bot shows failures from travis builds on stale commits? (Also, would be nice to have a way to ask the bot to not post for WIP PRs, either by detecting WIP in the title or a |
Stuff passes now, but the partialord stuff isn't fixed:
because Which makes me realize that the
will hit it on the Yay. |
@Manishearth: Thanks for the feedback! Both features are already planned and should be implemented by the end of the week(end). |
That error exists because of #33118, specifically because pub const A = ...
let A = ...
match ... {
A => ...
} will resolve |
@TimNN thanks! |
At least for |
bdb99e4
to
d5a304e
Compare
(Since I removed the commit now, my above rambling is about a potential fix I had for #49679 ) |
Ugh, we still have other issues: pub const arg_0: u8 = 1;
fn foo(arg_0: bool) {} itself will type error because The ability to use constants as patterns should really be removed for patterns in an irrefutable context. It is already disallowed, but not at the right stage. |
Blocked on #49680 |
Note the difference between unhygienic old macros and hygienic new macros. |
if let FnKind::Method(..) = fk { | ||
let parent = ir.tcx.hir.get_parent(id); | ||
if let Some(hir::map::Node::NodeItem(i)) = ir.tcx.hir.find(parent) { | ||
if i.attrs.iter().any(|a| a.check_name("automatically_derived")) { |
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.
Does this cover custom derive?
As per #49676 (comment), this is blocked on #49680. |
@pietroalbini Not necessarily, see #49676 (comment). |
Oh, sorry, I misunderstood that comment :) |
Ping from triage! What's the status of this PR? |
Probably superseded by #49986, if not, I'll reopen |
Currently in the docs
#[derive()]
d functions show up with arguments like__arg0
,__arg1
, etc.Ideally they'd have descriptive names set by the derive, but for now I'd just like to remove the underscores.
The underscores exist so that the
unused_variable
lint isn't triggered, but there's a simpler solution there -- don't run that pass for these functions.In a followup I'll make it possible for consumers of the builtin derive helpers to specify argument names; or teach rust/rustdoc to scrape them off the trait.
r? @jseyfried @eddyb
cc @QuietMisdreavus