Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yet another silly delay_span_bug issue #100075

Closed
Hezuikn opened this issue Aug 2, 2022 · 3 comments · Fixed by #100092
Closed

yet another silly delay_span_bug issue #100075

Hezuikn opened this issue Aug 2, 2022 · 3 comments · Fixed by #100092
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Hezuikn
Copy link

Hezuikn commented Aug 2, 2022

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
@Hezuikn Hezuikn added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 2, 2022
@5225225
Copy link
Contributor

5225225 commented Aug 2, 2022

searched nightlies: from nightly-2022-01-01 to nightly-2022-08-02
regressed nightly: nightly-2022-04-30
searched commit range: e85edd9...a707f40
regressed commit: 87937d3

bisected with cargo-bisect-rustc v0.6.3

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start 2022-01-01 --preserve --prompt -- build 

A rollup, but the most likely suspect is #96516 ?

@compiler-errors
Copy link
Member

compiler-errors commented Aug 3, 2022

Minimized:

fn opaque<T>(t: T) -> impl Sized {
    opaque(Some(t))
}

#[allow(dead_code)]
fn main() {}

Let me find a good way to explain what the issue is.

edit: left a bit of an explanation in the linked PR.

@gimbling-away
Copy link
Contributor

That issue title is..not particularly ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants