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

Using an associated function as a method leads to a compilation panic #120085

Closed
alexeykhan opened this issue Jan 18, 2024 · 3 comments
Closed

Using an associated function as a method leads to a compilation panic #120085

alexeykhan opened this issue Jan 18, 2024 · 3 comments
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

@alexeykhan
Copy link

Code

struct Human;

trait Baby {
    fn baby() -> String;
}

impl Baby for Human {
    fn baby() -> String {
        String::from("implemented trait: baby!")
    }
}

impl Human {
    fn baby() -> String {
        String::from("human baby")
    }
}

fn main() {
    let human = Human;
    println!("{}", human.baby());
}

Meta

rustc --version --verbose:

rustc 1.75.0 (82e1608df 2023-12-21)
binary: rustc
commit-hash: 82e1608dfa6e0b5569232559e3d385fea5a93112
commit-date: 2023-12-21
host: aarch64-apple-darwin
release: 1.75.0
LLVM version: 17.0.6

Error output

❯ cargo run
   Compiling problems v0.1.0
thread 'rustc' panicked at compiler/rustc_hir_typeck/src/method/suggest.rs:3299:28:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0:        0x1010dd304 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h298c9ab285ff3934
   1:        0x10111f2c8 - core::fmt::write::h4e276abdb6d0c2a1
   2:        0x1010d3ac4 - std::io::Write::write_fmt::hd421848f5f0bf9d0
   3:        0x1010dd140 - std::sys_common::backtrace::print::hd8bd9ecab1f94b94
   4:        0x1010dfb40 - std::panicking::default_hook::{{closure}}::h520eeb743fc98fb4
   5:        0x1010df888 - std::panicking::default_hook::ha6550ffe49b63df1
   6:        0x10a1d9688 - <alloc[7c7540ab8626f01a]::boxed::Box<rustc_driver_impl[468d0e274936ffb9]::install_ice_hook::{closure#0}> as core[5213bbcd403abe9e]::ops::function::Fn<(&dyn for<'a, 'b> core[5213bbcd403abe9e]::ops::function::Fn<(&'a core[5213bbcd403abe9e]::panic::panic_info::PanicInfo<'b>,), Output = ()> + core[5213bbcd403abe9e]::marker::Send + core[5213bbcd403abe9e]::marker::Sync, &core[5213bbcd403abe9e]::panic::panic_info::PanicInfo)>>::call
   7:        0x1010e01b8 - std::panicking::rust_panic_with_hook::hddb0e884a202de7c
   8:        0x1010dff80 - std::panicking::begin_panic_handler::{{closure}}::hd2798398a2fd9077
   9:        0x1010dd76c - std::sys_common::backtrace::__rust_end_short_backtrace::h9201cc364dbb8a23
  10:        0x1010dfd1c - _rust_begin_unwind
  11:        0x101139118 - core::panicking::panic_fmt::h4d5168028d4c43c7
  12:        0x1011392a4 - core::panicking::panic_bounds_check::h17fa693e54374598
  13:        0x10a66bab4 - rustc_hir_typeck[67526d70d648d1bc]::method::suggest::print_disambiguation_help
  14:        0x10a5c16e0 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::note_candidates_on_method_error
  15:        0x10a5b87dc - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::report_no_match_method_error
  16:        0x10a5e93a0 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::report_method_error
  17:        0x10a5df0d4 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_kind
  18:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19:        0x10a5e0a70 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_kind
  20:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  21:        0x10a59c540 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_argument_types
  22:        0x10a57a3a0 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::confirm_builtin_call
  23:        0x10a5791e8 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_call
  24:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  25:        0x10a5df784 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_kind
  26:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27:        0x10a5e0a70 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_kind
  28:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  29:        0x10a59c540 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_argument_types
  30:        0x10a57a3a0 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::confirm_builtin_call
  31:        0x10a5791e8 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_call
  32:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:        0x10a59c540 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_argument_types
  34:        0x10a57a3a0 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::confirm_builtin_call
  35:        0x10a5791e8 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_call
  36:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  37:        0x10a5a2c90 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_stmt
  38:        0x10a5a3264 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_block_with_expected
  39:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  40:        0x10a5a2c90 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_stmt
  41:        0x10a5a3264 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_block_with_expected
  42:        0x10a586a54 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  43:        0x10a587c80 - <rustc_hir_typeck[67526d70d648d1bc]::fn_ctxt::FnCtxt>::check_return_expr
  44:        0x10a6b8634 - rustc_hir_typeck[67526d70d648d1bc]::check::check_fn
  45:        0x10a639fe0 - rustc_hir_typeck[67526d70d648d1bc]::typeck
  46:        0x10b3171a0 - rustc_query_impl[5bcaede170c3d419]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5bcaede170c3d419]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ca6410b6d29fc80e]::query::erase::Erased<[u8; 8usize]>>
  47:        0x10b40867c - <rustc_query_impl[5bcaede170c3d419]::query_impl::typeck::dynamic_query::{closure#2} as core[5213bbcd403abe9e]::ops::function::FnOnce<(rustc_middle[ca6410b6d29fc80e]::ty::context::TyCtxt, rustc_span[e10e2d7f054ef3fb]::def_id::LocalDefId)>>::call_once
  48:        0x10b2df120 - rustc_query_system[879461235231c87d]::query::plumbing::try_execute_query::<rustc_query_impl[5bcaede170c3d419]::DynamicConfig<rustc_query_system[879461235231c87d]::query::caches::VecCache<rustc_span[e10e2d7f054ef3fb]::def_id::LocalDefId, rustc_middle[ca6410b6d29fc80e]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[5bcaede170c3d419]::plumbing::QueryCtxt, true>
  49:        0x10b3ae2f8 - rustc_query_impl[5bcaede170c3d419]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  50:        0x10a4d0d10 - std[1bb08b5702199c76]::panicking::try::<(), core[5213bbcd403abe9e]::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures[919fbfa8d0821c7b]::sync::parallel::disabled::par_for_each_in<&[rustc_span[e10e2d7f054ef3fb]::def_id::LocalDefId], <rustc_middle[ca6410b6d29fc80e]::hir::map::Map>::par_body_owners<rustc_hir_analysis[709ef6bc47d99aaa]::check_crate::{closure#7}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>>
  51:        0x10a47c8c4 - <rustc_data_structures[919fbfa8d0821c7b]::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures[919fbfa8d0821c7b]::sync::parallel::disabled::par_for_each_in<&[rustc_span[e10e2d7f054ef3fb]::def_id::LocalDefId], <rustc_middle[ca6410b6d29fc80e]::hir::map::Map>::par_body_owners<rustc_hir_analysis[709ef6bc47d99aaa]::check_crate::{closure#7}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
  52:        0x10a4762c8 - rustc_hir_analysis[709ef6bc47d99aaa]::check_crate
  53:        0x10a8c7ac0 - rustc_interface[ea1e3d08865d7976]::passes::analysis
  54:        0x10b31723c - rustc_query_impl[5bcaede170c3d419]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5bcaede170c3d419]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ca6410b6d29fc80e]::query::erase::Erased<[u8; 1usize]>>
  55:        0x10b47ec04 - <rustc_query_impl[5bcaede170c3d419]::query_impl::analysis::dynamic_query::{closure#2} as core[5213bbcd403abe9e]::ops::function::FnOnce<(rustc_middle[ca6410b6d29fc80e]::ty::context::TyCtxt, ())>>::call_once
  56:        0x10b282754 - rustc_query_system[879461235231c87d]::query::plumbing::try_execute_query::<rustc_query_impl[5bcaede170c3d419]::DynamicConfig<rustc_query_system[879461235231c87d]::query::caches::SingleCache<rustc_middle[ca6410b6d29fc80e]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[5bcaede170c3d419]::plumbing::QueryCtxt, true>
  57:        0x10b39f374 - rustc_query_impl[5bcaede170c3d419]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  58:        0x10a1b1228 - <rustc_middle[ca6410b6d29fc80e]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[468d0e274936ffb9]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>>
  59:        0x10a1b02d4 - rustc_span[e10e2d7f054ef3fb]::set_source_map::<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_interface[ea1e3d08865d7976]::interface::run_compiler<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_driver_impl[468d0e274936ffb9]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  60:        0x10a1f5764 - <scoped_tls[299824ca9de1a1fb]::ScopedKey<rustc_span[e10e2d7f054ef3fb]::SessionGlobals>>::set::<rustc_interface[ea1e3d08865d7976]::interface::run_compiler<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_driver_impl[468d0e274936ffb9]::run_compiler::{closure#1}>::{closure#0}, core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>>
  61:        0x10a1b0bf8 - rustc_span[e10e2d7f054ef3fb]::create_session_globals_then::<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_interface[ea1e3d08865d7976]::interface::run_compiler<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_driver_impl[468d0e274936ffb9]::run_compiler::{closure#1}>::{closure#0}>
  62:        0x10a1e2d74 - std[1bb08b5702199c76]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ea1e3d08865d7976]::util::run_in_thread_with_globals<rustc_interface[ea1e3d08865d7976]::interface::run_compiler<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_driver_impl[468d0e274936ffb9]::run_compiler::{closure#1}>::{closure#0}, core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>>
  63:        0x10a1fbbc0 - <<std[1bb08b5702199c76]::thread::Builder>::spawn_unchecked_<rustc_interface[ea1e3d08865d7976]::util::run_in_thread_with_globals<rustc_interface[ea1e3d08865d7976]::interface::run_compiler<core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>, rustc_driver_impl[468d0e274936ffb9]::run_compiler::{closure#1}>::{closure#0}, core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[5213bbcd403abe9e]::result::Result<(), rustc_span[e10e2d7f054ef3fb]::ErrorGuaranteed>>::{closure#1} as core[5213bbcd403abe9e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  64:        0x1010e83b4 - std::sys::unix::thread::Thread::new::thread_start::h9b6324e2391e6ebb
  65:        0x188f13fa8 - __pthread_joiner_wake

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.75.0 (82e1608df 2023-12-21) running on aarch64-apple-darwin

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `problems` (bin "problems")
Backtrace

❯ RUST_BACKTRACE=1 cargo build
   Compiling problems v0.1.0
thread 'rustc' panicked at compiler/rustc_hir_typeck/src/method/suggest.rs:3299:28:
index out of bounds: the len is 0 but the index is 0
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_bounds_check
   3: rustc_hir_typeck::method::suggest::print_disambiguation_help
   4: <rustc_hir_typeck::fn_ctxt::FnCtxt>::note_candidates_on_method_error
   5: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_no_match_method_error
   6: <rustc_hir_typeck::fn_ctxt::FnCtxt>::report_method_error
   7: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
   8: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
   9: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  10: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  11: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  12: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
  13: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  14: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  15: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  16: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  17: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_kind
  18: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  19: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  20: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
  21: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  22: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  23: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_argument_types
  24: <rustc_hir_typeck::fn_ctxt::FnCtxt>::confirm_builtin_call
  25: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_call
  26: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  27: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_stmt
  28: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  29: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_stmt
  31: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_block_with_expected
  32: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33: <rustc_hir_typeck::fn_ctxt::FnCtxt>::check_return_expr
  34: rustc_hir_typeck::check::check_fn
  35: rustc_hir_typeck::typeck
      [... omitted 2 frames ...]
  36: std::panicking::try::<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::disabled::par_for_each_in<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#7}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>>
  37: <rustc_data_structures::sync::parallel::ParallelGuard>::run::<(), rustc_data_structures::sync::parallel::disabled::par_for_each_in<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_analysis::check_crate::{closure#7}>::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
  38: rustc_hir_analysis::check_crate
  39: rustc_interface::passes::analysis
      [... omitted 2 frames ...]
  40: <rustc_middle::ty::context::GlobalCtxt>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#6}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  41: rustc_span::set_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  42: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
  43: rustc_span::create_session_globals_then::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.75.0 (82e1608df 2023-12-21) running on aarch64-apple-darwin

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C split-debuginfo=unpacked -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `problems` (bin "problems")

@alexeykhan alexeykhan 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 Jan 18, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 18, 2024
@alexeykhan alexeykhan changed the title Ambiguous Associated Function Names Using an associated function as a method leads to a compilation panic Jan 18, 2024
@alexeykhan
Copy link
Author

Running the same code with nightly doesn't panic:

❯ cargo +nightly run
   Compiling problems v0.1.0
error[E0599]: no method named `baby` found for struct `Human` in the current scope
   --> src/main.rs:150:26
    |
112 | struct Human;
    | ------------ method `baby` not found for this struct
...
150 |     println!("{}", human.baby());
    |                          ^^^^ this is an associated function, not a method
    |
    = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: candidate #1 is defined in an impl for the type `Human`
   --> src/main.rs:140:5
    |
140 |     fn baby() -> String {
    |     ^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `Pilot`
   --> src/main.rs:115:5
    |
115 |     fn baby() -> String;
    |     ^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #2
    |
150 |     println!("{}", <Human as Pilot>::baby());
    |                    ~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0599`.
error: could not compile `problems` (bin "problems") due to 1 previous error

@matthiaskrgr
Copy link
Member

#117728

@saethlin
Copy link
Member

This is fixed on beta too. I don't think there's anything to do here? This ICE isn't severe enough to merit a stable point release, and the fix is already on the way.

@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 18, 2024
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