-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Add external macros specific diagnostics for check-cfg #133221
Conversation
r? jieyouxu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the changes LGTM, I have one question
// FIXME: Get access to a `TyCtxt` from an `EarlyContext` | ||
// crate_name: cx.tcx.crate_name(def_id.krate), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is this still problematic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answer: yes, crate_name
is on tcx, early ctxt doesn't have access to a cstore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine.
@bors r+ rollup |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#133221 (Add external macros specific diagnostics for check-cfg) - rust-lang#133386 (Update linux_musl base to dynamically link the crt by default) - rust-lang#134191 (Make some types and methods related to Polonius + Miri public) - rust-lang#134227 (Update wasi-sdk used to build WASI targets) - rust-lang#134279 ((Re-)return adjustment target if adjust kind is never-to-any) - rust-lang#134295 (Encode coroutine-closures in SMIR) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#133221 (Add external macros specific diagnostics for check-cfg) - rust-lang#133386 (Update linux_musl base to dynamically link the crt by default) - rust-lang#134191 (Make some types and methods related to Polonius + Miri public) - rust-lang#134227 (Update wasi-sdk used to build WASI targets) - rust-lang#134279 ((Re-)return adjustment target if adjust kind is never-to-any) - rust-lang#134295 (Encode coroutine-closures in SMIR) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#133221 - Urgau:check-cfg-macro-diag, r=jieyouxu Add external macros specific diagnostics for check-cfg This PR adds specific check-cfg diagnostics for unexpected cfg in external macros. As well as hiding the some of the Cargo specific help/suggestions as they distraction for external macros and are generally not the right solution. Follow-up to rust-lang#132577 `@rustbot` label +L-unexpected_cfgs r? compiler
Pass `TyCtxt` to early diagostics decoration This PR pass a `TyCtxt` to the early diagnostics decoration code so that diagnostics code that take advantage of (a very limited but still useful) `TyCtxt` in their note, help, suggestions, ... This is particulary useful for rust-lang#133221 which wants to get the crate name of a `DefId`, which is possible with `tcx.crate_name(...)`. I highly recommend reviewing this PR commit by commit. r? `@jieyouxu`
Rollup merge of rust-lang#134339 - Urgau:tcx-in-early-diag, r=jieyouxu Pass `TyCtxt` to early diagostics decoration This PR pass a `TyCtxt` to the early diagnostics decoration code so that diagnostics code that take advantage of (a very limited but still useful) `TyCtxt` in their note, help, suggestions, ... This is particulary useful for rust-lang#133221 which wants to get the crate name of a `DefId`, which is possible with `tcx.crate_name(...)`. I highly recommend reviewing this PR commit by commit. r? `@jieyouxu`
This PR adds specific check-cfg diagnostics for unexpected cfg in external macros.
As well as hiding the some of the Cargo specific help/suggestions as they distraction for external macros and are generally not the right solution.
Follow-up to #132577
@rustbot label +L-unexpected_cfgs
r? compiler