about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-07-23Ports `#[macro_use]` and `#[macro_escape]` to the new attribute parsing ↵Jonathan Brouwer-4/+4
infrastructure
2025-07-23Auto merge of #143412 - Kobzol:std-detect-in-stdlib, r=Amanieubors-12/+14
Move `std_detect` into stdlib This PR moves the `std_detect` crate from `stdarch` to be a part of rust-lang/rust instead. The first commit actually moves the whole directory from the stdarch Josh subtree, so that git blame history is kept intact. Then I had to make a few changes to appease `tidy`. The most complex thing here is porting the tests. We can't have `std_detect` both in r-l/r and stdarch, because they could get desynchronized, so we have to perform the move more or less "atomically", which means that we also have to port all the existing `std_detect` tests from the `stdarch` repository. The stdarch repo runs the following `std_detect` tests: ### Build The `build-std-detect.sh` script (https://github.com/rust-lang/stdarch/blob/e2b6512aed87df45294ae680181eeef7a802cd95/ci/build-std-detect.sh) builds `std_detect` using the nightly compiler for several targets. This will be subsumed by normal `x build library` on our Tier 1/2 targets. However, the stdarch repository also tests the following targets: - aarch64-unknown-freebsd - armv6-unknown-freebsd - powerpc-unknown-freebsd - powerpc64-unknown-freebsd - aarch64-unknown-openbsd Which we don't build/test on our CI currently. I think we have mostly two options here: 1) Ignore these targets 2) Create a special CI job that will build stage 1 rustc and then cross-compile std (or just the `std_detect` crate?) for these targets. ### Documentation The `dox.sh` script (https://github.com/rust-lang/stdarch/blob/3fec5adcd52a815f227805d4959a25b6402c7fd5/ci/dox.sh) builds and documents `std_detect` for several targets. All of them are Tier 2/we have `dist-` jobs for them, so I think that we can just skip this and let our normal CI subsume it? ### Tests The `run.sh` script (https://github.com/rust-lang/stdarch/blob/1b201cec2cca7465602a65ed6ae60517224b15f3/ci/run.sh) runs `cargo test` on `std_detect` with a bunch of variations of feature flags. This will be subsumed by `x test library` in our CI. The only problem is that `stdarch` runs these tests for a ludicrous number of targets: ``` - tuple: i686-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: arm-unknown-linux-gnueabihf - tuple: armv7-unknown-linux-gnueabihf - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: i586-unknown-linux-gnu - tuple: nvptx64-nvidia-cuda - tuple: thumbv6m-none-eabi - tuple: thumbv7m-none-eabi - tuple: thumbv7em-none-eabi - tuple: thumbv7em-none-eabihf - tuple: loongarch64-unknown-linux-gnu - tuple: wasm32-wasip1 - tuple: x86_64-apple-darwin - tuple: x86_64-apple-ios-macabi - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi - tuple: x86_64-pc-windows-msvc - tuple: i686-pc-windows-msvc - tuple: aarch64-pc-windows-msvc - tuple: x86_64-pc-windows-gnu - tuple: aarch64-unknown-linux-gnu - tuple: aarch64_be-unknown-linux-gnu - tuple: armv7-unknown-linux-gnueabihf - tuple: loongarch64-unknown-linux-gnu - tuple: powerpc-unknown-linux-gnu - tuple: powerpc64-unknown-linux-gnu - tuple: powerpc64le-unknown-linux-gnu - tuple: riscv32gc-unknown-linux-gnu - tuple: riscv64gc-unknown-linux-gnu - tuple: s390x-unknown-linux-gnu - tuple: x86_64-unknown-linux-gnu - tuple: aarch64-apple-darwin - tuple: aarch64-apple-ios-macabi ``` We definitely do not run *tests* for all of these targets on our CI. # Outcome We have decided to just subsume std_detect tests by our normal test suite for now, and not create a separate CI job. Therefore, this PR performs the following changes in target testing for `std_detect`: The following T3 targets would go from "build" to "nothing": ``` aarch64-unknown-freebsd (T3) armv6-unknown-freebsd (T3) powerpc-unknown-freebsd (T3) powerpc64-unknown-freebsd (T3) aarch64-unknown-openbsd (T3) ``` The following T3 targets would go from "test" to "nothing": ``` aarch64_be-unknown-linux-gnu (T3) riscv32gc-unknown-liux-gnu (T3) ``` The following T2 targets would go from "test" to "build": ``` arm-unknown-linux-gnueabihf (T2) armv7-unknown-linux-gnueabihf (T2) riscv64gc-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) powerpc64-unknown-linux-gnu (T2) powerpc64le-unknown-linux-gnu (T2) s390x-unknown-linux-gnu (T2) i586-unknown-linux-gnu (T2) loongarch64-unknown-linux-gnu (T2) wasm32-wasip1 (T2) x86_64-apple-ios-macabi (T2) aarch64-apple-ios-macabi (T2) aarch64-pc-windows-msvc (T2) armv7-unknown-linux-gnueabihf (T2) loongarch64-unknown-linux-gnu (T2) powerpc-unknown-linux-gnu (T2) ``` I have confirmed in https://github.com/rust-lang/stdarch/pull/1873 that the current version of this PR would pass stdarch's CI testsuite. r? `@ghost` try-job: armhf-gnu try-job: arm-android
2025-07-23Remove Josh code from `miri-script`Jakub Beránek-336/+6
2025-07-23Update josh sync documentationJakub Beránek-13/+10
Now all our Josh subtrees should be using josh-sync.
2025-07-23Init josh-sync config fileJakub Beránek-0/+2
2025-07-23atomicrmw on pointers: move integer-pointer cast hacks into backendRalf Jung-16/+11
2025-07-23CI: add windows-arm runnerRalf Jung-8/+20
2025-07-23Change rename self to parameter use `Self` typeA4-Tacks-29/+48
And add `&self` lifetime support Example === Rename to `this` ```rust struct Foo<T>(T); impl Foo<i32> { fn foo(&'static self$0) {} } ``` Old: ```rust struct Foo<T>(T); impl Foo<i32> { fn foo(this: &Foo) {} } ``` Fixes: ```rust struct Foo<T>(T); impl Foo<i32> { fn foo(this: &'static Self) {} } ```
2025-07-23Merge pull request #20281 from ChayimFriedman2/parse-hrtb-constShoyu Vanilla (Flint)-352/+463
fix: Parse `for<'a> [const]`
2025-07-23[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.Predrag Gruevski-3/+3
2025-07-22impl items are never unnamablebinarycat-2/+8
2025-07-22rustdoc: actually never link to unnamable typesbinarycat-7/+18
2025-07-22rustdoc: never try to link to unnamable typesbinarycat-1/+9
2025-07-22rustdoc: avoid allocating a temp String for aliases in search indexbinarycat-3/+16
2025-07-22Auto merge of #144249 - GuillaumeGomez:asm-tests, r=jieyouxubors-34/+61
Rename `tests/{assembly,codegen}` into `tests/{assembly,codegen}-llvm` and ignore these testsuites if configured backend doesn't match Follow-up of https://github.com/rust-lang/rust/pull/144125. This PR changes `compiletest` so that `asm` tests are only run if they match the current codegen backend. To better reflect it, I renamed the `tests/ui/asm` folder into `tests/ui/asm-llvm`. Like that, we can add new asm tests for other backends if we want without needing to add extra code to `compiletest`. Next step will be to use the new code annotations added in rust-lang/rust#144125 to ignore ui tests failing in cg_gcc until it's fixed on our side. cc `@antoyo` `@oli-obk` r? `@Kobzol`
2025-07-22Bless bootstrap testsJakub Beránek-11/+11
2025-07-22Move tests around to appease `tidy`Jakub Beránek-1/+2
2025-07-22Allow platform-specific code in `std_detect`Jakub Beránek-0/+1
2025-07-22pass build.npm from bootstrap to tidy and use it for npm installbinarycat-4/+14
2025-07-22bootstrap: Move musl-root fallback out of sanity checkJens Reidel-14/+18
Previously, the musl root would only be set to the fallback /usr by the sanity check, which isn't ran for the bootstrap tests. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-22Merge pull request #20280 from Kobzol/josh-syncLaurențiu Nicola-229/+42
Switch to using josh-sync
2025-07-22bootstrap: add package.json and package-lock.json to dist tarballbinarycat-0/+2
this ensures that js-related tests can still be run from within such a dist tarball.
2025-07-22Add CI workflow for periodically performing josh pullsJakub Beránek-0/+20
2025-07-22Apply suggestions from code reviewJakub Beránek-4/+5
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2025-07-22Add powerpc64le-unknown-linux-musl to CI rustc targetsJens Reidel-0/+1
I missed this in the promotion to tier 2 with host tools. Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-22miropt: move to edition 2024Marijn Schouten-1/+1
2025-07-22miropt: clippy fixesMarijn Schouten-12/+11
2025-07-22Only run `tests/assembly-*` and `tests/codegen-*` tests if they match the ↵Guillaume Gomez-3/+20
current codegen backend
2025-07-22Document synces using `josh-sync`Jakub Beránek-12/+41
2025-07-22Remove pull/push functionality from `xtask`Jakub Beránek-217/+0
2025-07-22Parse `for<'a> [const]`Chayim Refael Friedman-352/+463
And also refactor parsing of HRTB.
2025-07-22Add josh-sync.tomlLaurențiu Nicola-0/+2
2025-07-22Rename `tests/codegen` into `tests/codegen-llvm`Guillaume Gomez-18/+23
2025-07-22Rename `tests/assembly` into `tests/assembly-llvm`Guillaume Gomez-13/+18
2025-07-22Merge pull request #20277 from ↵Shoyu Vanilla (Flint)-3/+4
rust-lang/dependabot/npm_and_yarn/editors/code/form-data-4.0.4 Bump form-data from 4.0.2 to 4.0.4 in /editors/code
2025-07-22Rollup merge of #144164 - ognevny:opt-dist-stage0-root, r=KobzolMatthias Krüger-8/+14
opt-dist: add an option for setting path to stage0 root in MSYS2 we have problems with stage0 for *-gnullvm hosts because prebuilt dist tarballs will be available starting from 1.90.0-beta. also this change helps to match bootstrap.toml config r? Kobzol try-job: dist-x86_64-msvc try-job: dist-x86_64-linux
2025-07-22Rollup merge of #144126 - Shourya742:2025-06-18-fix-target-config-issue, ↵Matthias Krüger-4/+45
r=Kobzol Fix empty target_config in apply_rust_config bootstrap This PR fixes the issue of an empty target_config in apply_rust_config, which was caused by the ordering of TOML config parsing. This was inadvertently introduced during the last config refactor. The test and the corresponding configuration order have been corrected in this PR. r? ```@Kobzol```
2025-07-22Rollup merge of #143373 - cjgillot:bare-unused-trait-imports, r=petrochenkovMatthias Krüger-1/+1
Unquerify maybe_unused_trait_imports. Based on https://github.com/rust-lang/rust/pull/143247 r? ```@ghost``` for perf
2025-07-22Rollup merge of #142924 - lolbinarycat:tidy-js-extra-checks, r=KobzolMatthias Krüger-140/+191
tidy: move rustdoc js stuff into a tidy extra check Most of these were factored out of CI scripts, but `eslint` in particular was previously implemented with its own special cased logic. A new option has been added to bootstrap, `build.tidy-extra-checks`, which serves as a default value for the `--extra-checks` flag. This is mostly for the benefit of rustdoc js maintainers, but should also help bootstrap py maintainers. Additionally, `--extra-checks=cpp` has been documented. I'm not super happy with how long the extra check names are in comparison to the others (in particular `typecheck`), but I couldn't think of anything better (I didn't want to name it `tsc` on the off chance we want to switch to a different typechecking engine in the future). It would be nice to convert the extra checks arg into a proper enum, both for warning on unknown values and to provide better shell completion. r? ```@GuillaumeGomez``` Fixes: https://github.com/rust-lang/rust/issues/144093
2025-07-22Support filtering in analysis-stats MIR loweringLaurențiu Nicola-62/+66
2025-07-22Bump form-data from 4.0.2 to 4.0.4 in /editors/codedependabot[bot]-3/+4
Bumps [form-data](https://github.com/form-data/form-data) from 4.0.2 to 4.0.4. - [Release notes](https://github.com/form-data/form-data/releases) - [Changelog](https://github.com/form-data/form-data/blob/master/CHANGELOG.md) - [Commits](https://github.com/form-data/form-data/compare/v4.0.2...v4.0.4) --- updated-dependencies: - dependency-name: form-data dependency-version: 4.0.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
2025-07-22Merge from rustcThe Miri Cronjob Bot-287/+522
2025-07-22Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2025-07-22Merge pull request #20269 from Hmikihiro/migrate_indent_mappingShoyu Vanilla (Flint)-35/+74
Migrate AstNodeEdit::Indent to SyntaxEditor
2025-07-22Merge pull request #20270 from Hmikihiro/migrate_generate_newShoyu Vanilla (Flint)-58/+97
Migrate `generate new` assist to use `SyntaxEditor`
2025-07-21Implement nondet behaviour and change/add tests.LorrensP-2158466-174/+394
2025-07-21Use serde for target spec json deserializeNoratrieb-1/+2
The previous manual parsing of `serde_json::Value` was a lot of complicated code and extremely error-prone. It was full of janky behavior like sometimes ignoring type errors, sometimes erroring for type errors, sometimes warning for type errors, and sometimes just ICEing for type errors (the icing on the top). Additionally, many of the error messages about allowed values were out of date because they were in a completely different place than the FromStr impls. Overall, the system caused confusion for users. I also found the old deserialization code annoying to read. Whenever a `key!` invocation was found, one had to first look for the right macro arm, and no go to definition could help. This PR replaces all this manual parsing with a 2-step process involving serde. First, the string is parsed into a `TargetSpecJson` struct. This struct is a 1:1 representation of the spec JSON. It already parses all the enums and is very simple to read and write. Then, the fields from this struct are copied into the actual `Target`. The reason for this two-step process instead of just serializing into a `Target` is because of a few reasons 1. There are a few transformations performed between the two formats 2. The default logic is implemented this way. Otherwise all the default field values would have to be spelled out again, which is suboptimal. With this logic, they fall out naturally, because everything in the json struct is an `Option`. Overall, the mapping is pretty simple, with the vast majority of fields just doing a 1:1 mapping that is captured by two macros. I have deliberately avoided making the macros generic to keep them simple. All the `FromStr` impls now have the error message right inside them, which increases the chance of it being up to date. Some "`from_str`" impls were turned into proper `FromStr` impls to support this. The new code is much less involved, delegating all the JSON parsing logic to serde, without any manual type matching. This change introduces a few breaking changes for consumers. While it is possible to use this format on stable, it is very much subject to change, so breaking changes are expected. The hope is also that because of the way stricter behavior, breaking changes are easier to deal with, as they come with clearer error messages. 1. Invalid types now always error, everywhere. Previously, they would sometimes error, and sometimes just be ignored (which meant the users JSON was still broken, just silently!) 2. This now makes use of `deny_unknown_fields` instead of just warning on unused fields, which was done previously. Serde doesn't make it easy to get such warning behavior, which was the primary reason that this now changed. But I think error behavior is very reasonable too. If someone has random stale fields in their JSON, it is likely because these fields did something at some point but no longer do, and the user likely wants to be informed of this so they can figure out what to do. This is also relevant for the future. If we remove a field but someone has it set, it probably makes sense for them to take a look whether they need this and should look for alternatives, or whether they can just delete it. Overall, the JSON is made more explicit. This is the only expected breakage, but there could also be small breakage from small mistakes. All targets roundtrip though, so it can't be anything too major.
2025-07-22Rollup merge of #144254 - ognevny:opt-dist-artifact-dir, r=Kobzol许杰友 Jieyou Xu (Joe)-2/+2
opt-dist: make `artifact-dir` an absolute path for `opt-dist local` ...like for CI environments. the same logic applied as for `build_dir`. fixes the issue where some intermediate steps fail due to path being relative to an active directory r? Kobzol try-job: dist-x86_64-msvc try-job: dist-x86_64-linux
2025-07-22Rollup merge of #144251 - tshepang:rdg-sync, r=jieyouxu许杰友 Jieyou Xu (Joe)-8/+8
rustc-dev-guide subtree update Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/cca233729f03d0c59456cd3e866f92681faf4c54. Created using https://github.com/rust-lang/josh-sync. r? ```@ghost```
2025-07-22Rollup merge of #144243 - lnicola:sync-from-ra, r=lnicola许杰友 Jieyou Xu (Joe)-28/+278
Subtree update of `rust-analyzer` r? ```@ghost```