about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2023-05-24Move testsCaio-2/+2
2023-05-24Auto merge of #110936 - loongarch-rs:promote-tier2, r=Mark-Simulacrumbors-0/+2
Promote loongarch64-unknown-linux-gnu to Tier 2 with host tools This PR promotes `loongarch64-unknown-linux-gnu` to Tier 2 (with host tools). MCP: https://github.com/rust-lang/compiler-team/issues/518
2023-05-23Auto merge of #111890 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 10 commits in 09276c703a473ab33daaeb94917232e80eefd628..64fb38c97ac4d3a327fc9032c862dd28c8833b17 2023-05-16 21:43:35 +0000 to 2023-05-23 18:53:23 +0000 - Consider rust-version when selecting packages for cargo add (rust-lang/cargo#12078) - fix(lints): Switch to -Zlints so stable projects can experiment (rust-lang/cargo#12168) - Automatically inherit workspace fields when running cargo new/init (rust-lang/cargo#12069) - ci: check if any version bump needed for member crates (rust-lang/cargo#12126) - feat: `lints` feature (rust-lang/cargo#12148) - fix: pass `-C debuginfo` after weakening if explicitly set (rust-lang/cargo#12165) - Tweak build help to clarify role of --bin (rust-lang/cargo#12157) - fix: Pass CI on nightly (rust-lang/cargo#12160) - docs(source): doc comments for Source and its impls (rust-lang/cargo#12159) - docs(source): doc comments for `Source` and friends (rust-lang/cargo#12153) r? `@ghost`
2023-05-23Update cargoWeihang Lo-0/+0
2023-05-23Promote loongarch64-unknown-linux-gnu to Tier 2 with host toolsWANG Rui-0/+2
MCP: https://github.com/rust-lang/compiler-team/issues/518
2023-05-23Auto merge of #2901 - oli-obk:noisy, r=RalfJungbors-1/+0
Hide full miri command line in `./miri run-dep` fixes #2443
2023-05-23Hide full miri command line in `./miri run-dep`Oli Scherer-1/+0
2023-05-23Update to latest clippyOli Scherer-16/+16
2023-05-23Merge from rustcOli Scherer-1156/+2683
2023-05-23Preparing for merge from rustcOli Scherer-1/+1
2023-05-23Rollup merge of #111756 - Urgau:rename_drop_forget_copy_ref_lints, r=fee1-deadDylan DPC-31/+31
Rename `{drop,forget}_{copy,ref}` lints to more consistent naming This PR renames previous uplifted lints in https://github.com/rust-lang/rust/pull/109732 to more consistent naming. I followed the renaming done [here](https://github.com/rust-lang/rust/issues/53224) and also advocated in this [clippy issue](https://github.com/rust-lang/rust-clippy/issues/2845): - `drop_copy` to `dropping_copy_types` - `forget_copy` to `forgetting_copy_types` - `drop_ref` to `dropping_references` - `forget_ref` to `forgetting_references`
2023-05-23Rollup merge of #111501 - WaffleLapkin:drivebycleanupuwu, r=oli-obkDylan DPC-6/+4
MIR drive-by cleanups Some random drive-by cleanups I did while working with MIR/THIR.
2023-05-21Normalize block and local orders in mir-opt testsScott McMurray-1/+4
Since this only affects `PreCodegen MIR, and it would be nice for that to be resilient to permutations of things that don't affect the actual semantic behaviours.
2023-05-21Use a signal handler to observe ctrl+c and cleanly drop the measureme profilerBen Kimock-0/+56
2023-05-21Rename `forget_ref` lint to `forgetting_references`Urgau-7/+7
2023-05-21Rename `drop_ref` lint to `dropping_references`Urgau-8/+8
2023-05-21Rename `forget_copy` lint to `forgetting_copy_types`Urgau-8/+8
2023-05-21Rename `drop_copy` lint to `dropping_copy_types`Urgau-11/+11
2023-05-20Auto merge of #111799 - flip1995:clippyup, r=Manishearthbors-1114/+2623
Update Clippy r? `@Manishearth`
2023-05-20Merge commit '435a8ad86c7a33bd7ffb91c59039943408d3b6aa' into clippyupPhilipp Krones-1114/+2623
2023-05-20Auto merge of #111413 - workingjubilee:bump-object-0-31-1, r=MarkSimulacrumbors-0/+2
Bump object and thorin-dwp Required to fix watchOS breakage.
2023-05-20derive `Default` trait for `compiletest::common::Config`ozkanonur-1/+7
2023-05-20create new tool rustdoc-gui-testozkanonur-0/+233
2023-05-19Drive-by-cleanup: Don't emit `thir::ExprKind::NeverToAny` for `! -> !`Maybe Waffle-6/+4
2023-05-19Auto merge of #111641 - michaelwoerister:debugger-visualizer-fixes, r=cjgillotbors-0/+1
Fix dependency tracking for debugger visualizers This PR fixes dependency tracking for debugger visualizer files by changing the `debugger_visualizers` query to an `eval_always` query that scans the AST while it is still available. This way the set of visualizer files is already available when dep-info is emitted. Since the query is turned into an `eval_always` query, dependency tracking will now reliably detect changes to the visualizer script files themselves. TODO: - [x] perf.rlo - [x] Needs a bit more documentation in some places - [x] Needs regression test for the incr. comp. case Fixes https://github.com/rust-lang/rust/issues/111226 Fixes https://github.com/rust-lang/rust/issues/111227 Fixes https://github.com/rust-lang/rust/issues/111295 r? `@wesleywiser` cc `@gibbyfree`
2023-05-18Auto merge of #111345 - jyn514:cfg-release-caching, r=cjgillot,est31bors-4/+2
Only depend on CFG_VERSION in rustc_interface This avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`. cc https://github.com/rust-lang/rust/issues/76720 - this won't fix it, and I'm not suggesting we turn this on by default, but it will make it less painful for people who do have `omit-git-hash` on as a workaround.
2023-05-18Rollup merge of #111695 - fmease:dont-lump-together-alias-tys, r=compiler-errorsDylan DPC-0/+13
Exclude inherent projections from some alias type `match`es Updating (hopefully) all remaining `match`es which I overlooked to update when adding `AliasKind::Inherent` in #109410. Fixes #111399. Sadly the regression test is a clippy test instead of a rustc one as I don't know of another way to test that a trait bound like `Ty::InhProj: Trait` doesn't cause a crash without reaching a cycle error first (this is getting old ^^'). `@rustbot` label F-inherent_associated_types r? `@compiler-errors`
2023-05-18Merge from rustcRalf Jung-11/+90
2023-05-18Preparing for merge from rustcRalf Jung-1/+1
2023-05-18Rollup merge of #111561 - dtolnay:compiletestdirexists, r=Mark-SimulacrumDylan DPC-1/+7
Include better context for "already exists" error in compiletest I encountered the following error from `x.py test tests/ui` today. ```console ---- [ui] tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs stdout ---- thread '[ui] tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 17, kind: AlreadyExists, message: "File exists" }', src/tools/compiletest/src/runtest.rs:134:43 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` I found it impossible to unblock myself without knowing which directory it was stuck on. Error message after this PR: ```console ---- [ui] tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs stdout ---- thread '[ui] tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs' panicked at 'called `Result::unwrap()` on an `Err` value: failed to create output base directory /git/rust/build/x86_64-unknown-linux-gnu/test/ui/impl-trait/multiple-lifetimes/multiple-lifetimes Caused by: File exists (os error 17)', src/tools/compiletest/src/runtest.rs:139:10 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace ``` Now I was able to run `rm build/x86_64-unknown-linux-gnu/test/ui/impl-trait/multiple-lifetimes/multiple-lifetimes` and unblock myself. Seems to be related to #109509 moving *tests/ui/impl-trait/multiple-lifetimes.rs* to *tests/ui/impl-trait/multiple-lifetimes/multiple-lifetimes.rs*.
2023-05-17Only depend on CFG_VERSION in rustc_interfacejyn-4/+2
this avoids having to rebuild the whole compiler on each commit when `omit-git-hash = false`.
2023-05-17Exclude inherent projections from some alias ty matchesLeón Orell Valerian Liehr-0/+13
2023-05-17Rollup merge of #111648 - Nilstrieb:language-items, r=WaffleLapkinDylan DPC-4/+5
Remove `LangItems::require` It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-05-17Update cargoWeihang Lo-0/+0
2023-05-16Remove `LangItems::require`Nilstrieb-4/+5
It's just a short wrapper used by `tcx.require_lang_item`. Deleting it gives us a negative diff.
2023-05-16Fix dependency tracking for debugger visualizersMichael Woerister-0/+1
2023-05-16Auto merge of #111639 - Nilstrieb:rollup-vg149lm, r=Nilstriebbors-2/+1
Rollup of 10 pull requests Successful merges: - #111428 (refactor(resolve): clean up the early error return caused by non-call) - #111449 (Recover `impl<T ?Sized>` correctly) - #111572 (Document that `missing_copy_implementations` and `missing_debug_implementations` only apply to public items.) - #111602 (Suppress "erroneous constant used" for constants tainted by errors) - #111605 (fixup version placeholder for `cfi_encoding` feature) - #111607 (Add clubby789 to the bootstrap review rotation) - #111614 (Add more interesting nonsense to weird-exprs.rs) - #111617 (Fixed typo) - #111620 (Add eholk back to compiler-contributors reviewers) - #111621 (Fix release date of 1.58.1 in release notes.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-16Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obkNilstrieb-2/+1
Suppress "erroneous constant used" for constants tainted by errors When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not. Fixes #110891.
2023-05-16Merge from rustcRalf Jung-32/+60
2023-05-16Preparing for merge from rustcRalf Jung-1/+1
2023-05-16add lib module to `src/tool/compiletest`ozkanonur-1135/+1141
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-16Auto merge of #111472 - djkoloski:compiletest_cfg_current_target, ↵bors-5/+84
r=compiler-errors Get current target config from` --print=cfg` Compiletest was switched to querying all targets using `--print=all-target-specs-json` and `--print=target-spec-json` in #108905. This unintentionally prevented codegen flags like `-Cpanic` from being reflected in the current target configuration. This change gets the current compiletest target config using `--print=cfg` like it was previously while still using the faster prints for getting information on all other targets. Fixes #110850. `@jyn514` might be interested in reviewing since they commented on the issue. cc `@tmandry` since this issue is affecting Fuchsia.
2023-05-15Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillotMatthias Krüger-2/+2
Move expansion of query macros in rustc_middle to rustc_middle::query This moves the expansion of `define_callbacks!` and `define_feedable!` from `rustc_middle::ty::query` to `rustc_middle::query`. This means that types used in queries are both imported and used in `rustc_middle::query` instead of being split between these modules. It also decouples `rustc_middle::ty::query` further from `rustc_middle` which is helpful since we want to move `rustc_middle::ty::query` to the query system crates.
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-2/+2
2023-05-15Suppress "erroneous constant used" for constants tainted by errorsTomasz Miąsko-2/+1
When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not.
2023-05-14Appease lintsLucasFA-19/+16
A warning about an unnecessary drop used to appear when running the linkchecker. Also some clippy warnings
2023-05-14Auto merge of #104134 - dtolnay:panictemporaries, r=joshtriplettbors-9/+1
Shorten lifetime of panic temporaries in panic_fmt case This fixes an issue called out by `@fasterthanlime` in https://octodon.social/`@fasterthanlime/109304454114856561.` Macros like `todo!("…")` and `panic!("…", …)` drop their `format_args` temporary at the nearest enclosing semicolon **outside** the macro invocation, not inside the macro invocation. Due to the formatting internals being type-erased in a way that is not thread-safe, this blocks futures from being `Send` if there is an `await` anywhere between the panic call and the nearest enclosing semicolon. **Example:** ```rust #![allow(unreachable_code)] async fn f(_: u8) {} async fn g() { f(todo!("...")).await; } fn require_send(_: impl Send) {} fn main() { require_send(g()); } ``` **Before:** ```console error: future cannot be sent between threads safely --> src/main.rs:15:18 | 15 | require_send(g()); | ^^^ future returned by `g` is not `Send` | = help: the trait `Sync` is not implemented for `core::fmt::Opaque` note: future is not `Send` as this value is used across an await --> src/main.rs:9:20 | 9 | f(todo!("...")).await; | ------------ ^^^^^^ await occurs here, with `$crate::format_args!($($arg)+)` maybe used later | | | has type `ArgumentV1<'_>` which is not `Send` note: `$crate::format_args!($($arg)+)` is later dropped here --> src/main.rs:9:26 | 9 | f(todo!("...")).await; | ^ note: required by a bound in `require_send` --> src/main.rs:12:25 | 12 | fn require_send(_: impl Send) {} | ^^^^ required by this bound in `require_send` ``` **After:** works. Arguably there is a rustc fix that could work here too, instead of a standard library change. Rustc could be taught that the code shown above is fine to compile because the `await` is unreachable and so temporaries before the `await` do not need to get put in the anonymous compiler-generated `Future` struct, regardless of syntactically where they're supposed to be dropped according to the language semantics. I would be open to that, though my recollection is that in the past we have been very hesitant about introducing any smarts into Drop placement. People want the language rules about where temporaries are dropped to be as simplistic and predictable as possible.
2023-05-14Exposes false negative in clippy's diverging_sub_expressionDavid Tolnay-9/+1
2023-05-14Include better context for "already exists" error in compiletestDavid Tolnay-1/+7
2023-05-14Auto merge of #108638 - Zoxc:erase-query-values-map, r=cjgillotbors-0/+1
Use dynamic dispatch for queries This replaces most concrete query values `V` with `MaybeUninit<[u8; { size_of::<V>() }]>` reducing the code instantiated by queries. The compile time of `rustc_query_impl` is reduced by 27%. It is an alternative to https://github.com/rust-lang/rust/pull/107937 which uses unstable const generics while this uses a `EraseType` trait which maps query values to their erased variant. This is achieved by introducing an `Erased` type which does sanity check with `cfg(debug_assertions)`. The query caches gets instantiated with these erased types leaving the code in `rustc_query_system` unaware of them. `rustc_query_system` is changed to use instances of `QueryConfig` so that `rustc_query_impl` can pass in `DynamicConfig` which holds a pointer to a virtual table. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7055s</td><td align="right">1.6949s</td><td align="right"> -0.62%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2547s</td><td align="right">0.2528s</td><td align="right"> -0.73%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9590s</td><td align="right">0.9553s</td><td align="right"> -0.39%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5457s</td><td align="right">1.5440s</td><td align="right"> -0.11%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.9092s</td><td align="right">5.9009s</td><td align="right"> -0.14%</td></tr><tr><td>Total</td><td align="right">10.3741s</td><td align="right">10.3479s</td><td align="right"> -0.25%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9960s</td><td align="right"> -0.40%</td></tr></table> <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:initial</td><td align="right">2.0605s</td><td align="right">2.0575s</td><td align="right"> -0.15%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3218s</td><td align="right">0.3216s</td><td align="right"> -0.07%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.1848s</td><td align="right">1.1839s</td><td align="right"> -0.07%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">1.9409s</td><td align="right">1.9376s</td><td align="right"> -0.17%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.3105s</td><td align="right">7.2928s</td><td align="right"> -0.24%</td></tr><tr><td>Total</td><td align="right">12.8185s</td><td align="right">12.7935s</td><td align="right"> -0.20%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9986s</td><td align="right"> -0.14%</td></tr></table> <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check:unchanged</td><td align="right">0.4606s</td><td align="right">0.4617s</td><td align="right"> 0.24%</td></tr><tr><td>🟣 <b>hyper</b>:check:unchanged</td><td align="right">0.1335s</td><td align="right">0.1336s</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>regex</b>:check:unchanged</td><td align="right">0.3324s</td><td align="right">0.3346s</td><td align="right"> 0.65%</td></tr><tr><td>🟣 <b>syn</b>:check:unchanged</td><td align="right">0.6268s</td><td align="right">0.6307s</td><td align="right"> 0.64%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:unchanged</td><td align="right">1.8248s</td><td align="right">1.8508s</td><td align="right">💔 1.43%</td></tr><tr><td>Total</td><td align="right">3.3779s</td><td align="right">3.4113s</td><td align="right"> 0.99%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">1.0061s</td><td align="right"> 0.61%</td></tr></table> It's based on https://github.com/rust-lang/rust/pull/108167. r? `@cjgillot`