Skip to content

ICE: failed to process buffered lint here (dummy = false) #139825

Open
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: --check-cfg=cfg(docsrs,test)
type FnGood = for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> fn(yes); // OK
type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn(FALSE);

type PolyGood = dyn for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> Copy; // OK
type PolyBad = dyn for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> Copy;

struct WhereGood
where
    for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> u8: Copy; // OK

// OK

// OK

// OK

// OK

// OK
original code

original:

//@ compile-flags:--cfg yes --check-cfg=cfg(yes,no)

fn f_lt<#[cfg(yes)] 'a: 'a, #[cfg(FALSE)] T>() {}
fn f_ty<#[cfg(FALSE)] 'a: 'a, #[cfg(yes)] T>() {}

type FnGood = for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> fn(); // OK
type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn();
//~^ ERROR only lifetime parameters can be used in this context

type PolyGood = dyn for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> Copy; // OK
type PolyBad = dyn for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> Copy;
//~^ ERROR only lifetime parameters can be used in this context

struct WhereGood where for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> u8: Copy; // OK
struct WhereBad where for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> u8: Copy;
//~^ ERROR only lifetime parameters can be used in this context

fn f_lt_no<#[cfg_attr(FALSE, unknown)] 'a>() {} // OK
fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {}
//~^ ERROR cannot find attribute `unknown` in this scope
fn f_ty_no<#[cfg_attr(FALSE, unknown)] T>() {} // OK
fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {}
//~^ ERROR cannot find attribute `unknown` in this scope

type FnNo = for<#[cfg_attr(FALSE, unknown)] 'a> fn(); // OK
type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn();
//~^ ERROR cannot find attribute `unknown` in this scope

type PolyNo = dyn for<#[cfg_attr(FALSE, unknown)] 'a> Copy; // OK
type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy;
//~^ ERROR cannot find attribute `unknown` in this scope

struct WhereNo where for<#[cfg_attr(FALSE, unknown)] 'a> u8: Copy; // OK
struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy;
//~^ ERROR cannot find attribute `unknown` in this scope

fn main() {
    f_lt::<'static>();
    f_ty::<u8>();
}

Version information

rustc 1.88.0-nightly (07d3fd1d9 2025-04-14)
binary: rustc
commit-hash: 07d3fd1d9b9c1f07475b96a9d168564bf528db68
commit-date: 2025-04-14
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --check-cfg=cfg(docsrs,test)

Program output

error[E0412]: cannot find type `yes` in this scope
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:1:55
  |
1 | type FnGood = for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> fn(yes); // OK
  |                                                       ^^^ not found in this scope

error[E0412]: cannot find type `FALSE` in this scope
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:2:54
  |
2 | type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn(FALSE);
  |                                                      ^^^^^ not found in this scope
  |
help: you may want to use a bool value instead
  |
2 - type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn(FALSE);
2 + type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn(false);
  |

warning: unexpected `cfg` condition name: `yes`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:1:25
  |
1 | type FnGood = for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> fn(yes); // OK
  |                         ^^^
  |
  = help: expected names are: `docsrs` and `test` and 31 more
  = help: to expect this configuration use `--check-cfg=cfg(yes)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
  = note: `#[warn(unexpected_cfgs)]` on by default

warning: unexpected `cfg` condition name: `FALSE`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:1:41
  |
1 | type FnGood = for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> fn(yes); // OK
  |                                         ^^^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(FALSE)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `FALSE`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:2:24
  |
2 | type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn(FALSE);
  |                        ^^^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(FALSE)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `yes`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:2:42
  |
2 | type FnBad = for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> fn(FALSE);
  |                                          ^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(yes)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `yes`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:4:31
  |
4 | type PolyGood = dyn for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> Copy; // OK
  |                               ^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(yes)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `FALSE`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:4:47
  |
4 | type PolyGood = dyn for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> Copy; // OK
  |                                               ^^^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(FALSE)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `FALSE`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:5:30
  |
5 | type PolyBad = dyn for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> Copy;
  |                              ^^^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(FALSE)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

warning: unexpected `cfg` condition name: `yes`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:5:48
  |
5 | type PolyBad = dyn for<#[cfg(FALSE)] 'a, #[cfg(yes)] T> Copy;
  |                                                ^^^
  |
  = help: to expect this configuration use `--check-cfg=cfg(yes)`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs:9:51
  |
9 |     for<#[cfg(yes)] 'a, #[cfg(FALSE)] T> u8: Copy; // OK
  |                                                   ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.DgZc43XxscLa/rustc_testrunner_tmpdir_reporting.d8TE3zkji74S/mvce.rs`

error: aborting due to 3 previous errors; 8 warnings emitted

Some errors have detailed explanations: E0412, E0601.
For more information about an error, try `rustc --explain E0412`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-attributesArea: Attributes (`#[…]`, `#![…]`)A-cfgArea: `cfg` conditional compilationA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.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