Skip to content

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

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

Open
matthiaskrgr opened this issue Apr 14, 2025 · 3 comments
Open

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

matthiaskrgr opened this issue Apr 14, 2025 · 3 comments
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-cfg Area: `cfg` conditional compilation A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. 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.

Comments

@matthiaskrgr
Copy link
Member

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`.

@matthiaskrgr matthiaskrgr 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 Apr 14, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 14, 2025
@matthiaskrgr
Copy link
Member Author

mvce for --check-cfg=cfg(docsrs,test) --crate-type lib

struct a
where
    for<#[cfg(b)] c> u8:;

@matthiaskrgr
Copy link
Member Author

bisects to #132388

@matthiaskrgr matthiaskrgr changed the title ICE: failed to process buffered lint here (dummy = false)` ICE: failed to process buffered lint here (dummy = false) Apr 14, 2025
@theemathas
Copy link
Contributor

Another variant:

fn foo()
where
    u8: for<#[cfg(b)] 'a> Sized
{}

@jieyouxu jieyouxu added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. A-cfg Area: `cfg` conditional compilation and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-cfg Area: `cfg` conditional compilation A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. 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.
Projects
None yet
Development

No branches or pull requests

4 participants