Skip to content

ICE on #![feature(rustc_insignificant_dtor)] #85680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PatchMixolydic opened this issue May 25, 2021 · 1 comment · Fixed by #86446
Closed

ICE on #![feature(rustc_insignificant_dtor)] #85680

PatchMixolydic opened this issue May 25, 2021 · 1 comment · Fixed by #86446
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@PatchMixolydic
Copy link
Contributor

Code

(playground)

#![feature(rustc_insignificant_dtor)]

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (5dc8789e3 2021-05-21)
binary: rustc
commit-hash: 5dc8789e300930751a78996da0fa906be5a344a2
commit-date: 2021-05-21
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Also reproduced on the playground: 1.54.0-nightly (2021-05-24 126561cb31e8ebe1e2dd).

Error output

thread 'rustc' panicked at 'feature `rustc_insignificant_dtor` is not declared anywhere', compiler/rustc_feature/src/lib.rs:122:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

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.54.0-nightly (5dc8789e3 2021-05-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
Backtrace

thread 'rustc' panicked at 'feature `rustc_insignificant_dtor` is not declared anywhere', compiler/rustc_feature/src/lib.rs:122:21
stack backtrace:
   0: rust_begin_unwind
             at /rustc/5dc8789e300930751a78996da0fa906be5a344a2/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/5dc8789e300930751a78996da0fa906be5a344a2/library/std/src/panicking.rs:457:5
   2: rustc_feature::find_feature_issue
   3: core::ops::function::FnOnce::call_once{{vtable.shim}}
   4: rustc_middle::lint::struct_lint_level::struct_lint_level_impl
   5: rustc_middle::lint::struct_lint_level
   6: rustc_lint::levels::LintLevelsBuilder::struct_lint
   7: rustc_lint::context::LintContext::struct_span_lint
   8: <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::fold
   9: <rustc_lint::builtin::IncompleteFeatures as rustc_lint::passes::EarlyLintPass>::check_crate
  10: rustc_lint::early::check_ast_crate
  11: rustc_session::utils::<impl rustc_session::session::Session>::time
  12: rustc_interface::passes::BoxedResolver::access::{{closure}}
  13: rustc_interface::passes::configure_and_expand::{{closure}}
  14: rustc_interface::passes::BoxedResolver::access
  15: rustc_interface::queries::Queries::lower_to_hir
  16: rustc_interface::queries::Queries::global_ctxt
  17: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  18: rustc_span::with_source_map
  19: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

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.54.0-nightly (5dc8789e3 2021-05-21) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

Addendum

Note that similar internal feature gates don't ICE (playground):

#![feature(rustc_variance)]
error[E0635]: unknown feature `rustc_variance`
 --> src/lib.rs:1:12
  |
1 | #![feature(rustc_variance)]
  |            ^^^^^^^^^^^^^^

error: aborting due to previous error
@PatchMixolydic PatchMixolydic added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 25, 2021
@jyn514 jyn514 added the requires-nightly This issue requires a nightly compiler in some way. label May 25, 2021
@PatchMixolydic
Copy link
Contributor Author

PatchMixolydic commented May 26, 2021

This ICE does not happen if the incomplete_features lint is allowed (playground). This may be because rustc_insignificant_dtor is listed in rustc_feature::active::INCOMPLETE_FEATURES but is not declared with declare_features!.

pub const INCOMPLETE_FEATURES: &[Symbol] = &[
sym::if_let_guard,
sym::impl_trait_in_bindings,
sym::generic_associated_types,
sym::const_generics,
sym::let_chains,
sym::raw_dylib,
sym::const_evaluatable_checked,
sym::const_trait_impl,
sym::const_trait_bound_opt_out,
sym::lazy_normalization_consts,
sym::specialization,
sym::inline_const,
sym::repr128,
sym::unsized_locals,
sym::capture_disjoint_fields,
sym::inherent_associated_types,
sym::type_alias_impl_trait,
sym::rustc_insignificant_dtor,
sym::unnamed_fields,
];

Looking at a7e1cec, it seems like I missed something: rustc_insignificant_dtor, along with rustc_variance and friends, are attributes, not feature gates. The fix might simply be to remove it from INCOMPLETE_FEATURES.

fanninpm added a commit to fanninpm/glacier that referenced this issue Jun 4, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jun 5, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 29, 2021
…, r=Mark-Simulacrum

Don't make `rustc_insignificant_dtor` feature gate

This isn't a feature gate, it's an attribute that is feature gated behind the `rustc_attrs` attribute. Closes rust-lang#85680.
@bors bors closed this as completed in 1abb5bc Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants