-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.Area: saving results of analyses such as inference and borrowck results to a file.C-bugCategory: This is a bug.Category: This is a bug.F-impl_trait_in_bindings`#![feature(impl_trait_in_bindings)]``#![feature(impl_trait_in_bindings)]`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.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
Code
Code is from ./src/test/ui/impl-trait/bound-normalization-pass.rs
and ICEs with -Zsave-analysis
#![feature(impl_trait_in_bindings)]
mod impl_trait_in_bindings {
struct Foo;
trait FooLike { type Output; }
impl FooLike for Foo {
type Output = u32;
}
trait Trait {
type Assoc;
}
fn foo<T: Trait<Assoc=u32>>() {
let _: impl FooLike<Output=T::Assoc> = Foo;
}
}
fn main() {}
Meta
repo is at 567ad74
Error output
warning: the feature `impl_trait_in_bindings` is incomplete and may not be safe to use and/or cause compiler crashes
--> ./src/test/ui/impl-trait/bound-normalization-pass.rs:1:12
|
1 | #![feature(impl_trait_in_bindings)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
= note: see issue #63065 <https://github.com/rust-lang/rust/issues/63065> for more information
warning: struct is never constructed: `Foo`
--> ./src/test/ui/impl-trait/bound-normalization-pass.rs:4:12
|
4 | struct Foo;
| ^^^
|
= note: `#[warn(dead_code)]` on by default
warning: function is never used: `foo`
--> ./src/test/ui/impl-trait/bound-normalization-pass.rs:16:8
|
16 | fn foo<T: Trait<Assoc=u32>>() {
| ^^^
error: internal compiler error: src/librustc_middle/ty/context.rs:205:13: node type T::Assoc (hir_id=HirId { owner: DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]), local_id: 1 }) with HirId::owner DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]) cannot be placed in TypeckTables with hir_owner DefId(0:12 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0])
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:916:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.46.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -Z save-analysis
error: aborting due to previous error; 3 warnings emitted
Backtrace
error: internal compiler error: src/librustc_middle/ty/context.rs:205:13: node type T::Assoc (hir_id=HirId { owner: DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]), local_id: 1 }) with HirId::owner DefId(0:14 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0]::{{opaque}}[0]) cannot be placed in TypeckTables with hir_owner DefId(0:12 ~ bound_normalization_pass[317d]::impl_trait_in_bindings[0]::foo[0])
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:916:9
stack backtrace:
0: 0x7faf0969b1c8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h452b6396b264f28c
1: 0x7faf096eb95d - core::fmt::write::h657c0023317a8e5f
2: 0x7faf09683455 - std::io::Write::write_fmt::haed1c27064617598
3: 0x7faf096c0540 - std::panicking::default_hook::{{closure}}::h7e5c28cdf5e29ae6
4: 0x7faf096c026a - std::panicking::default_hook::h5564c3f415dda0e2
5: 0x7faf0a64bcd9 - rustc_driver::report_ice::h0989ef95a2487a9e
6: 0x7faf096c0bc6 - std::panicking::rust_panic_with_hook::heba90bd5191496ac
7: 0x7faf0ce5b7f3 - std::panicking::begin_panic::hcef7cb40099863f5
8: 0x7faf0ce58ed0 - rustc_errors::HandlerInner::bug::h59aa3e9b5f5516a6
9: 0x7faf0ce57860 - rustc_errors::Handler::bug::he7489805580a6712
10: 0x7faf0c915ca8 - rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}::h19919efaba95980b
11: 0x7faf0c9134a3 - rustc_middle::ty::context::tls::with_opt::{{closure}}::hc9a96bc98e3ca66d
12: 0x7faf0c912fd9 - rustc_middle::ty::context::tls::with_opt::he7403f4d464bc79e
13: 0x7faf0c915bc7 - rustc_middle::util::bug::opt_span_bug_fmt::h62767bdbaedcb039
14: 0x7faf0c915b3c - rustc_middle::util::bug::bug_fmt::h2de8835c540a5bf0
15: 0x7faf0cadd96b - rustc_middle::ty::context::validate_hir_id_for_typeck_tables::{{closure}}::h558abebdc630793c
16: 0x7faf0cae8ef9 - rustc_middle::ty::context::tls::with::{{closure}}::h7805b93f94dea590
17: 0x7faf0cae8ee0 - rustc_middle::ty::context::tls::with_context::{{closure}}::h54431fc1c98f5a99
18: 0x7faf0cade1d8 - rustc_middle::ty::context::TypeckTables::type_dependent_def::ha117131041b4087b
19: 0x7faf0cade05b - rustc_middle::ty::context::TypeckTables::qpath_res::he121d406bbe250d4
20: 0x7faf0a70cac6 - rustc_save_analysis::SaveContext::get_path_res::h33a868405209c7ec
21: 0x7faf0a6ac275 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_ty::h83e010d48ebcb749
22: 0x7faf0a67978d - rustc_hir::intravisit::walk_generic_args::h82bfa5149fea66c3
23: 0x7faf0a67c76a - rustc_hir::intravisit::walk_item::h1214a19c1ab8d928
24: 0x7faf0a67d55d - rustc_hir::intravisit::walk_stmt::hfb608461f62b27ad
25: 0x7faf0a67c08f - rustc_hir::intravisit::walk_expr::h81101427f8d38241
26: 0x7faf0a6a8327 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_item::h97b7fa73ed294718
27: 0x7faf0a6a6c51 - <rustc_save_analysis::dump_visitor::DumpVisitor as rustc_hir::intravisit::Visitor>::visit_item::h97b7fa73ed294718
28: 0x7faf0a6a3721 - rustc_save_analysis::dump_visitor::DumpVisitor::process_crate::hf2a7c0eb46ca6337
29: 0x7faf0a61b2b1 - rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps::h1cdae784c8ea7438
30: 0x7faf0a4b6311 - rustc_session::utils::<impl rustc_session::session::Session>::time::h0b7baeeed7ea4774
31: 0x7faf0a61a73b - rustc_middle::ty::context::tls::enter_global::hb0942f7d70d658ed
32: 0x7faf0a4b9a74 - rustc_interface::interface::create_compiler_and_run::hd4e4c7ee144acf28
33: 0x7faf0a61729e - scoped_tls::ScopedKey<T>::set::h6463f931b3e3941e
34: 0x7faf0a4d53dc - std::sys_common::backtrace::__rust_begin_short_backtrace::h2a12ef3f60008590
35: 0x7faf0a4d82be - core::ops::function::FnOnce::call_once{{vtable.shim}}::h8f177575de1afee8
36: 0x7faf096c3168 - std::sys::unix::thread::Thread::new::thread_start::hb21db09729478797
37: 0x7faf064df422 - start_thread
38: 0x7faf094e2bf3 - __GI___clone
39: 0x0 - <unknown>
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.46.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -Z save-analysis
query stack during panic:
end of query stack
error: aborting due to previous error; 3 warnings emitted
Metadata
Metadata
Assignees
Labels
A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.Area: saving results of analyses such as inference and borrowck results to a file.C-bugCategory: This is a bug.Category: This is a bug.F-impl_trait_in_bindings`#![feature(impl_trait_in_bindings)]``#![feature(impl_trait_in_bindings)]`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.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.