Skip to content
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

'cargo fix --edition-idioms': more fun macro problems with anonymous lifetimes #6361

Closed
ExpHP opened this issue Nov 28, 2018 · 2 comments
Closed

Comments

@ExpHP
Copy link
Contributor

ExpHP commented Nov 28, 2018

  • Download the hastily-and-poorly-minimized bug5.tar.gz
  • cargo fix --edition-idioms --all
warning: failed to automatically apply fixes suggested by rustc to crate `bug4`

after fixes were automatically applied the compiler reported errors within these files:

  * src/main.rs

This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see 
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/cargo/issues
quoting the full output of this command we'd be very appreciative!

warning: hidden lifetime parameters in types are deprecated
  --> src/main.rs:26:35
   |
20 | / gen_each!{
21 | |     [ {V2 X} {V3 X} {V4 X} ]
22 | |     for_each!(
23 | |         {$Cn:ident $T:ident}
...  |
26 | |             fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result
   | |                                   ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
...  |
29 | |     }
30 | | }
   | |_- in this macro invocation
   |
   = note: `-W elided-lifetimes-in-paths` implied by `-W rust-2018-idioms`

warning: hidden lifetime parameters in types are deprecated
  --> src/main.rs:26:35
   |
20 | / gen_each!{
21 | |     [ {V2 X} {V3 X} {V4 X} ]
22 | |     for_each!(
23 | |         {$Cn:ident $T:ident}
...  |
26 | |             fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result
   | |                                   ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
...  |
29 | |     }
30 | | }
   | |_- in this macro invocation

warning: hidden lifetime parameters in types are deprecated
  --> src/main.rs:26:35
   |
20 | / gen_each!{
21 | |     [ {V2 X} {V3 X} {V4 X} ]
22 | |     for_each!(
23 | |         {$Cn:ident $T:ident}
...  |
26 | |             fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result
   | |                                   ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
...  |
29 | |     }
30 | | }
   | |_- in this macro invocation

warning: hidden lifetime parameters in types are deprecated
  --> src/main.rs:26:35
   |
20 | / gen_each!{
21 | |     [ {V2 X} {V3 X} {V4 X} ]
22 | |     for_each!(
23 | |         {$Cn:ident $T:ident}
...  |
26 | |             fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result
   | |                                   ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
...  |
29 | |     }
30 | | }
   | |_- in this macro invocation
   |
   = note: `-W elided-lifetimes-in-paths` implied by `-W rust-2018-idioms`

warning: hidden lifetime parameters in types are deprecated
  --> src/main.rs:26:35
   |
20 | / gen_each!{
21 | |     [ {V2 X} {V3 X} {V4 X} ]
22 | |     for_each!(
23 | |         {$Cn:ident $T:ident}
...  |
26 | |             fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result
   | |                                   ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
...  |
29 | |     }
30 | | }
   | |_- in this macro invocation

warning: hidden lifetime parameters in types are deprecated
  --> src/main.rs:26:35
   |
20 | / gen_each!{
21 | |     [ {V2 X} {V3 X} {V4 X} ]
22 | |     for_each!(
23 | |         {$Cn:ident $T:ident}
...  |
26 | |             fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result
   | |                                   ^^^^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>`
...  |
29 | |     }
30 | | }
   | |_- in this macro invocation

    Finished dev [unoptimized + debuginfo] target(s) in 0.34s

The macro call in src/main.rs expands to multiple calls to a callback macro whose body is defined in the macro invocation. (after the for_each!{...} =>). The line producing the warning is in that callback's body.


cargo 1.32.0-nightly (b3d0b2e54 2018-11-15)
@ehuss
Copy link
Contributor

ehuss commented Nov 28, 2018

Thanks for the report! I believe this is the same as rust-lang/rust#55768

@ExpHP
Copy link
Contributor Author

ExpHP commented Nov 28, 2018

Looks like it! (and after working around this example I ran into a much simpler one that is basically exactly the example there)

I will close this one.

@ExpHP ExpHP closed this as completed Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants