We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://play.rust-lang.org/?gist=63df9129c4f3d2c76f2620acc38d0e57&version=nightly&edition=2018
fn foo<'a>(x: &str, y: &'a str) {} trait Foo<T> {} impl<'a> Foo<&str> for &'a str {}
The fn elision is totally fine, but the translation to an impl header gives
fn
error[E0688]: cannot mix in-band and explicit lifetime definitions --> src/lib.rs:4:14 | 4 | impl<'a> Foo<&str> for &'a str {} | -- ^ in-band lifetime definition here | | | explicit lifetime definition here
This 1) shouldn't be an error, and 2) shouldn't mention "in-band lifetime"s even if it is.
cc impl_header_lifetime_elision tracking issue, #15872
impl_header_lifetime_elision
(This feature is on-by-default in 2018, but not yet stable in 2015.)
The text was updated successfully, but these errors were encountered:
Rollup merge of rust-lang#54458 - scottmcm:bug-54456, r=nikomatsakis
ab338ea
Allow both explicit and elided lifetimes in the same impl header While still prohibiting explicit and in-band in the same header. Fixes rust-lang#54456 As usual, I don't know the broader context of the code I'm changing, so please let me know whatever I can do better. Pre-existing test that mixing explicit and in-band remains an error: https://github.com/rust-lang/rust/blob/master/src/test/ui/in-band-lifetimes/E0688.rs
No branches or pull requests
https://play.rust-lang.org/?gist=63df9129c4f3d2c76f2620acc38d0e57&version=nightly&edition=2018
The
fn
elision is totally fine, but the translation to an impl header givesThis 1) shouldn't be an error, and 2) shouldn't mention "in-band lifetime"s even if it is.
cc
impl_header_lifetime_elision
tracking issue, #15872(This feature is on-by-default in 2018, but not yet stable in 2015.)
The text was updated successfully, but these errors were encountered: