-
Notifications
You must be signed in to change notification settings - Fork 13.3k
E0495 documentation wrongly states it is no longer emitted by the compiler #136827
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
Comments
Nice catch! |
E0495 now is emitted at here, https://github.com/chenyukang/rust/blob/a917fd5f98913a04b839cccca43558f4e4fc831b/compiler/rustc_trait_selection/src/error_reporting/infer/region.rs#L1032-L1038 the meaning of error seems changed, we need to update the document for E0495. |
Could I help with update the doc? |
yeah, go ahead! |
@rustbot claim |
Either the doc for the error code should be updated or another error code should be used and the diagnostics with the drifted meaning should be attached to this new error. I'm not attached to either particular course of action. |
#137042 documentation update done |
Specify an explicit lifetime in the trait to ensure that the reference returned is valid for at least as long as trait Tr<'a, X> {
fn f(&'a self) -> X;
}
struct Wr<'b> {
ri: &'b i32,
f: f32,
}
impl<'a, 'b: 'a> Tr<'a, &'a f32> for Wr<'b> {
fn f(&'a self) -> &'a f32 { // ok!
&self.f
}
} ` |
after reading this and doing some digging i think current error from struct Wr<'b> { impl<'b> Tr<&f32> for Wr<'b> { is very different from current E095, so we should create a new error and document his behavior there. that way we can preserve documentation for old versions of compiler and keep the documentation consistent. |
Ok, I have alloced a new errorcode. |
fix: Alloc new errorcode E0803 for E0495 As discussion in rust-lang#136827, I alloc a new errorcode.
Rollup merge of rust-lang#137059 - xizheyin:issue-136827, r=davidtwco fix: Alloc new errorcode E0803 for E0495 As discussion in rust-lang#136827, I alloc a new errorcode.
Location
https://doc.rust-lang.org/error_codes/E0495.html
Summary
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=0a915b8449387a0b5162ada85854dfa6
It is emitted by the latest stable 1.84.1 & nightly
The text was updated successfully, but these errors were encountered: