Closed
Description
pub trait Resources<'a> {}
pub trait Buffer<'a, R: Resources<'a>> {
fn select(&self) -> BufferViewHandle<R>; // should be BufferViewHandle<'a, R>
}
pub struct BufferViewHandle<'a, R: 'a+Resources<'a>>(&'a R);
fn main() {}
Post-RFC1214, this gives the not-particularly-comprehensible error message
<anon>:6:5: 6:45 error: mismatched types:
expected `Resources<'_>`,
found `Resources<'a>`
(lifetime mismatch) [E0308]
<anon>:6 fn select(&self) -> BufferViewHandle<R>;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:6:5: 6:45 help: see the detailed explanation for E0308
note: the anonymous lifetime #1 defined on unknown free region bounded by scope DestructionScopeData { node_id: 9 }...
note: ...does not necessarily outlive the lifetime 'a as defined on unknown free region bounded by scope DestructionScopeData { node_id: 9 }
<anon>:6:5: 6:45 error: mismatched types:
expected `Resources<'_>`,
found `Resources<'a>`
(lifetime mismatch) [E0308]
<anon>:6 fn select(&self) -> BufferViewHandle<R>;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<anon>:6:5: 6:45 help: see the detailed explanation for E0308
note: the lifetime 'a as defined on unknown free region bounded by scope DestructionScopeData { node_id: 9 }...
note: ...does not necessarily outlive the anonymous lifetime #1 defined on unknown free region bounded by scope DestructionScopeData { node_id: 9 }
error: aborting due to 2 previous errors
In general, debug output of compiler structs shouldn't leak into error messages (also see #13998).