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
#![feature(associated_consts)] trait Foo { const X: &str; } impl Foo for () { const X: &str = ""; } fn main() {}
https://play.rust-lang.org/?gist=84bbc056b2289ed71e169e8a4b9236df&version=nightly&backtrace=0
rustc 1.19.0-nightly (f4209651e 2017-05-05) error[E0106]: missing lifetime specifier --> <anon>:4:14 | 4 | const X: &str; | ^ expected lifetime parameter error[E0106]: missing lifetime specifier --> <anon>:8:14 | 8 | const X: &str = ""; | ^ expected lifetime parameter
@eddyb
The text was updated successfully, but these errors were encountered:
@withoutboats This was an intentional decision (in the RFC, I believe) that could be relaxed in impl blocks with no lifetime parameters.
impl
Sorry, something went wrong.
Can associated consts depend on the lifetime variables in scope? Was the decision just to avoid ambiguity?
I'm not sure, to be honest. rust-lang/rfcs#1623 (comment) is the RFC's conclusion. cc @rust-lang/lang
Duplicate of #38831
No branches or pull requests
https://play.rust-lang.org/?gist=84bbc056b2289ed71e169e8a4b9236df&version=nightly&backtrace=0
@eddyb
The text was updated successfully, but these errors were encountered: