Closed
Description
fn foo<'a>(_: &'a str, _: &'a str) -> &str { "" }
I expected to see this happen:
error[E0106]: missing lifetime specifier
--> <source>:1:39
|
1 | fn foo<'a>(_: &'a str, _: &'a str) -> &str { "" }
| ------- ------- ^ expected named lifetime parameter
|
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
help: consider using the `'a` lifetime
|
1 | fn foo<'a>(_: &'a str, _: &'a str) -> &'a str { "" }
| ~~~
error: aborting due to previous error
Instead, this happened: Successful compilation
Meta
Tested on the playground, all versions and editions.
- Stable channel: 1.64.0
- Beta channel: 1.65.0-beta.3 (2022-10-10 da7ffa2)
- Nightly channel: 1.66.0-nightly (2022-10-19 4b8f431)
Notes
I'm labeling this as a regression as I believe it is severe enough of an unplanned change (at best an accidental stabilization?) that I should draw attention to it, even though I haven't found a way to cause miscompilation for example. I also have not tried to do so at all yet.
@rustbot label +T-compiler +A-lifetimes +regression-from-stable-to-stable