Skip to content

yet another silly delay_span_bug issue #100075

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions