Closed Naserume closed 3 months ago
Minimized:
#![feature(auto_traits)]
auto trait Trait {
type Output;
}
fn f() {
let _: <i32 as Trait>::Output = 1_i64;
}
@rustbot label -F-unboxed_closures +F-auto_traits
#![feature(auto_traits)] #![feature(unboxed_closures)] trait T {} fn f() -> impl Fn(T) { let p = (); |_| p } auto trait Fn { type Output; } fn main() {}
Regression in nightly-2024-01-11 (190f4c96116a3b59b7de4881cfec544be0246d84...a2d9d73e608f1b24eba840c4fd2d68dbe3b65e01)
Minimized:
#![feature(auto_traits)] auto trait Trait { type Output; } fn f() { let _: <i32 as Trait>::Output = 1_i64; }
Regression in nightly-2023-06-18 (6bba061467f7c2cab04b262b95eb67bf89265587...3b2073f0762cff4d3d625bb10017e0ce4e7abe50)
probably just another duplicate of https://github.com/rust-lang/rust/issues/117829
Code
Meta
rustc --version --verbose
:Error output
Backtrace
``` error: internal compiler error: compiler/rustc_trait_selection/src/traits/project.rs:1206:21: unexpected builtin trait with associated type: <{closure@./6A4A7.rs:8:5: 8:8} as Fn> thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/project.rs:1206:21: Box
stack backtrace:
0: 0x10f6f6373 - ::fmt::h605d51fc858e32d3
1: 0x10f7412fb - core::fmt::write::he70b1f5b242a09e4
2: 0x10f6ec0be - std::io::Write::write_fmt::hbfde528b9dfff91a
3: 0x10f6f8c1a - std::panicking::default_hook::{{closure}}::hfdc91bfcaaf40c09
4: 0x10f6f88ca - std::panicking::default_hook::h8673ceadddb8316e
5: 0x118a7d8dc - std[8bfe66706d3bd117]::panicking::update_hook::>::{closure#0}
6: 0x10f6f9a09 - std::panicking::rust_panic_with_hook::h206b639ed4704bb1
7: 0x118af0bb7 - std[8bfe66706d3bd117]::panicking::begin_panic::::{closure#0}
8: 0x118adc9f9 - std[8bfe66706d3bd117]::sys::backtrace::__rust_end_short_backtrace::::{closure#0}, !>
9: 0x11d557469 - std[8bfe66706d3bd117]::panicking::begin_panic::
10: 0x118b02c06 - ::emit_producing_guarantee
11: 0x1197c8b45 - rustc_middle[66eaac359ba8a608]::util::bug::opt_span_bug_fmt::::{closure#0}
12: 0x11977f0b7 - rustc_middle[66eaac359ba8a608]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0}
13: 0x11977ebf5 - rustc_middle[66eaac359ba8a608]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !>
14: 0x11d61ff9b - rustc_middle[66eaac359ba8a608]::util::bug::bug_fmt
15: 0x11a7ce9a0 - rustc_trait_selection[bf739c384407ce51]::traits::project::opt_normalize_projection_term
16: 0x11a5db9be - ::commit_if_ok::
17: 0x11a72a112 - ::process_projection_obligation
18: 0x11a7c016f - ::process_obligation
19: 0x118ed2759 - >::process_obligations::
20: 0x118fcb9b2 - as rustc_infer[3da7f7f7e3fca22e]::traits::engine::TraitEngine>::select_where_possible
21: 0x11912a8c2 - ::resolve_vars_with_obligations
22: 0x119133aa2 - ::try_structurally_resolve_type
23: 0x119022626 - ::coerce
24: 0x11910c014 - >::coerce_inner::<>::coerce::{closure#0}>
25: 0x119040d9a - ::check_return_expr
26: 0x119101e36 - rustc_hir_typeck[a7633e0d641b9efc]::check::check_fn
27: 0x1190fd551 - rustc_hir_typeck[a7633e0d641b9efc]::typeck
28: 0x11a16666c - rustc_query_impl[ab99e8e391ad42b2]::plumbing::__rust_begin_short_backtrace::>
29: 0x119fe3fae - rustc_query_system[55587a8be6cb95b6]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[ab99e8e391ad42b2]::plumbing::QueryCtxt, false>
30: 0x11a189dab - rustc_query_impl[ab99e8e391ad42b2]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
31: 0x118cb1923 - rustc_middle[66eaac359ba8a608]::query::plumbing::query_get_at::>>
32: 0x118e25646 - rustc_hir_analysis[c06ca58d4f3a4935]::collect::type_of::type_of_opaque
33: 0x11a160c1c - rustc_query_impl[ab99e8e391ad42b2]::plumbing::__rust_begin_short_backtrace::>
34: 0x119f3390f - rustc_query_system[55587a8be6cb95b6]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[ab99e8e391ad42b2]::plumbing::QueryCtxt, false>
35: 0x11a16fad9 - rustc_query_impl[ab99e8e391ad42b2]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
36: 0x118cb0cde - rustc_middle[66eaac359ba8a608]::query::plumbing::query_get_at::>>
37: 0x118e246f7 - rustc_hir_analysis[c06ca58d4f3a4935]::collect::type_of::type_of
38: 0x11a1666e8 - rustc_query_impl[ab99e8e391ad42b2]::plumbing::__rust_begin_short_backtrace::>
39: 0x119f3390f - rustc_query_system[55587a8be6cb95b6]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[ab99e8e391ad42b2]::plumbing::QueryCtxt, false>
40: 0x11a16f729 - rustc_query_impl[ab99e8e391ad42b2]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
41: 0x118cb0cde - rustc_middle[66eaac359ba8a608]::query::plumbing::query_get_at::>>
42: 0x118d87ec5 - rustc_hir_analysis[c06ca58d4f3a4935]::check::check::check_item_type
43: 0x118dbd0f1 - rustc_hir_analysis[c06ca58d4f3a4935]::check::wfcheck::check_well_formed
44: 0x11a1620dc - rustc_query_impl[ab99e8e391ad42b2]::plumbing::__rust_begin_short_backtrace::>
45: 0x119ff02df - rustc_query_system[55587a8be6cb95b6]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[ab99e8e391ad42b2]::plumbing::QueryCtxt, false>
46: 0x11a1ac7d0 - rustc_query_impl[ab99e8e391ad42b2]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
47: 0x118cb1d22 - rustc_middle[66eaac359ba8a608]::query::plumbing::query_ensure_error_guaranteed::>, ()>
48: 0x118dcbd51 - rustc_hir_analysis[c06ca58d4f3a4935]::check::wfcheck::check_mod_type_wf
49: 0x11a1620ac - rustc_query_impl[ab99e8e391ad42b2]::plumbing::__rust_begin_short_backtrace::>
50: 0x119f8d589 - rustc_query_system[55587a8be6cb95b6]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[ab99e8e391ad42b2]::plumbing::QueryCtxt, false>
51: 0x11a189200 - rustc_query_impl[ab99e8e391ad42b2]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
52: 0x118e4c0bc - rustc_hir_analysis[c06ca58d4f3a4935]::check_crate
53: 0x11940ce37 - rustc_interface[f3798eed8f7e14ff]::passes::run_required_analyses
54: 0x11940f2d3 - rustc_interface[f3798eed8f7e14ff]::passes::analysis
55: 0x11a16671c - rustc_query_impl[ab99e8e391ad42b2]::plumbing::__rust_begin_short_backtrace::>
56: 0x119f3ebfe - rustc_query_system[55587a8be6cb95b6]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[ab99e8e391ad42b2]::plumbing::QueryCtxt, false>
57: 0x11a170c77 - rustc_query_impl[ab99e8e391ad42b2]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
58: 0x118a23537 - >::enter::, rustc_driver_impl[d8a49a9463f03e6]::run_compiler::{closure#0}::{closure#1}::{closure#5}>
59: 0x118a84c1b - rustc_interface[f3798eed8f7e14ff]::interface::run_compiler::, rustc_driver_impl[d8a49a9463f03e6]::run_compiler::{closure#0}>::{closure#1}
60: 0x118a6ffc1 - std[8bfe66706d3bd117]::sys::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[d8a49a9463f03e6]::run_compiler::{closure#0}>::{closure#1}, core[84f3396b7379d157]::result::Result<(), rustc_span[9df13b32b3ae4eb2]::ErrorGuaranteed>>::{closure#0}, core[84f3396b7379d157]::result::Result<(), rustc_span[9df13b32b3ae4eb2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[84f3396b7379d157]::result::Result<(), rustc_span[9df13b32b3ae4eb2]::ErrorGuaranteed>>
61: 0x118a8b5e6 - <::spawn_unchecked_, rustc_driver_impl[d8a49a9463f03e6]::run_compiler::{closure#0}>::{closure#1}, core[84f3396b7379d157]::result::Result<(), rustc_span[9df13b32b3ae4eb2]::ErrorGuaranteed>>::{closure#0}, core[84f3396b7379d157]::result::Result<(), rustc_span[9df13b32b3ae4eb2]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[84f3396b7379d157]::result::Result<(), rustc_span[9df13b32b3ae4eb2]::ErrorGuaranteed>>::{closure#2} as core[84f3396b7379d157]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
62: 0x10f7029bb - std::sys::pal::unix::thread::Thread::new::thread_start::hff8a09cc296b9c2d
63: 0x7ff801f5318b - __pthread_start
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 `/Users/sal/Documents/240714/rustc-ice-2024-07-15T02_02_55-63072.txt` to your bug report
query stack during panic:
#0 [typeck] type-checking `f`
#1 [type_of_opaque] computing type of opaque `f::{opaque#0}`
end of query stack
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0107, E0380.
For more information about an error, try `rustc --explain E0107`.
```
Note
ICE location https://github.com/rust-lang/rust/blob/fcaa6fdfbee1316184e7ad98c53241d52cd30a5f/compiler/rustc_trait_selection/src/traits/project.rs#L1122-L1207
@rustbot label +A-auto-traits +F-unboxed_closures