-
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
Remove #[macro_use] extern crate rustc middle
from numerous crates
#124914
Remove #[macro_use] extern crate rustc middle
from numerous crates
#124914
Conversation
Some changes occurred in cc @BoxyUwU HIR ty lowering was modified cc @fmease Some changes occurred in match lowering cc @Nadrieril changes to the core type system Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred in match checking cc @Nadrieril Some changes occurred in need_type_info.rs cc @lcnr Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE / Miri engine cc @rust-lang/miri Some changes occurred in coverage instrumentation. cc @Zalathar Some changes occurred in cc @BoxyUwU changes to the core type system |
62e59b4
to
8d18170
Compare
@@ -7,6 +7,7 @@ use rustc_middle::mir::AssertKind; | |||
use rustc_middle::query::TyCtxtAt; | |||
use rustc_middle::ty::TyCtxt; | |||
use rustc_middle::ty::{layout::LayoutError, ConstInt}; | |||
use rustc_middle::{err_inval, err_machine_stop}; |
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.
These are interpreter macros. If we use
them from a path, then ideally we use them from the interpret
module, i.e as part of the use crate::interpret::...
below (based on crate::interpret
doing a re-export of rustc_middle::interpret
).
Does that work, or is it really needed to get these from the crate root?
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 have added another commit that adds a pub use foo
for each of these macros, and then they can be imported with use crate::interpret::foo
. I think that's the best way to achieve that.
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.
Ah, is pub use
how one gets an item for a macro_rules
in the current module? Nice, TIL.
8d18170
to
d740618
Compare
☔ The latest upstream changes (presumably #124934) made this pull request unmergeable. Please resolve the merge conflicts. |
I've considered submitting PRs like this, but the sheer number of lines changed has always turned me off. I like having this change, glad I didn't have to do it. r=me when you fix the conflicts |
d740618
to
ad0f595
Compare
The only ones remaining are for I rebased. @bors r=saethlin |
…middle, r=saethlin Remove `#[macro_use] extern crate rustc middle` from numerous crates Because explicit importing of macros via `use` items is nicer (more standard and readable) than implicit importing via `#[macro_use]`. This PR mops up some cases I didn't get to in rust-lang#124511. r? `@saethlin`
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#124551 (Add benchmarks for `impl Debug for str`) - rust-lang#124914 (Remove `#[macro_use] extern crate rustc middle` from numerous crates) - rust-lang#124915 (`rustc_target` cleanups) - rust-lang#124918 (Eliminate some `FIXME(lcnr)` comments) - rust-lang#124927 (opt-dist: use xz2 instead of xz crate) - rust-lang#124936 (analyse visitor: build proof tree in probe) - rust-lang#124943 (always use `GenericArgsRef`) Failed merges: - rust-lang#124955 (Use fewer origins when creating type variables.) r? `@ghost` `@rustbot` modify labels: rollup
needs rebase already :/ |
or the problem is that we can't merge this together with other stuff due to conflicts showing up then.. |
@bors r=saethlin |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
ad0f595
to
c34ebba
Compare
I rebased again. @bors r=saethlin p=1 Priority bump because this is conflict-prone. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (ba956ef): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 676.356s -> 677.304s (0.14%) |
…r=jackh726 Remove more `#[macro_use] extern crate tracing` Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via `#[macro_use]`. Continuing the work from rust-lang#124511 and rust-lang#124914. r? `@jackh726`
avoid using macro_use This is the Miri version of rust-lang/rust#124914
avoid using macro_use This is the Miri version of rust-lang#124914
…g-4, r=jieyouxu Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from rust-lang#124511, rust-lang#124914, and rust-lang#125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? `@jieyouxu`
…g-4, r=jieyouxu Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from rust-lang#124511, rust-lang#124914, and rust-lang#125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ``@jieyouxu``
…g-4, r=jieyouxu Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from rust-lang#124511, rust-lang#124914, and rust-lang#125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ```@jieyouxu```
Rollup merge of rust-lang#129767 - nnethercote:rm-extern-crate-tracing-4, r=jieyouxu Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from rust-lang#124511, rust-lang#124914, and rust-lang#125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ```@jieyouxu```
Because explicit importing of macros via
use
items is nicer (more standard and readable) than implicit importing via#[macro_use]
. This PR mops up some cases I didn't get to in #124511.r? @saethlin