Closed
Description
playground
Code
trait Marker {}
impl<T> Marker for T {}
fn maybe<T>(_t: T) ->
Option<
//removing the line below makes it compile
&'static
T> {
None
}
fn _g<T>(t: &'static T) -> &'static impl Marker {
if let Some(t) = maybe(t) {
return _g(t);
}
todo!()
}
Error output
..: no errors encountered even though `delay_span_bug` issued
..: broken MIR in DefId(0:8 ~ playground[bb98]::_g) (Terminator { source_info: SourceInfo { span: src/main.rs:15:16: 15:21 (#0), scope: scope[0] }, kind: _0 = _g::<&T>(move _8) -> [return: bb4, unwind: bb6] }): call dest mismatch (&impl Marker <- &'static impl Marker): NoSolution