Mark proc_macro_decls_static as always used#105978
Merged
bors merged 1 commit intorust-lang:masterfrom Dec 23, 2022
Merged
Conversation
bjorn3
reviewed
Dec 20, 2022
compiler/rustc_passes/src/dead.rs
Outdated
Member
There was a problem hiding this comment.
Would adding#[used] when creating this static work?
Contributor
There was a problem hiding this comment.
+1, if it's possible we should rely on regular user-available attributes instead of hardcoding stuff in the compiler, both for dead code and symbol export analysis.
Member
Author
There was a problem hiding this comment.
I am not sure it will work (don't want to spend the time testing it with #104860), but it seems like a good idea anyway, done.
Contributor
There was a problem hiding this comment.
Interaction between dead code lint and #[used] attribute is tested in issue-41628.rs.
e7cdb50 to
55a8538
Compare
55a8538 to
8e89c70
Compare
This would have avoided a bug in rust-lang#104860. In practice this shouldn't matter since nothing uses the query other than the `dead_code` lint, but this isn't documented as an internal-only query so it seems nice for it to be accurate. I think for `dead_code` it doesn't matter because the relevant code is generated by `rustc_builtin_macros` and isn't linted.
8e89c70 to
164e221
Compare
Contributor
|
@bors r+ |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 23, 2022
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#105978 (Mark `proc_macro_decls_static` as always used) - rust-lang#106051 (Allow building std with cranelift) - rust-lang#106056 (Make `sess.bug` much less noisy) - rust-lang#106057 (Give a more helpful error for "trimmed_def_paths constructed") - rust-lang#106058 (Fix the issue number in comment for as_local_call_operand) - rust-lang#106059 (Avoid running the `Profile` step twice on `x setup`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
This would have avoided a bug in #104860.
In practice this shouldn't matter since nothing uses the query other than the
dead_codelint, but this isn't documented as an internal-only query so it seems nice for it to be accurate. I think fordead_codeit doesn't matter because the relevant code is generated byrustc_builtin_macrosand isn't linted.I think @tmiasko or @bjorn3 would be a good reviewer?
r? @tmiasko