Skip to content
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

Linter ICEs when zst_query lint is run on bevy_lint #252

Open
BD103 opened this issue Jan 31, 2025 · 2 comments
Open

Linter ICEs when zst_query lint is run on bevy_lint #252

BD103 opened this issue Jan 31, 2025 · 2 comments
Labels
A-Linter Related to the linter and custom lints C-Bug A bug in the program S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@BD103
Copy link
Member

BD103 commented Jan 31, 2025

Steps to Reproduce

You can reproduce this by checking out #251 and adding the following to bevy_lint/Cargo.toml:

[package.metadata.bevy_lint]
zst_query = "warn"

Finally, run the following:

cd bevy_lint
cargo build
cargo run

Error

$ cargo r 
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.09s
     Running `/<SNIP>/bevy_cli/target/debug/bevy_lint`
   Compiling proc-macro2 v1.0.92
   Compiling serde v1.0.217
   Compiling bevy_lint v0.2.0-dev (/<SNIP>/bevy_cli/bevy_lint)
note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: unelided lifetime in signature
 --> bevy_lint/build.rs:7:5
  |
7 |     println!("cargo::rerun-if-changed=build.rs");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:434:13 - disabled backtrace
 --> bevy_lint/build.rs:7:5
  |
7 |     println!("cargo::rerun-if-changed=build.rs");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error: internal compiler error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: unelided lifetime in signature
 --> bevy_lint/build.rs:8:5
  |
8 |     println!("cargo::rerun-if-changed=../rust-toolchain.toml");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:434:13 - disabled backtrace
 --> bevy_lint/build.rs:8:5
  |
8 |     println!("cargo::rerun-if-changed=../rust-toolchain.toml");
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = note: this error: internal compiler error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: unelided lifetime in signature
  --> bevy_lint/build.rs:20:5
   |
20 |     println!("cargo::rustc-env=RUST_TOOLCHAIN_CHANNEL={channel}");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:434:13 - disabled backtrace
  --> bevy_lint/build.rs:20:5
   |
20 |     println!("cargo::rustc-env=RUST_TOOLCHAIN_CHANNEL={channel}");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: this error: internal compiler error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error: internal compiler error: unelided lifetime in signature
  --> bevy_lint/build.rs:20:55
   |
20 |     println!("cargo::rustc-env=RUST_TOOLCHAIN_CHANNEL={channel}");
   |                                                       ^^^^^^^^^
   |
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:434:13 - disabled backtrace
  --> bevy_lint/build.rs:20:55
   |
20 |     println!("cargo::rustc-env=RUST_TOOLCHAIN_CHANNEL={channel}");
   |                                                       ^^^^^^^^^
   = note: this error: internal compiler error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: we would appreciate a bug report: https://github.com/TheBevyFlock/bevy_cli/issues

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/<SNIP>/bevy_cli/rustc-ice-2025-01-31T14_35_43-19839.txt` to your bug report

note: compiler flags: --crate-type bin -C embed-bitcode=no -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
note: This is likely a bug with `bevy_lint`, not `rustc` or `cargo`.

error: could not compile `bevy_lint` (build script)

rustc-ice-2025-01-31T14_35_43-19839.txt

Theory

I believe this is the line that causes the error. It only seems to happen when zst_query is run. I theorize it has to do with the lint pass's use of ItemCtxt, but I'm not sure.

@BD103 BD103 added A-Linter Related to the linter and custom lints C-Bug A bug in the program S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Jan 31, 2025
@BD103
Copy link
Member Author

BD103 commented Jan 31, 2025

For a temporary fix, I may move zst_query to the nursery lint group.

@BD103
Copy link
Member Author

BD103 commented Feb 1, 2025

If it is ItemCtxt, the contributing guide may need to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Linter Related to the linter and custom lints C-Bug A bug in the program S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

1 participant