Open
Description
after rust-lang/rust#138785:
#![feature(rustc_attrs)]
#![rustc_hidden_type_of_opaques]
use std::ops::Deref;
fn foo<'a, 'b>() -> impl Deref<Target = u32> + use<'a, 'b> {
unimplemented!() as &'a u32
}
results in
error: &'static u32
--> src/main.rs:5:21
|
5 | fn foo<'a, 'b>() -> impl Deref<Target = u32> + use<'a, 'b> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We never do anything withthe user type annotation mentioning 'a
as its in dead code, so we end up with opaque<'a, 'b> = &'unconstrained u32
in the storage. The member constraint 'unconstrained member ['a, 'b, 'static]
just picks 'static
at this point as it's the smallest region related to all other choice regions.
This should be moved as an issue to the rust-lang/rust repo once this behavior is happening on stable
Metadata
Metadata
Assignees
Labels
No labels