Closed matthiaskrgr closed 10 months ago
Also hit this with...
#![feature(const_trait_impl, effects, rustc_attrs)]
#[const_trait]
pub trait Stone {
type Recorded: Copy;
fn get_record<#[rustc_host] const host: bool = true>(&self) -> Self::Recorded;
}
pub struct Wall<T: Stone>(T::Recorded);
pub struct Brick;
impl const Stone for Brick {
type Recorded = i32;
fn get_record(&self) -> i32 {
0
}
}
impl<T: ~const Stone> Wall<T> {
const fn new(value: T) -> Self {
Self(value.get_record())
}
}
fn main() {
let _ = Wall::new(Brick);
}
Error output...
Compiling playground v0.0.1 (/playground)
warning: the feature `rustc_attrs` is internal to the compiler or standard library
--> src/main.rs:1:39
|
1 | #![feature(const_trait_impl, effects, rustc_attrs)]
| ^^^^^^^^^^^
|
= note: using it is strongly discouraged
= note: `#[warn(internal_features)]` on by default
error: internal compiler error: compiler/rustc_hir_analysis/src/collect/generics_of.rs:320:21: parent also has host effect param? index: 1, def: DefId(0:5 ~ playground[bb69]::Stone::get_record)
thread 'rustc' panicked at /rustc/249624b5043013d18c00f0401ca431c1a6baa8cd/compiler/rustc_errors/src/lib.rs:1659:9:
Box<dyn Any>
stack backtrace:
... see 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 attach the file at `/playground/rustc-ice-2023-10-21T16_54_00-17.txt` to your bug report
note: compiler flags: --crate-type bin -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 [generics_of] computing generics of `Stone::get_record`
#1 [collect_mod_item_types] collecting item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
warning: `playground` (bin "playground") generated 1 warning
error: could not compile `playground` (bin "playground"); 1 warning emitted
```
0: 0x7f1ea4a3b17c - std::backtrace_rs::backtrace::libunwind::trace::he8dc9e634c3d5b69
at /rustc/249624b5043013d18c00f0401ca431c1a6baa8cd/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7f1ea4a3b17c - std::backtrace_rs::backtrace::trace_unsynchronized::hcc1fc094cc2c1843
at /rustc/249624b5043013d18c00f0401ca431c1a6baa8cd/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f1ea4a3b17c - std::sys_common::backtrace::_print_fmt::he6c8e9059e21630d
at /rustc/249624b5043013d18c00f0401ca431c1a6baa8cd/library/std/src/sys_common/backtrace.rs:67:5
3: 0x7f1ea4a3b17c -
Code
Meta
rustc --version --verbose
:Error output
Backtrace
``` error: internal compiler error: compiler/rustc_hir_analysis/src/collect/generics_of.rs:319:21: parent also has host effect param? index: 1, def: DefId(0:6 ~ treereduce[e3bb]::{impl#0}::value) thread 'rustc' panicked at 'Box', /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/compiler/rustc_errors/src/lib.rs:1651:9
stack backtrace:
0: 0x7f3658763a81 - std::backtrace_rs::backtrace::libunwind::trace::hd0180fafc3f67189
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: 0x7f3658763a81 - std::backtrace_rs::backtrace::trace_unsynchronized::h5f5f542cfcd3ea93
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7f3658763a81 - std::sys_common::backtrace::_print_fmt::h58fe9485d729332b
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/sys_common/backtrace.rs:65:5
3: 0x7f3658763a81 - ::fmt::h892fa574703406ce
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7f36587c9d8f - core::fmt::rt::Argument::fmt::h9323d9ac1296ca86
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/core/src/fmt/rt.rs:138:9
5: 0x7f36587c9d8f - core::fmt::write::h7b3311fc7bec7011
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/core/src/fmt/mod.rs:1094:21
6: 0x7f36587564c7 - std::io::Write::write_fmt::hf0bd33b3cf0f8fc8
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/io/mod.rs:1714:15
7: 0x7f3658763895 - std::sys_common::backtrace::_print::h05e7ce29169ad453
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/sys_common/backtrace.rs:47:5
8: 0x7f3658763895 - std::sys_common::backtrace::print::h259bd490e3a5f495
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/sys_common/backtrace.rs:34:9
9: 0x7f3658766673 - std::panicking::default_hook::{{closure}}::h60419100c25d1f9e
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/panicking.rs:269:22
10: 0x7f3658766404 - std::panicking::default_hook::h5458ac0b23f9b258
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/panicking.rs:288:9
11: 0x7f365ba3634b - rustc_driver_impl[e2bfb106dcd1f64f]::install_ice_hook::{closure#0}
12: 0x7f3658766e9e - as core::ops::function::Fn>::call::h4fc06bcacf328e1a
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/alloc/src/boxed.rs:2024:9
13: 0x7f3658766e9e - std::panicking::rust_panic_with_hook::hc4b8011c5070ed88
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/panicking.rs:709:13
14: 0x7f365bff5291 - std[c4949d010b2b12f5]::panicking::begin_panic::::{closure#0}
15: 0x7f365bff36e6 - std[c4949d010b2b12f5]::sys_common::backtrace::__rust_end_short_backtrace::::{closure#0}, !>
16: 0x7f365bff35a6 - std[c4949d010b2b12f5]::panicking::begin_panic::
17: 0x7f365bf558b4 - ::bug::
18: 0x7f365bf55736 - ::bug::
19: 0x7f365bf652fc - rustc_middle[36f410a133de2eee]::util::bug::opt_span_bug_fmt::::{closure#0}
20: 0x7f365bf64a0a - rustc_middle[36f410a133de2eee]::ty::context::tls::with_opt::::{closure#0}, !>::{closure#0}
21: 0x7f365bf649da - rustc_middle[36f410a133de2eee]::ty::context::tls::with_context_opt::::{closure#0}, !>::{closure#0}, !>
22: 0x7f365a16610d - rustc_middle[36f410a133de2eee]::util::bug::bug_fmt
23: 0x7f365a3742a6 - rustc_hir_analysis[efec7ea34622ed25]::collect::generics_of::generics_of
24: 0x7f365a370c58 - rustc_query_impl[b274d6131f7b1f90]::plumbing::__rust_begin_short_backtrace::>
25: 0x7f365a370bf0 - >::call_once
26: 0x7f3659a6ad65 - rustc_query_system[d3399df1ed0f61e2]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[b274d6131f7b1f90]::plumbing::QueryCtxt, false>
27: 0x7f365b3b6ed3 - rustc_query_impl[b274d6131f7b1f90]::query_impl::generics_of::get_query_non_incr::__rust_end_short_backtrace
28: 0x7f365a0d5e5b - ::visit_impl_item
29: 0x7f365a0d4e0e - ::visit_item_likes_in_module::
30: 0x7f365a0d4c8c - rustc_hir_analysis[efec7ea34622ed25]::collect::collect_mod_item_types
31: 0x7f365a69fb4c - rustc_query_impl[b274d6131f7b1f90]::plumbing::__rust_begin_short_backtrace::>
32: 0x7f365a69fb2e - >::call_once
33: 0x7f365a18a7df - rustc_query_system[d3399df1ed0f61e2]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[b274d6131f7b1f90]::plumbing::QueryCtxt, false>
34: 0x7f365b37f974 - rustc_query_impl[b274d6131f7b1f90]::query_impl::collect_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
35: 0x7f365ae79147 - ::for_each_module::
36: 0x7f365ae78d82 - ::track_errors::
37: 0x7f365ae77561 - rustc_hir_analysis[efec7ea34622ed25]::check_crate
38: 0x7f365ae6e64a - rustc_interface[b03e5b36acd0a493]::passes::analysis
39: 0x7f365aef958a - rustc_query_impl[b274d6131f7b1f90]::plumbing::__rust_begin_short_backtrace::>
40: 0x7f365aef9579 - >::call_once
41: 0x7f365b092e88 - rustc_query_system[d3399df1ed0f61e2]::query::plumbing::try_execute_query::>, false, false, false>, rustc_query_impl[b274d6131f7b1f90]::plumbing::QueryCtxt, false>
42: 0x7f365b092c59 - rustc_query_impl[b274d6131f7b1f90]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
43: 0x7f365ac62545 - ::enter::>
44: 0x7f365ac61b72 - ::enter::, rustc_span[ffa356b4eef30eb1]::ErrorGuaranteed>>
45: 0x7f365ac58885 - rustc_span[ffa356b4eef30eb1]::set_source_map::, rustc_interface[b03e5b36acd0a493]::interface::run_compiler, rustc_driver_impl[e2bfb106dcd1f64f]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
46: 0x7f365ac582f6 - >::set::, rustc_driver_impl[e2bfb106dcd1f64f]::run_compiler::{closure#1}>::{closure#0}, core[1877eeee917502d9]::result::Result<(), rustc_span[ffa356b4eef30eb1]::ErrorGuaranteed>>
47: 0x7f365ac578bc - std[c4949d010b2b12f5]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[e2bfb106dcd1f64f]::run_compiler::{closure#1}>::{closure#0}, core[1877eeee917502d9]::result::Result<(), rustc_span[ffa356b4eef30eb1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1877eeee917502d9]::result::Result<(), rustc_span[ffa356b4eef30eb1]::ErrorGuaranteed>>
48: 0x7f365ac57685 - <::spawn_unchecked_, rustc_driver_impl[e2bfb106dcd1f64f]::run_compiler::{closure#1}>::{closure#0}, core[1877eeee917502d9]::result::Result<(), rustc_span[ffa356b4eef30eb1]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[1877eeee917502d9]::result::Result<(), rustc_span[ffa356b4eef30eb1]::ErrorGuaranteed>>::{closure#1} as core[1877eeee917502d9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
49: 0x7f3658771315 - as core::ops::function::FnOnce>::call_once::ha34cb32f4acd27b7
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/alloc/src/boxed.rs:2010:9
50: 0x7f3658771315 - as core::ops::function::FnOnce>::call_once::h309fb4796a356ecf
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/alloc/src/boxed.rs:2010:9
51: 0x7f3658771315 - std::sys::unix::thread::Thread::new::thread_start::h947cced02a86e329
at /rustc/e4cd1610067501fa4d347eba7b18f77137dbbf48/library/std/src/sys/unix/thread.rs:108:17
52: 0x7f365850444b -
53: 0x7f3658587e40 -
54: 0x0 -
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.72.0-nightly (e4cd16100 2023-07-05) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [generics_of] computing generics of `::value`
#1 [collect_mod_item_types] collecting item types in top-level module
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0379, E0407, E0601.
For more information about an error, try `rustc --explain E0379`.
```