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

ICE: sty: range end index 18446744073709551615 out of range for slice of length 0 #121769

Closed
matthiaskrgr opened this issue Feb 28, 2024 · 3 comments
Assignees
Labels
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.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

#![feature(generic_nonzero, never_type)]

use std::mem::{self};

use std::num::NonZero;

struct Wrap<T> {
    wrapped: T,
}

fn main() {
    unsafe {
        let _val: Wrap<char> = <ext::S as ext::X>::hoy();

        let _val: NonZero<u32> = mem::transmute(0);
    }
}
original code

original:

// This test checks that calling `mem::{uninitialized,zeroed}` with certain types results
// in a lint.
#![allow(deprecated)]
#![deny(invalid_value)]
#![feature(generic_nonzero, never_type, rustc_attrs)]

use std::mem::{self, MaybeUninit};
use std::ptr::NonNull;
use std::num::NonZero;

enum Void {}

struct Ref(&'static i32);
struct RefPair((&'static i32, i32));

struct Wrap<T> { wrapped: T }
enum WrapEnum<T> { Wrapped(T) }

#[rustc_layout_scalar_valid_range_start(0)]
#[rustc_layout_scalar_valid_range_end(128)]
#[repr(transparent)]
pub(crate) struct NonBig(u64);

/// A two-variant enum, thus needs a tag and may not remain uninitialized.
enum Fruit {
    Apple,
    Banana,
}

/// Looks like two variants but really only has one.
enum OneFruit {
    Apple(!),
    Banana,
}

enum OneFruitNonZero {
    Apple(!),
    Banana(NonZero<u32>),
}

enum TwoUninhabited {
    A(!),
    B(Void),
}

#[rustc_layout_scalar_valid_range_start(254)]
#[rustc_layout_scalar_valid_range_end(1)]
pub(crate) struct WrapAroundRange(u8);

#[allow(unused)]
fn generic<T: 'static>() {
    unsafe {
        let _val: &'static T = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: &'static T = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Wrap<&'static T> = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: Wrap<&'static T> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized
    }
}

fn main() {
    unsafe {
        // Things that cannot even be zero.
        let _val: ! = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: ! = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: (i32, !) = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: (i32, !) = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Void = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: Void = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: &'static i32 = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: &'static i32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Ref = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: Ref = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: fn() = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: fn() = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Wrap<fn()> = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: Wrap<fn()> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: WrapEnum<fn()> = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: WrapEnum<fn()> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Wrap<(RefPair, i32)> = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: Wrap<(RefPair, i32)> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: NonNull<i32> = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: NonNull<i32> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: (NonZero<u32>, i32) = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: (NonZero<u32>, i32) = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: *const dyn Send = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: *const dyn Send = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: [fn(); 2] = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: [fn(); 2] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: TwoUninhabited = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: TwoUninhabited = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: OneFruitNonZero = mem::zeroed(); //~ ERROR: does not permit zero-initialization
        let _val: OneFruitNonZero = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        // Things that can be zero, but not uninit.
        let _val: bool = mem::zeroed();
        let _val: bool = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Wrap<char> = mem::zeroed();
        let _val: Wrap<char> = <ext::S as ext::X>::hoy(); //~ ERROR: does not permit being left uninitialized

        let _val: NonBig = mem::zeroed();
        let _val: NonBig = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: Fruit = mem::zeroed();
        let _val: Fruit = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: [bool; 2] = mem::zeroed();
        let _val: [i8; 2] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: i32 = mem::zeroed();
        let _val: i32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: f32 = mem::zeroed();
        let _val: f32 = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: *const () = mem::zeroed();
        let _val: *const () = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: *const [()] = mem::zeroed();
        let _val: *const [()] = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        let _val: WrapAroundRange = mem::zeroed();
        let _val: WrapAroundRange = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        // Things where 0 is okay due to rustc implementation details,
        // but that are not guaranteed to keep working.
        let _val: Result<i32, i32> = mem::zeroed();
        let _val: Result<i32, i32> = mem::uninitialized(); //~ ERROR: does not permit being left uninitialized

        // Some things that happen to be UB-free due to rustc implementation details,
        // but are not guaranteed to keep working.
        let _val: OneFruit = mem::zeroed();
        let _val: OneFruit = mem::uninitialized();

        // Transmute-from-0
        let _val: &'static i32 = mem::transmute(0usize); //~ ERROR: does not permit zero-initialization
        let _val: &'static [i32] = mem::transmute((0usize, 0usize)); //~ ERROR: does not permit zero-initialization
        let _val: NonZero<u32> = mem::transmute(0); //~ ERROR: does not permit zero-initialization

        // `MaybeUninit` cases
        let _val: NonNull<i32> = MaybeUninit::zeroed().assume_init(); //~ ERROR: does not permit zero-initialization
        let _val: NonNull<i32> = MaybeUninit::uninit().assume_init(); //~ ERROR: does not permit being left uninitialized
        let _val: bool = MaybeUninit::uninit().assume_init(); //~ ERROR: does not permit being left uninitialized

        // Some more types that should work just fine.
        let _val: Option<&'static i32> = mem::zeroed();
        let _val: Option<fn()> = mem::zeroed();
        let _val: MaybeUninit<&'static i32> = mem::zeroed();
        let _val: bool = MaybeUninit::zeroed().assume_init();
        let _val: [bool; 0] = MaybeUninit::uninit().assume_init();
        let _val: [!; 0] = MaybeUninit::zeroed().assume_init();
    }
}

Version information

rustc 1.78.0-nightly (bf9c7a64a 2024-02-28)
binary: rustc
commit-hash: bf9c7a64ad222b85397573668b39e6d1ab9f4a72
commit-date: 2024-02-28
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

warning: field `wrapped` is never read
 --> /tmp/icemaker_global_tempdir.dM6dFsZiiTG5/rustc_testrunner_tmpdir_reporting.yGlXFnjDuyZG/mvce.rs:8:5
  |
7 | struct Wrap<T> {
  |        ---- field in this struct
8 |     wrapped: T,
  |     ^^^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: the type `NonZero<u32>` does not permit zero-initialization
  --> /tmp/icemaker_global_tempdir.dM6dFsZiiTG5/rustc_testrunner_tmpdir_reporting.yGlXFnjDuyZG/mvce.rs:15:34
   |
15 |         let _val: NonZero<u32> = mem::transmute(0);
   |                                  ^^^^^^^^^^^^^^^^^
   |                                  |
   |                                  this code causes undefined behavior when executed
   |                                  help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
   |
   = note: `std::num::NonZero<u32>` must be non-null
   = note: `#[warn(invalid_value)]` on by default

thread 'rustc' panicked at compiler/rustc_middle/src/ty/sty.rs:1293:32:
range end index 18446744073709551615 out of range for slice of length 0
stack backtrace:
   0:     0x7f72c8874db6 - std::backtrace_rs::backtrace::libunwind::trace::he457b7c2e954e7cb
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f72c8874db6 - std::backtrace_rs::backtrace::trace_unsynchronized::h2a45be351b5d4141
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f72c8874db6 - std::sys_common::backtrace::_print_fmt::h254e2aa93776cf56
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f72c8874db6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h23f87d31c4a532b3
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f72c88c5d3c - core::fmt::rt::Argument::fmt::h70ae5cf40e1b3a9c
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/core/src/fmt/rt.rs:142:9
   5:     0x7f72c88c5d3c - core::fmt::write::h1f9b4f3016092efe
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f72c88696cf - std::io::Write::write_fmt::ha5bad477c78ce031
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/io/mod.rs:1846:15
   7:     0x7f72c8874b64 - std::sys_common::backtrace::_print::h390dc9acd71fecbd
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f72c8874b64 - std::sys_common::backtrace::print::hc3a43bb3ca42dd1a
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f72c88778ab - std::panicking::default_hook::{{closure}}::h54889b789689d8e2
  10:     0x7f72c88775f9 - std::panicking::default_hook::hc6795fcf5c686a1c
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/panicking.rs:292:9
  11:     0x7f72c54a364c - std[6a867b114883c3c6]::panicking::update_hook::<alloc[f73d663d2b2ff203]::boxed::Box<rustc_driver_impl[9619562741c0c3f7]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f72c8878010 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7f2babd05d8d24e0
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/alloc/src/boxed.rs:2030:9
  13:     0x7f72c8878010 - std::panicking::rust_panic_with_hook::hbcbaaf53a9baed5d
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/panicking.rs:783:13
  14:     0x7f72c8877d52 - std::panicking::begin_panic_handler::{{closure}}::h820c2a5e7c045958
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/panicking.rs:657:13
  15:     0x7f72c8875296 - std::sys_common::backtrace::__rust_end_short_backtrace::ha7a9f3d2e3615f51
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f72c8877a84 - rust_begin_unwind
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/panicking.rs:645:5
  17:     0x7f72c88c2255 - core::panicking::panic_fmt::h2c39cf2986b33eb5
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/core/src/panicking.rs:72:14
  18:     0x7f72c88c85f2 - core::slice::index::slice_end_index_len_fail_rt::h5c90c9c2c1f6c19f
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/core/src/slice/index.rs:76:5
  19:     0x7f72c88c8576 - core::slice::index::slice_end_index_len_fail::h43960563f86cf51e
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/core/src/slice/index.rs:68:9
  20:     0x7f72c6a09c89 - <rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass as rustc_lint[8f247e7d87c5413e]::passes::LateLintPass>::check_expr
  21:     0x7f72c69fd81e - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_expr
  22:     0x7f72c69fd915 - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_expr
  23:     0x7f72c69fc496 - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_block
  24:     0x7f72c69fd8e7 - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_expr
  25:     0x7f72c69fc307 - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_block
  26:     0x7f72c69fd1ba - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_expr::{closure#0}
  27:     0x7f72c6baec66 - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_nested_body
  28:     0x7f72c6d9548d - <rustc_lint[8f247e7d87c5413e]::late::LateContextAndPass<rustc_lint[8f247e7d87c5413e]::BuiltinCombinedModuleLateLintPass> as rustc_hir[746b3c41ee825a99]::intravisit::Visitor>::visit_nested_item
  29:     0x7f72c6d9380e - rustc_lint[8f247e7d87c5413e]::lint_mod
  30:     0x7f72c6d93619 - rustc_query_impl[b823c4807244354d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b823c4807244354d]::query_impl::lint_mod::dynamic_query::{closure#2}::{closure#0}, rustc_middle[cb673eed9ea95983]::query::erase::Erased<[u8; 0usize]>>
  31:     0x7f72c73c7b6d - rustc_query_system[22dbc0c5f4018966]::query::plumbing::try_execute_query::<rustc_query_impl[b823c4807244354d]::DynamicConfig<rustc_query_system[22dbc0c5f4018966]::query::caches::DefaultCache<rustc_span[f0f44e44da00740b]::def_id::LocalModDefId, rustc_middle[cb673eed9ea95983]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b823c4807244354d]::plumbing::QueryCtxt, false>
  32:     0x7f72c73c647f - rustc_query_impl[b823c4807244354d]::query_impl::lint_mod::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7f72c73c601f - rustc_lint[8f247e7d87c5413e]::late::check_crate::{closure#1}
  34:     0x7f72c73c5a1e - rustc_lint[8f247e7d87c5413e]::late::check_crate
  35:     0x7f72c73bf925 - rustc_interface[9dd67852b69825df]::passes::analysis
  36:     0x7f72c73be619 - rustc_query_impl[b823c4807244354d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b823c4807244354d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[cb673eed9ea95983]::query::erase::Erased<[u8; 1usize]>>
  37:     0x7f72c75323e5 - rustc_query_system[22dbc0c5f4018966]::query::plumbing::try_execute_query::<rustc_query_impl[b823c4807244354d]::DynamicConfig<rustc_query_system[22dbc0c5f4018966]::query::caches::SingleCache<rustc_middle[cb673eed9ea95983]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b823c4807244354d]::plumbing::QueryCtxt, false>
  38:     0x7f72c7532149 - rustc_query_impl[b823c4807244354d]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  39:     0x7f72c7539c7c - rustc_interface[9dd67852b69825df]::interface::run_compiler::<core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>, rustc_driver_impl[9619562741c0c3f7]::run_compiler::{closure#0}>::{closure#0}
  40:     0x7f72c77daea3 - std[6a867b114883c3c6]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9dd67852b69825df]::util::run_in_thread_with_globals<rustc_interface[9dd67852b69825df]::util::run_in_thread_pool_with_globals<rustc_interface[9dd67852b69825df]::interface::run_compiler<core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>, rustc_driver_impl[9619562741c0c3f7]::run_compiler::{closure#0}>::{closure#0}, core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>>::{closure#0}, core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>>
  41:     0x7f72c77dacd0 - <<std[6a867b114883c3c6]::thread::Builder>::spawn_unchecked_<rustc_interface[9dd67852b69825df]::util::run_in_thread_with_globals<rustc_interface[9dd67852b69825df]::util::run_in_thread_pool_with_globals<rustc_interface[9dd67852b69825df]::interface::run_compiler<core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>, rustc_driver_impl[9619562741c0c3f7]::run_compiler::{closure#0}>::{closure#0}, core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>>::{closure#0}, core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[2b2f398b31a1f20f]::result::Result<(), rustc_span[f0f44e44da00740b]::ErrorGuaranteed>>::{closure#1} as core[2b2f398b31a1f20f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  42:     0x7f72c88819e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hff43642bea8880be
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/alloc/src/boxed.rs:2016:9
  43:     0x7f72c88819e5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1fd164abdd6e6853
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/alloc/src/boxed.rs:2016:9
  44:     0x7f72c88819e5 - std::sys::pal::unix::thread::Thread::new::thread_start::h222e68bb559bca79
                               at /rustc/bf9c7a64ad222b85397573668b39e6d1ab9f4a72/library/std/src/sys/pal/unix/thread.rs:108:17
  45:     0x7f72c24a955a - <unknown>
  46:     0x7f72c2526a3c - <unknown>
  47:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.78.0-nightly (bf9c7a64a 2024-02-28) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [lint_mod] linting top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error[E0433]: failed to resolve: use of undeclared crate or module `ext`
  --> /tmp/icemaker_global_tempdir.dM6dFsZiiTG5/rustc_testrunner_tmpdir_reporting.yGlXFnjDuyZG/mvce.rs:13:43
   |
13 |         let _val: Wrap<char> = <ext::S as ext::X>::hoy();
   |                                           ^^^ use of undeclared crate or module `ext`

error[E0433]: failed to resolve: use of undeclared crate or module `ext`
  --> /tmp/icemaker_global_tempdir.dM6dFsZiiTG5/rustc_testrunner_tmpdir_reporting.yGlXFnjDuyZG/mvce.rs:13:33
   |
13 |         let _val: Wrap<char> = <ext::S as ext::X>::hoy();
   |                                 ^^^ use of undeclared crate or module `ext`

error: aborting due to 2 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0433`.

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Feb 28, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 28, 2024
@matthiaskrgr
Copy link
Member Author

#121206 cc @nnethercote found another one :D

@nnethercote nnethercote self-assigned this Feb 28, 2024
@nnethercote
Copy link
Contributor

👍 Hopefully will be fixed by #121669.

@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 29, 2024
@nnethercote
Copy link
Contributor

I just confirmed that #121669 fixes this. I don't think it's worth adding this as a test to the test suite.

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. 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

No branches or pull requests

4 participants