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

no errors encountered even though delay_span_bug issued', compiler/rustc_errors/src/lib.rs:1023:13 #86535

Closed
pacak opened this issue Jun 22, 2021 · 3 comments · Fixed by #88602
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-generic_const_exprs `#![feature(generic_const_exprs)]` 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

@pacak
Copy link
Contributor

pacak commented Jun 22, 2021

Code

#![allow(incomplete_features)]                                                                                                                                                                                                                
#![feature(const_generics)]
#![feature(const_evaluatable_checked)]

struct F<const S: &'static str>;
impl<const S: &'static str> X for F<{ S }> {
    const W: usize = 3;

    fn d(r: &[u8; Self::W]) -> F<{ S }> {
        let x: [u8; Self::W] = [0; Self::W];
        F
    }
}

pub trait X {
    const W: usize;
    fn d(r: &[u8; Self::W]) -> Self;
}

Meta

rustc --version --verbose:

rustc 1.55.0-nightly (406d4a9cc 2021-06-21)                                                                                                                                                                                                   
binary: rustc
commit-hash: 406d4a9cc3b9601cf98a07c6c83e0227d64f5d48
commit-date: 2021-06-21
host: x86_64-unknown-linux-gnu
release: 1.55.0-nightly
LLVM version: 12.0.1

Error output


error: internal compiler error: broken MIR in DefId(0:10 ~ lol[3197]::{impl#0}::d) (NoSolution): could not prove Binder(WellFormed([u8; _]), [])
  |
  = note: delayed at compiler/rustc_mir/src/borrow_check/type_check/mod.rs:253:27

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1023:13

Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/406d4a9cc3b9601cf98a07c6c83e0227d64f5d48/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/406d4a9cc3b9601cf98a07c6c83e0227d64f5d48/library/std/src/panicking.rs:457:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map
   8: rustc_interface::interface::create_compiler_and_run
   9: scoped_tls::ScopedKey<T>::set

@pacak pacak 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 Jun 22, 2021
@jonas-schievink jonas-schievink added the F-generic_const_exprs `#![feature(generic_const_exprs)]` label Jun 22, 2021
@BoxyUwU BoxyUwU added the A-const-generics Area: const generics (parameters and arguments) label Jun 22, 2021
@BoxyUwU
Copy link
Member

BoxyUwU commented Jun 23, 2021

More minimal repro:

#![feature(const_generics, const_evaluatable_checked)]
#![allow(incomplete_features)]                                                                                                                                                                                                                

pub trait Foo {
    const ASSOC_C: usize;
    fn foo() where [(); Self::ASSOC_C]:;
}

struct Bar<const N: &'static ()>;
impl<const N: &'static ()> Foo for Bar<N> {
    const ASSOC_C: usize = 3;

    fn foo() where [u8; Self::ASSOC_C]: {
        let _: [u8; Self::ASSOC_C] = loop {};
    }
}

@chengniansun

This comment has been minimized.

@jackh726
Copy link
Member

Fixed by #85499, marking as needs-test

@jackh726 jackh726 added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Aug 29, 2021
@bors bors closed this as completed in dcd0e1d Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. F-generic_const_exprs `#![feature(generic_const_exprs)]` 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.

6 participants