Repository navigation
Nightly ICEs trying to normalize during a cast #73747
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
On the latest nightly (2020-06-25), a small usage of the WinRT crate causes an ICE when trying to compile even a small example. I confirmed that the past week of nightly releases compile fine before the latest. On the latest stable (1.44.1) this compiles just fine as expected.
Code
Cargo.toml:
[dependencies]
winrt = "0.7.0"use winrt::*;
use windows::security::credentials::ui::UserConsentVerifier;
import!(
dependencies
os
types
windows::security::credentials::ui::UserConsentVerifier
);
fn main() {
let _ = UserConsentVerifier::check_availability_async().unwrap();
}Meta
rustc --version --verbose:
rustc 1.46.0-nightly (50fc24d8a 2020-06-25)
binary: rustc
commit-hash: 50fc24d8a172a853b5dfe40702d6550e3b8562ba
commit-date: 2020-06-25
host: x86_64-pc-windows-msvc
release: 1.46.0-nightly
LLVM version: 10.0
Error output
error: internal compiler error: src\librustc_traits\normalize_erasing_regions.rs:37:32: could not fully normalize `std::ptr::NonNull<std::ptr::NonNull<<windows::foundation::IAsyncOperation<TResult> as winrt::com::interface::ComInterface>::VTable>>`
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-nightly (50fc24d8a 2020-06-25) running on x86_64-pc-windows-msvc
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
query stack during panic:
#0 [normalize_generic_arg_after_erasing_regions] normalizing `std::ptr::NonNull<std::ptr::NonNull<<windows::foundation::IAsyncOperation<TResult> as winrt::com::interface::ComInterface>::VTable>>`
#1 [lint_mod] linting module `windows::foundation`
#2 [analysis] running analysis passes on this crate
end of query stack
Backtrace
thread 'rustc' panicked at 'Box<Any>', src\librustc_errors\lib.rs:916:9
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: <std::io::IoSliceMut as core::fmt::Debug>::fmt
3: std::panicking::take_hook
4: std::panicking::take_hook
5: rustc_driver::report_ice
6: std::panicking::rust_panic_with_hook
7: <rustc_errors::styled_buffer::StyledBuffer as core::fmt::Debug>::fmt
8: rustc_errors::HandlerInner::err_count
9: rustc_errors::Handler::bug
10: rustc_middle::util::bug::bug_fmt
11: rustc_middle::ty::walk::<impl rustc_middle::ty::subst::GenericArg>::walk_shallow
12: rustc_middle::ty::walk::<impl rustc_middle::ty::subst::GenericArg>::walk_shallow
13: rustc_middle::util::bug::bug_fmt
14: rustc_middle::util::bug::bug_fmt
15: <rustc_traits::chalk::db::RustIrDatabase as chalk_solve::RustIrDatabase<rustc_middle::traits::chalk::RustInterner>>::hidden_opaque_type
16: <rustc_traits::chalk::lowering::ParamsSubstitutor as rustc_middle::ty::fold::TypeFolder>::fold_region
17: <rustc_middle::ty::query::Query as rustc_data_structures::stable_hasher::HashStable<rustc_middle::ich::hcx::StableHashingContext>>::hash_stable
18: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::debug_node
19: <rustc_middle::ty::binding::BindingMode as rustc_middle::ty::context::Lift>::lift_to_tcx
20: <rustc_middle::ty::subst::UserSubsts as core::fmt::Debug>::fmt
21: <rustc_middle::ty::normalize_erasing_regions::NormalizeAfterErasingRegionsFolder as rustc_middle::ty::fold::TypeFolder>::fold_ty
22: <rustc_lint::types::TypeLimits as rustc_lint::passes::LateLintPass>::check_expr
23: <rustc_lint::types::TypeLimits as rustc_lint::passes::LateLintPass>::check_expr
24: <rustc_lint::types::ImproperCTypesVisitor::check_for_opaque_ty::ProhibitOpaqueTypes as rustc_middle::ty::fold::TypeVisitor>::visit_ty
25: <rustc_lint::types::ImproperCTypesVisitor::check_for_opaque_ty::ProhibitOpaqueTypes as rustc_middle::ty::fold::TypeVisitor>::visit_ty
26: <rustc_lint::BuiltinCombinedModuleLateLintPass as rustc_lint::passes::LateLintPass>::check_fn
27: rustc_lint::late::unerased_lint_store
28: rustc_lint::builtin::ClashingExternDecl::get_lints
29: <rustc_lint::array_into_iter::ArrayIntoIter as rustc_session::lint::LintPass>::name
30: rustc_lint::builtin::ClashingExternDecl::get_lints
31: <rustc_lint::array_into_iter::ArrayIntoIter as rustc_session::lint::LintPass>::name
32: <rustc_lint::late::LateLintPassObjects as rustc_session::lint::LintPass>::name
33: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
34: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
35: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
36: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
37: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
38: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
39: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
40: <rustc_interface::util::ReplaceBodyWithLoop as rustc_ast::mut_visit::MutVisitor>::visit_mac
41: rustc_interface::passes::QueryContext::print_stats
42: <rustc_driver::args::Error as core::fmt::Debug>::fmt
43: <rustc_metadata::foreign_modules::Collector as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_impl_item
44: rustc_driver::pretty::print_after_hir_lowering
45: <i32 as petgraph::matrix_graph::Zero>::zero
46: rustc_driver::pretty::print_after_hir_lowering
47: <rustc_driver::args::Error as core::fmt::Debug>::fmt
48: <rustc_metadata::foreign_modules::Collector as rustc_hir::itemlikevisit::ItemLikeVisitor>::visit_impl_item
49: <rustc_driver::args::Error as core::fmt::Debug>::fmt
50: <rustc_driver::DEFAULT_HOOK as core::ops::deref::Deref>::deref
51: <i32 as petgraph::matrix_graph::Zero>::zero
52: std::sys::windows::thread::Thread::new
53: BaseThreadInitThunk
54: RtlUserThreadStart
Reacted by Avi Dessauer and Kenny Kerr
Metadata
Metadata
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityHigh priorityT-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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
LeSeulArtichaut commentedon Jun 26, 2020
Let’s try to find an MCVE. I’d also like to find the culprit PR, which shouldn’t take too long since we know in which nightly this regressed.
@rustbot ping cleanup
rustbot commentedon Jun 26, 2020
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3
cc @AminArria @camelid @chrissimpkins @contrun @DutchGhost @elshize @ethanboxx @h-michael @HallerPatrick @hdhoang @hellow554 @imtsuki @kanru @KarlK90 @LeSeulArtichaut @MAdrianMattocks @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @senden9 @shekohex @sinato @spastorino @turboladen @woshilapin @yerke
Dylan-DPC-zz commentedon Jun 26, 2020
Just tried this out locally as well and can confirm the ICE happens.. time to dig in ..
spastorino commentedon Jun 26, 2020
@rustbot ping windows
rustbot commentedon Jun 26, 2020
Hey Windows Group! This bug has been identified as a good "Windows candidate".
In case it's useful, here are some instructions for tackling these sorts of
bugs. Maybe take a look?
Thanks! <3
cc @arlosi @danielframpton @gdr-at-ms @kennykerr @luqmana @lzybkr @retep998 @rylev @sivadeilra @spastorino
Avi-D-coder commentedon Jun 27, 2020
Similar ICE
The correct error from
nightly-2020-06-18(There may be newer nightlys before the regesion)ICE / Backtrace
15 remaining items
Rollup merge of rust-lang#74340 - davidtwco:issue-73747-improper-ctyp…
pnkfelix commentedon Jul 14, 2020
Keeping at P-critical based on conversation at: https://zulip-archive.rust-lang.org/245100tcompilerwgprioritizationalerts/57076Iprioritize73747NightlyICEstryingtonormalizeduring.html#203858906
pnkfelix commentedon Jul 16, 2020
reopening; the next beta was cut before this landed in master, so this ended up being a regression-from-stable-to-beta
pnkfelix commentedon Jul 16, 2020
however, I also think the bug is under control now that the PR has landed on nightly. Reprioritizing as P-high.
emilyalbini commentedon Aug 21, 2020
The fix was backported, closing.