Skip to content

[ICE]: is not an owner #163374

Closed
Closed

Description

@matthiaskrgr

Code

#[warn(rust_2024_prelude_collisions)]
fn main() {
    ().into_future()
}
use future::{IntoFuture};
mod future {
    pub trait IntoFuture {
        fn into_future(&self) {}
    }
    impl IntoFuture for () {}
}

Meta

rustc --version --verbose:

rustc 1.100.0-nightly (5ceaf6608 2026-09-25)
binary: rustc
commit-hash: 5ceaf6608eb354c2f5bbb3b8d974caa367dac81c
commit-date: 2026-09-25
host: x86_64-unknown-linux-gnu
release: 1.100.0-nightly
LLVM version: 23.1.1

Error output

<output>
Backtrace

error: internal compiler error: /rustc-dev/5ceaf6608eb354c2f5bbb3b8d974caa367dac81c/compiler/rustc_middle/src/hir/map.rs:140:32: DefId(0:5 ~ code[4489]::{use#1}::{use#0}) is not an owner
 --> code.rs:5:14
  |
5 | use future::{IntoFuture};
  |              ^^^^^^^^^^


thread 'rustc' (3425717) panicked at /rustc-dev/5ceaf6608eb354c2f5bbb3b8d974caa367dac81c/compiler/rustc_middle/src/hir/map.rs:140:32:
Box<dyn Any>
stack backtrace:
   0:     0x7fe72d410916 - <<std[4e3e5122718436ea]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[df69dfd27f4aceb1]::fmt::Display>::fmt
   1:     0x7fe72da092df - core[df69dfd27f4aceb1]::fmt::write
   2:     0x7fe72d4258dc - <std[4e3e5122718436ea]::sys::stdio::unix::Stderr as core[df69dfd27f4aceb1]::io::write::Write>::write_fmt
   3:     0x7fe72d3e321a - std[4e3e5122718436ea]::panicking::default_hook::{closure#0}
   4:     0x7fe72d404d23 - std[4e3e5122718436ea]::panicking::default_hook
   5:     0x7fe72c168ed6 - std[4e3e5122718436ea]::panicking::update_hook::<alloc[f7b4942899dbd9a8]::boxed::Box<rustc_driver_impl[8a9241412565640d]::install_ice_hook::{closure#1}>>::{closure#0}
   6:     0x7fe72d4051c2 - std[4e3e5122718436ea]::panicking::panic_with_hook
   7:     0x7fe72cf98f71 - std[4e3e5122718436ea]::panicking::begin_panic::<rustc_span[17eb9802bfc7b0b1]::macros::ExplicitBug>::{closure#0}
   8:     0x7fe72cf97abe - std[4e3e5122718436ea]::sys::backtrace::__rust_end_short_backtrace::<std[4e3e5122718436ea]::panicking::begin_panic<rustc_span[17eb9802bfc7b0b1]::macros::ExplicitBug>::{closure#0}, !>
   9:     0x7fe72cf97262 - std[4e3e5122718436ea]::panicking::begin_panic::<rustc_span[17eb9802bfc7b0b1]::macros::ExplicitBug>
  10:     0x7fe729311161 - rustc_span[17eb9802bfc7b0b1]::macros::bug_impl
  11:     0x7fe72dfce470 - <rustc_middle[bcd1109c707c4cd5]::ty::context::TyCtxt>::hir_expect_item
  12:     0x7fe72c4dadb2 - <rustc_hir_typeck[8b455a8928c70169]::fn_ctxt::FnCtxt>::trait_path_or_bare_name
  13:     0x7fe72c562207 - <rustc_hir_typeck[8b455a8928c70169]::method::prelude_edition_lints::AmbiguousTraitMethod as rustc_errors[5a936017551d7df9]::diagnostic::Diagnostic>::into_diag
  14:     0x7fe72c49280e - <rustc_middle[bcd1109c707c4cd5]::lint::emit_lint_base<rustc_hir_typeck[8b455a8928c70169]::method::prelude_edition_lints::AmbiguousTraitMethod, rustc_middle[bcd1109c707c4cd5]::lint::LevelSpec<rustc_lint_defs[b9a46a91eb6606ea]::StableLintExpectationId>>::{closure#0} as core[df69dfd27f4aceb1]::ops::function::FnOnce<(rustc_errors[5a936017551d7df9]::DiagCtxtHandle, rustc_errors[5a936017551d7df9]::Level)>>::call_once::{shim:vtable#0}
  15:     0x7fe72deffb18 - rustc_middle[bcd1109c707c4cd5]::lint::emit_lint_base::emit_lint_base_impl
  16:     0x7fe72db5d5e4 - <rustc_hir_typeck[8b455a8928c70169]::fn_ctxt::FnCtxt>::check_expr_method_call
  17:     0x7fe72e402335 - <rustc_hir_typeck[8b455a8928c70169]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  18:     0x7fe72e3f497f - <rustc_hir_typeck[8b455a8928c70169]::fn_ctxt::FnCtxt>::check_expr_block
  19:     0x7fe72e402309 - <rustc_hir_typeck[8b455a8928c70169]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  20:     0x7fe72e3ed678 - rustc_hir_typeck[8b455a8928c70169]::check::check_fn
  21:     0x7fe72ee5a486 - rustc_hir_typeck[8b455a8928c70169]::typeck_with_inspect::{closure#0}
  22:     0x7fe72ee5893a - rustc_query_impl[658b0b4479b4082]::query_vtables::typeck_root::invoke_provider_fn::__rust_begin_short_backtrace
  23:     0x7fe72e42f6fa - rustc_query_impl[658b0b4479b4082]::execution::try_execute_query::<rustc_data_structures[479a506a1b750eb2]::vec_cache::VecCache<rustc_span[17eb9802bfc7b0b1]::def_id::LocalDefId, rustc_middle[bcd1109c707c4cd5]::query::erase::ErasedData<[u8; 8usize]>, rustc_middle[bcd1109c707c4cd5]::dep_graph::graph::DepNodeIndex>, false>
  24:     0x7fe72e42f32b - rustc_query_impl[658b0b4479b4082]::query_vtables::typeck_root::execute_query_non_incr::__rust_end_short_backtrace
  25:     0x7fe72e07f5fa - <rustc_middle[bcd1109c707c4cd5]::ty::context::TyCtxt>::par_hir_body_owners::<rustc_hir_analysis[ba0aa8f9a0e166c8]::check_crate::{closure#1}>::{closure#0}
  26:     0x7fe72e07eca5 - rustc_hir_analysis[ba0aa8f9a0e166c8]::check_crate
  27:     0x7fe72e42c0fc - rustc_interface[7962de54e6a85a]::passes::analysis
  28:     0x7fe72eb085c7 - rustc_query_impl[658b0b4479b4082]::execution::try_execute_query::<rustc_middle[bcd1109c707c4cd5]::query::caches::SingleCache<rustc_middle[bcd1109c707c4cd5]::query::erase::ErasedData<[u8; 0usize]>>, false>
  29:     0x7fe72eb0836b - rustc_query_impl[658b0b4479b4082]::query_vtables::analysis::execute_query_non_incr::__rust_end_short_backtrace
  30:     0x7fe72eccd6fe - rustc_interface[7962de54e6a85a]::interface::run_compiler::<(), rustc_driver_impl[8a9241412565640d]::run_compiler::{closure#0}>::{closure#2}
  31:     0x7fe72ed135e4 - std[4e3e5122718436ea]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[7962de54e6a85a]::util::run_in_thread_with_globals<rustc_interface[7962de54e6a85a]::util::run_in_thread_pool_with_globals<rustc_interface[7962de54e6a85a]::interface::run_compiler<(), rustc_driver_impl[8a9241412565640d]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  32:     0x7fe72ed1338b - <std[4e3e5122718436ea]::thread::lifecycle::spawn_unchecked<rustc_interface[7962de54e6a85a]::util::run_in_thread_with_globals<rustc_interface[7962de54e6a85a]::util::run_in_thread_pool_with_globals<rustc_interface[7962de54e6a85a]::interface::run_compiler<(), rustc_driver_impl[8a9241412565640d]::run_compiler::{closure#0}>::{closure#2}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[df69dfd27f4aceb1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  33:     0x7fe72ed1eb5b - <std[4e3e5122718436ea]::sys::thread::unix::Thread>::new::thread_start
  34:     0x7fe727c980a2 - <unknown>
  35:     0x7fe727d2080c - <unknown>
  36:                0x0 - <unknown>

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: please make sure that you have updated to the latest nightly

note: please attach the file at `/home/matthias/vcs/github/CRED/rustc-ice-2026-09-26T12_23_20-3425707.txt` to your bug report

note: rustc 1.100.0-nightly (5ceaf6608 2026-09-25) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [typeck_root] type-checking `main`
#1 [analysis] running analysis passes on crate `code`
end of query stack
error: aborting due to 1 previous error

Activity

  1. added
    I-ICE
    T-compiler
    C-bug
    on Sep 26, 2026
  2. added
    needs-triage
    on Sep 26, 2026
  3. added
    regression-from-stable-to-nightly
    on Sep 26, 2026
  4. added
    I-prioritize
    on Sep 26, 2026
  5. matthiaskrgr commented on Sep 26, 2026

    @matthiaskrgr
    MemberAuthor

    this compiled on beta:

    warning: trait method `into_future` will become ambiguous in Rust 2024
     --> code.rs:3:5
      |
    3 |     ().into_future()
      |     ^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `IntoFuture::into_future(&())`
      |
      = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2024!
      = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/prelude.html>
    note: the lint level is defined here
     --> code.rs:1:8
      |
    1 | #[warn(rust_2024_prelude_collisions)]
      |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    warning: 1 warning emitted
    
  6. matthiaskrgr commented on Sep 26, 2026

    @matthiaskrgr
    MemberAuthor

    this smells like #161349 because when I change
    use future::{IntoFuture};
    to
    use future::IntoFuture;, the code compiles

  7. apiraino commented on Sep 26, 2026

    @apiraino
    Contributor

    I think I'm doing something wrong, I can't reproduce with the nightly build you indicate. I just run rustc test.rs on your repro and I see no difference with compiling with the beta or stable. Maybe I need some params? 🤔

  8. matthiaskrgr commented on Sep 26, 2026

    @matthiaskrgr
    MemberAuthor

    it does reproduce for me with editions 2015 (default) and 2018, 2021.
    Did you do this inside a cargo new (which defaults to 2024)?
    playground repro:

    https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=b2cb4b611c7907c6dccee0c3080c1869

  9. Sontran0118 commented on Sep 27, 2026

    @Sontran0118

    I reproduced the error in editions 2015, 2018, and 2021. The same error also showed up in this code:

    fn main() {
        ().try_into()
    }
    use conv::{TryIntoLike};
    mod conv {
        pub trait TryIntoLike {
            fn try_into(&self) {}
        }
        impl TryIntoLike for () {}
    }
    
    
  10. added
    A-resolve
    S-has-mcve
    and removed
    needs-triage
    on Sep 28, 2026
  11. 8 remaining items

  12. theemathas commented on Oct 19, 2026

    @theemathas
    Contributor

    @Sontran0118 @oli-obk FYI, both of you are currently assigned this issue.

  13. oli-obk commented on Oct 20, 2026

    @oli-obk
    Contributor

    Yea I was at eurorust last week and have a work meeting this week. Should get to it later this week

  14. removed
    I-prioritize
    on Oct 26, 2026
  15. rustbot commented on Oct 26, 2026

    @rustbot
    Collaborator

    Assigning P-high (discussion on Zulip)

  16. added
    P-high
    on Oct 26, 2026
  17. added 6 commits that reference this issue on Oct 29, 2026
    019aec1
    0e75140
    0b2e29a
    f8b65ae
    cf74df5
    b2df480
  18. added a commit that references this issue on Oct 31, 2026
    67c3d9d
  19. added a commit that references this issue on Nov 2, 2026
    d00dbd3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-resolveC-bugI-ICEP-highS-has-bisectionS-has-mcveT-compilerregression-from-stable-to-beta

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions