Skip to content

force-warns panics with unknown lint name #86958

Closed

Description

@ehuss

Using the --force-warns option with an unknown lint name causes an ICE.

rustc +nightly --force-warns=abc -Zunstable-options foo.rs

I expected to see this happen: Issue a E0602 error.

Meta

rustc --version --verbose:

rustc 1.55.0-nightly (885399992 2021-07-06)
binary: rustc
commit-hash: 885399992c4c1dde37b506b8507a7d69415646b9
commit-date: 2021-07-06
host: x86_64-apple-darwin
release: 1.55.0-nightly
LLVM version: 12.0.1
Backtrace

thread 'rustc' panicked at 'compiler/rustc_lint/src/levels.rs:117:37: A valid lint failed to produce a lint ids', compiler/rustc_middle/src/util/bug.rs:35:26
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   3: rustc_middle::ty::context::tls::with_opt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_lint::levels::LintLevelsBuilder::process_command_line::{{closure}}
   8: rustc_lint::levels::LintLevelsBuilder::new
   9: rustc_lint::context::EarlyContext::new
  10: rustc_lint::early::check_ast_crate
  11: rustc_interface::passes::pre_expansion_lint
  12: rustc_interface::passes::configure_and_expand
  13: rustc_interface::queries::Queries::expansion
  14: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  15: rustc_span::with_source_map
  16: rustc_interface::interface::create_compiler_and_run
  17: scoped_tls::ScopedKey<T>::set

cc @rylev

Activity

  1. inquisitivecrystal commented on Jul 8, 2021

    @inquisitivecrystal
    Contributor

    @rustbot claim

    I'm going to take a look at this. I'm also going to see if I can fix the problem you mentioned at #86009 (comment) while I'm at it.

  2. ehuss commented on Jul 8, 2021

    @ehuss
    ContributorAuthor

    Just FYI, the cap-lints issue has been fixed by #86572.

  3. inquisitivecrystal commented on Jul 8, 2021

    @inquisitivecrystal
    Contributor

    Good to know!

  4. added 2 commits that reference this issue on Jul 15, 2021
    2886cc8
    2b621e3
  5. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jul 18, 2021
  6. added a commit that references this issue on Jul 19, 2021
    b543e0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions