Use check_proc_macro for missing_const_for_fn#1
Closed
daxpedda wants to merge 9 commits intoJarcho:check_proc_macrofrom
Closed
Use check_proc_macro for missing_const_for_fn#1daxpedda wants to merge 9 commits intoJarcho:check_proc_macrofrom
check_proc_macro for missing_const_for_fn#1daxpedda wants to merge 9 commits intoJarcho:check_proc_macrofrom
Conversation
daxpedda
commented
Jun 30, 2022
daxpedda
commented
Jun 30, 2022
daxpedda
commented
Jun 30, 2022
Jarcho
reviewed
Jul 1, 2022
Owner
|
I think this is fine as is now. When this branch is merged into clippy can you open a new PR there with this change? You can r? me when you do. |
Author
|
Will do! |
c01d2d1 to
745b194
Compare
Owner
|
Ping @daxpedda. This has now been merged into clippy. You can open a PR there when you have the time. |
Author
|
See rust-lang#9308. |
bors
added a commit
to rust-lang/rust-clippy
that referenced
this pull request
Aug 9, 2022
Use `check_proc_macro` for `missing_const_for_fn` This uses `@Jarcho's` #8694 implementation to fix `missing_const_for_fn` linting in proc-macros. I'm not 100% sure what I'm doing here, any feedback is appreciated. Previously: Jarcho#1. Fixes #8854. changelog: [`missing_const_for_fn`]: No longer lints in proc-macros
Jarcho
pushed a commit
that referenced
this pull request
Aug 31, 2023
…=xFrednet Fix tuple_array_conversions lint on nightly ``` changelog: ICE: [`tuple_array_conversions`]: Don't expect array length to always be usize ``` tl;dr: changed [`Const::eval_target_usize`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/ty/consts.rs#L359) to [`Consts::try_eval_target_usize`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/ty/consts.rs#L327) to get rid of ICE. I have encountered a problem with clippy: it caught ICE when working with a codebase that uses a lot of nightly features. Here's a (stripped) ICE info: ``` error: internal compiler error: /rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/compiler/rustc_middle/src/ty/consts.rs:361:32: expected usize, got Const { ty: usize, kind: N/#1 } thread 'rustc' panicked at /rustc/5c6a7e71cd66705c31c9af94077901a220f0870c/compiler/rustc_errors/src/lib.rs:1635:9: Box<dyn Any> stack backtrace: ... 16: 0x110b9c590 - rustc_middle[449edf845976488d]::util::bug::bug_fmt 17: 0x102f76ae0 - clippy_lints[71754038dd04c2d2]::tuple_array_conversions::all_bindings_are_for_conv ... ``` I don't really know what's going on low-level-wise, but seems like this lin assumed that the length of the array can always be treated as `usize`, and *I assume* this doesn't play well with `feat(generic_const_exprs)`. I wasn't able to build a minimal reproducible example, but locally this fix does resolve the issue.
Jarcho
pushed a commit
that referenced
this pull request
Jul 9, 2025
fix: check against 'main' function name instead of entrypoint function
Jarcho
pushed a commit
that referenced
this pull request
Jan 1, 2026
This resulted in the following error for me:
error[E0464]: multiple candidates for `rlib` dependency `rustc_literal_escaper` found
--> clippy_dev/src/lib.rs:25:1
|
25 | extern crate rustc_literal_escaper;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: candidate #1: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-4f30574e01c3dad1.rlib
= note: candidate rust-lang#2: /home/pkrones/.rustup/toolchains/nightly-2025-12-25-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_literal_escaper-c8a0e29ad1040cee.rmeta
Other tools in the Rust repo also take that as an explicit dependency, like rust-analyzer or lint-docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While fixing
missing_const_for_fn, see rust-lang#8854, I found that your PR basically does half of my work already.I hope that's alright making a PR against your work here!