-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-explicit_tail_calls`#![feature(explicit_tail_calls)]``#![feature(explicit_tail_calls)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.This issue requires the use of incomplete features.
Description
Code
#![feature(explicit_tail_calls)]
#![expect(incomplete_features)]
trait Trait {}
trait Trait {
fn foo(&self) {
become self.foo();
}
}
@rustbot labels +F-explicit_tail_calls +requires-incomplete-features
Meta
Reproducible on the playground with version 1.91.0-nightly (2025-08-05 ec7c02612527d185c379)
Error output
error[E0428]: the name `Trait` is defined multiple times
--> src/lib.rs:6:1
|
4 | trait Trait {}
| ----------- previous definition of the trait `Trait` here
5 |
6 | trait Trait {
| ^^^^^^^^^^^ `Trait` redefined here
|
= note: `Trait` must be defined only once in the type namespace of this module
error: internal compiler error: compiler/rustc_middle/src/ty/instance.rs:633:21: failed to resolve instance for <Self as Trait>::foo
--> src/lib.rs:7:5
|
7 | fn foo(&self) {
| ^^^^^^^^^^^^^
Backtrace
thread 'rustc' panicked at compiler/rustc_middle/src/ty/instance.rs:633:21:
Box<dyn Any>
stack backtrace:
0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
2: <rustc_errors::DiagCtxtHandle>::span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
7: <rustc_middle::ty::instance::Instance>::expect_resolve
8: <rustc_mir_build::check_tail_calls::TailCallCkVisitor as rustc_middle::thir::visit::Visitor>::visit_expr
9: <rustc_mir_build::check_tail_calls::TailCallCkVisitor as rustc_middle::thir::visit::Visitor>::visit_expr
10: <rustc_mir_build::check_tail_calls::TailCallCkVisitor as rustc_middle::thir::visit::Visitor>::visit_block
11: <rustc_mir_build::check_tail_calls::TailCallCkVisitor as rustc_middle::thir::visit::Visitor>::visit_expr
12: <rustc_mir_build::check_tail_calls::TailCallCkVisitor as rustc_middle::thir::visit::Visitor>::visit_expr
13: <rustc_mir_build::check_tail_calls::TailCallCkVisitor as rustc_middle::thir::visit::Visitor>::visit_expr
[... omitted 1 frame ...]
14: rustc_mir_build::builder::build_mir
15: rustc_mir_transform::mir_built
[... omitted 1 frame ...]
16: rustc_mir_build::check_unsafety::check_unsafety
[... omitted 1 frame ...]
17: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#1}::{closure#0}>::{closure#0}
18: rustc_interface::passes::analysis
[... omitted 1 frame ...]
19: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
20: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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 `/playground/rustc-ice-2025-08-06T07_27_59-27.txt` to your bug report
note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [check_tail_calls] tail-call-checking `Trait::foo`
#1 [mir_built] building MIR for `Trait::foo`
#2 [check_unsafety] unsafety-checking `Trait::foo`
#3 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0428`.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-explicit_tail_calls`#![feature(explicit_tail_calls)]``#![feature(explicit_tail_calls)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-incomplete-featuresThis issue requires the use of incomplete features.This issue requires the use of incomplete features.