about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2023-10-30make sure we catch UB with _ pattern in various syntactic positionsRalf Jung-16/+87
2023-10-29Rename Since -> StableSince in preparation for a DeprecatedSinceDavid Tolnay-4/+4
2023-10-29Auto merge of #116270 - cjgillot:gvn-aggregate, r=oli-obk,RalfJungbors-3/+2
See through aggregates in GVN This PR is extracted from https://github.com/rust-lang/rust/pull/111344 The first 2 commit are cleanups to avoid repeated work. I propose to stop removing useless assignments as part of this pass, and let a later `SimplifyLocals` do it. This makes tests easier to read (among others). The next 3 commits add a constant folding mechanism to the GVN pass, presented in https://github.com/rust-lang/rust/pull/116012. ~This pass is designed to only use global allocations, to avoid any risk of accidental modification of the stored state.~ The following commits implement opportunistic simplifications, in particular: - projections of aggregates: `MyStruct { x: a }.x` gets replaced by `a`, works with enums too; - projections of arrays: `[a, b][0]` becomes `a`; - projections of repeat expressions: `[a; N][x]` becomes `a`; - transform arrays of equal operands into a repeat rvalue. Fixes https://github.com/rust-lang/miri/issues/3090 r? `@oli-obk`
2023-10-28Remove asmjs from toolsJubilee Young-16/+1
2023-10-28Remove asmjs from miriJubilee Young-1/+1
2023-10-29Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errorsbors-9/+9
Implement `gen` blocks in the 2024 edition Coroutines tracking issue https://github.com/rust-lang/rust/issues/43122 `gen` block tracking issue https://github.com/rust-lang/rust/issues/117078 This PR implements `gen` blocks that implement `Iterator`. Most of the logic with `async` blocks is shared, and thus I renamed various types that were referring to `async` specifically. An example usage of `gen` blocks is ```rust fn foo() -> impl Iterator<Item = i32> { gen { yield 42; for i in 5..18 { if i.is_even() { continue } yield i * 2; } } } ``` The limitations (to be resolved) of the implementation are listed in the tracking issue
2023-10-28Auto merge of #117149 - nnethercote:tidy-alphabetical-unit-tests, r=Nilstriebbors-36/+262
tidy: add unit tests for alphabetical checks I discovered there aren't any tests while working on #117068. r? `@Nilstrieb`
2023-10-28Auto merge of #81746 - bjorn3:cg_clif_rustup_component, r=Mark-Simulacrumbors-3/+16
Distribute cg_clif as rustup component on the nightly channel This makes it possible to use cg_clif using: ```bash $ rustup component add rustc-codegen-cranelift-preview --toolchain nightly $ RUSTFLAGS="-Zcodegen-backend=cranelift" cargo +nightly build ``` cc https://github.com/rust-lang/compiler-team/issues/405. r? `@Mark-Simulacrum`
2023-10-28Auto merge of #116609 - eduardosm:bump-stdarch, r=workingjubileebors-226/+7
Bump stdarch submodule and remove special handling for LLVM intrinsics that are no longer needed Bumps stdarch to pull https://github.com/rust-lang/stdarch/pull/1477, which reimplemented some functions with portable SIMD intrinsics instead of arch specific LLVM intrinsics. Handling of those LLVM intrinsics is removed from cranelift codegen and miri. cc `@RalfJung` `@bjorn3`
2023-10-28Auto merge of #3149 - RalfJung:atomic-readonly-loads, r=RalfJungbors-62/+135
accept some atomic loads from read-only memory matches https://github.com/rust-lang/rust/pull/115577
2023-10-28accept some atomic loads from read-only memoryRalf Jung-48/+121
2023-10-28add some tests specifically for validity checks arising from match bindersRalf Jung-0/+59
2023-10-28consolidate and extend testing for _ patterns discarding the placeRalf Jung-31/+76
2023-10-28Disable tidy dep check for a couple more unvendored projectbjorn3-3/+3
2023-10-28atomic_op → atomic_rmw_opRalf Jung-14/+14
2023-10-28Rollup merge of #117256 - dtolnay:currentversion, r=compiler-errorsJubilee-15/+8
Parse rustc version at compile time This PR eliminates a couple awkward codepaths where it was not clear how the compiler should proceed if its own version number is incomprehensible. https://github.com/rust-lang/rust/blob/dab715641e96a61a534587fda9de1128b75b34dc/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs#L385 https://github.com/rust-lang/rust/blob/dab715641e96a61a534587fda9de1128b75b34dc/compiler/rustc_attr/src/builtin.rs#L630 We can guarantee that every compiled rustc comes with a working version number, so the ICE codepaths above shouldn't need to be written.
2023-10-28fmtThe Miri Conjob Bot-6/+13
2023-10-28Merge from rustcThe Miri Conjob Bot-42/+148
2023-10-28Preparing for merge from rustcThe Miri Conjob Bot-1/+1
2023-10-28Auto merge of #117302 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 8 commits in df3509237935f9418351b77803df7bc05c009b3d..708383d620e183a9ece69b8fe930c411d83dee27 2023-10-24 23:09:01 +0000 to 2023-10-27 21:09:26 +0000 - feat(doc): Print the generated docs links (rust-lang/cargo#12859) - feat(toml): Allow version-less manifests (rust-lang/cargo#12786) - Remove outdated option to `-Zcheck-cfg` warnings (rust-lang/cargo#12884) - Remove duplicate binaries during install (rust-lang/cargo#12868) - refactor(shell): Write at once rather than in fragments (rust-lang/cargo#12880) - docs(ref): Link to docs.rs metadata table (rust-lang/cargo#12879) - docs(contrib): Describe how to add a new package (rust-lang/cargo#12878) - move up looking at index summary enum (rust-lang/cargo#12749) r? ghost
2023-10-27Update cargoWeihang Lo-0/+0
2023-10-28Auto merge of #117197 - Zalathar:demangler, r=onur-ozkanbors-4/+0
Avoid unnecessary builds/rebuilds of `rust-demangler` This is a combination of two loosely-related changes: - Don't build `rust-demangler` as a dependency of `tests/run-make`, because after #112300 none of the remaining run-make tests actually use it. (If future run-make tests ever do need the demangler, it'll be easy to add it back.) - For `tests/run-coverage`, build the demangler with the stage 0 compiler instead of the current-stage compiler. This avoids having to uselessly rebuild the demangler after modifying and rebuilding the compiler itself.
2023-10-27Auto merge of #103208 - cjgillot:match-fake-read, r=oli-obk,RalfJungbors-0/+89
Allow partially moved values in match This PR attempts to unify the behaviour between `let _ = PLACE`, `let _: TY = PLACE;` and `match PLACE { _ => {} }`. The logical conclusion is that the `match` version should not check for uninitialised places nor check that borrows are still live. The `match PLACE {}` case is handled by keeping a `FakeRead` in the unreachable fallback case to verify that `PLACE` has a legal value. Schematically, `match PLACE { arms }` in surface rust becomes in MIR: ```rust PlaceMention(PLACE) match PLACE { // Decision tree for the explicit arms arms, // An extra fallback arm _ => { FakeRead(ForMatchedPlace, PLACE); unreachable } } ``` `match *borrow { _ => {} }` continues to check that `*borrow` is live, but does not read the value. `match *borrow {}` both checks that `*borrow` is live, and fake-reads the value. Continuation of ~https://github.com/rust-lang/rust/pull/102256~ ~https://github.com/rust-lang/rust/pull/104844~ Fixes https://github.com/rust-lang/rust/issues/99180 https://github.com/rust-lang/rust/issues/53114
2023-10-27Add gen blocks to ast and do some broken ast loweringOli Scherer-9/+9
2023-10-27Fix review commentsbjorn3-1/+0
2023-10-27Distribute cg_clif as a rustup componentbjorn3-3/+17
2023-10-27give some more help for the unusual data racesRalf Jung-29/+54
2023-10-27data-race: preserve structured access information longer, and don't ↵Ralf Jung-154/+196
upper-case access types
2023-10-27add aarch64-apple-darwin to list of supported targetsRalf Jung-2/+3
2023-10-27Auto merge of #116205 - WaffleLapkin:stabilize_pointer_byte_offsets, r=dtolnaybors-5/+0
Stabilize `[const_]pointer_byte_offsets` Closes #96283 Awaiting FCP completion: https://github.com/rust-lang/rust/issues/96283#issuecomment-1735835331 r? libs-api
2023-10-27Don't provide `rust-demangler` to run-make testsZalathar-4/+0
The demangler was only needed by coverage tests, but those tests were migrated into their own custom test mode in #112300. This avoids having to build the demangler just for run-make tests. It will still be built as needed by run-coverage tests or for other purposes.
2023-10-26Parse rustc version at compile timeDavid Tolnay-15/+8
2023-10-26Auto merge of #116983 - Urgau:prepare-bootstrap-for-new-check-cfg, r=Kobzolbors-1/+6
Prepare the `bootstrap` tool for the new check-cfg syntax This PR prepare the `bootstrap` tool for the [new check-cfg syntax](https://github.com/rust-lang/rust/pull/111072) as well as the according [changes to Cargo](https://github.com/rust-lang/cargo/pull/12845). ~~Note that while the new syntax can technically available on stage > 2, we actually cannot use it since we need a cargo version that supports the new syntax which won't happen until the next beta bump (if I understand everything correctly).~~ r? bootstrap
2023-10-26Auto merge of #117148 - dtolnay:sinceversion, r=cjgillotbors-12/+18
Store #[stable] attribute's `since` value in structured form Followup to https://github.com/rust-lang/rust/pull/116773#pullrequestreview-1680913901. Prior to this PR, if you wrote an improper `since` version in a `stable` attribute, such as `#[stable(feature = "foo", since = "wat.0")]`, rustc would emit a diagnostic saying **_'since' must be a Rust version number, such as "1.31.0"_** and then throw out the whole `stable` attribute as if it weren't there. This strategy had 2 problems, both fixed in this PR: 1. If there was also a `#[deprecated]` attribute on the same item, rustc would want to enforce that the stabilization version is older than the deprecation version. This involved reparsing the `stable` attribute's `since` version, with a diagnostic **_invalid stability version found_** if it failed to parse. Of course this diagnostic was unreachable because an invalid `since` version would have already caused the `stable` attribute to be thrown out. This PR deletes that unreachable diagnostic. 2. By throwing out the `stable` attribute when `since` is invalid, you'd end up with a second diagnostic saying **_function has missing stability attribute_** even though your function is not missing a stability attribute. This PR preserves the `stable` attribute even when `since` cannot be parsed, avoiding the misleading second diagnostic. Followups I plan to try next: - Do the same for the `since` value of `#[deprecated]`. - See whether it makes sense to also preserve `stable` and/or `unstable` attributes when they contain an invalid `feature`. What redundant/misleading diagnostics can this eliminate? What problems arise from not having a usable feature name for some API, in the situation that we're already failing compilation, so not concerned about anything that happens in downstream code?
2023-10-26Auto merge of #116818 - Nilstrieb:stop-submitting-bug-reports, r=wesleywiserbors-7/+12
Stop telling people to submit bugs for internal feature ICEs This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. I thought about several ways to do this but now used the explicit threading of an `Arc<AtomicBool>` through `Session`. This is not exactly incremental-safe, but this is fine, as this is set during macro expansion, which is pre-incremental, and also only affects the output of ICEs, at which point incremental correctness doesn't matter much anyways. See [MCP 620.](https://github.com/rust-lang/compiler-team/issues/596) ![image](https://github.com/rust-lang/rust/assets/48135649/be661f05-b78a-40a9-b01d-81ad2dbdb690)
2023-10-25Stabilize `[const_]pointer_byte_offsets`Maybe Waffle-5/+0
2023-10-25Rollup merge of #117175 - oli-obk:gen_fn_split, r=compiler-errorsMatthias Krüger-10/+10
Rename AsyncCoroutineKind to CoroutineSource pulled out of https://github.com/rust-lang/rust/pull/116447 Also refactors the printing infra of `CoroutineSource` to be ready for easily extending it with a `Gen` variant for `gen` blocks
2023-10-25Stop telling people to submit bugs for internal feature ICEsNilstrieb-7/+12
This keeps track of usage of internal features, and changes the message to instead tell them that using internal features is not supported. See MCP 620.
2023-10-25generate beta manifests as pre-requisit rust-lang/rustup#1329Skgland-0/+23
<https://github.com/rust-lang/rustup/issues/1329#issuecomment-1134946736> mentioned this would be the next step
2023-10-25Auto merge of #117180 - matthiaskrgr:rollup-rxhl6ep, r=matthiaskrgrbors-3/+13
Rollup of 7 pull requests Successful merges: - #117111 (Remove support for alias `-Z instrument-coverage`) - #117141 (Require target features to match exactly during inlining) - #117152 (Fix unwrap suggestion for async fn) - #117154 (implement C ABI lowering for CSKY) - #117159 (Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed`) - #117163 (compiletest: Display compilation errors in mir-opt tests) - #117173 (Make `Iterator` a lang item) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-25Typo.Camille GILLOT-1/+1
2023-10-25Rollup merge of #117163 - tmiasko:compiletest-mir-opt, r=compiler-errorsMatthias Krüger-1/+1
compiletest: Display compilation errors in mir-opt tests Previously when compilation failed the `check_mir_dump` would panic first, so we would never display the compiler output.
2023-10-25Rollup merge of #117159 - oli-obk:error_shenanigans, r=estebankMatthias Krüger-2/+12
Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed` Even if that error is only emitted by `check_mod_item_types`. fixes https://github.com/rust-lang/rust/issues/117153 A cleaner refactoring would merge/chain these queries in ways that ensure we only actually get an `ErrorGuaranteed` if there was an error emitted.
2023-10-25Auto merge of #117172 - matthiaskrgr:rollup-s56bm2f, r=matthiaskrgrbors-0/+0
Rollup of 7 pull requests Successful merges: - #116801 (Add test for 113326) - #117133 (Merge `impl_wf_inference` (`check_mod_impl_wf`) check into coherence checking) - #117136 (Intern `LocalDefId` list from `opaque_types_defined_by` query) - #117150 (Update cargo) - #117158 (Update THIR unused_unsafe lint) - #117160 (Fix typo in test comment) - #117168 (Fix some coroutine sentences that don't make sense anymore.) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-25Rename `AsyncCoroutineKind` to `CoroutineSource`Oli Scherer-10/+10
similar to how we have `MatchSource`, it explains where the desugaring came from.
2023-10-25compiletest: Display compilation errors in mir-opt testsTomasz Miąsko-1/+1
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-2/+12
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-25Auto merge of #3141 - rust-lang:rustup-2023-10-25, r=RalfJungbors-12/+20
Automatic Rustup
2023-10-25CLOCK_UPTIME_RAW exists on all macos targets, not just the ARM onesRalf Jung-9/+5
2023-10-25Do not merge fn pointer casts.Camille GILLOT-3/+2