about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
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```
2025-07-22Rollup merge of #144187 - RalfJung:type-id-base-addr, r=oli-obk许杰友 Jieyou Xu (Joe)-27/+37
fix handling of base address for TypeId allocations This fixes the problems discovered by ````@theemathas```` in https://github.com/rust-lang/rust/pull/142789: - const-eval would sometimes consider TypeId pointers to be null - the type ID is different in Miri than in regular executions Both boil down to the same issue: the TypeId "allocation" has a guaranteed 0 base address, but const-eval assumes it was non-zero (like normal allocations) and Miri randomized it (like normal allocations). r? ````@oli-obk````
2025-07-22Rollup merge of #144080 - jieyouxu:realign, r=BoxyUwU许杰友 Jieyou Xu (Joe)-3/+7
Mitigate `#[align]` name resolution ambiguity regression with a rename Mitigates beta regression rust-lang/rust#143834 after a beta backport. ### Background on the beta regression The name resolution regression arises due to rust-lang/rust#142507 adding a new feature-gated built-in attribute named `#[align]`. However, unfortunately even [introducing new feature-gated unstable built-in attributes can break user code](https://www.github.com/rust-lang/rust/issues/134963) such as ```rs macro_rules! align { () => { /* .. */ }; } pub(crate) use align; // `use` here becomes ambiguous ``` ### Mitigation approach This PR renames `#[align]` to `#[rustc_align]` to mitigate the beta regression by: 1. Undoing the introduction of a new built-in attribute with a common name, i.e. `#[align]`. 2. Renaming `#[align]` to `#[rustc_align]`. The renamed attribute being `rustc_align` will not introduce new stable breakages, as attributes beginning with `rustc` are reserved and perma-unstable. This does mean existing nightly code using `fn_align` feature will additionally need to specify `#![feature(rustc_attrs)]`. This PR is very much a short-term mitigation to alleviate time pressure from having to fully fix the current limitation of inevitable name resolution regressions that would arise from adding any built-in attributes. Long-term solutions are discussed in [#t-lang > namespacing macro attrs to reduce conflicts with new adds](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/namespacing.20macro.20attrs.20to.20reduce.20conflicts.20with.20new.20adds/with/529249622). ### Alternative mitigation options [Various mitigation options were considered during the compiler triage meeting](https://github.com/rust-lang/rust/issues/143834#issuecomment-3084415277), and those consideration are partly reproduced here: - Reverting the PR doesn't seem very minimal/trivial, and carries risks of its own. - Rename to a less-common but aim-to-stabilization name is itself not safe nor convenient, because (1) that risks introducing new regressions (i.e. ambiguity against the new name), and (2) lang would have to FCP the new name hastily for the mitigation to land timely and have a chance to be backported. This also makes the path towards stabilization annoying. - Rename the attribute to a rustc attribute, which will be perma-unstable and does not cause new ambiguities in stable code. - This alleviates the time pressure to address *this* regression, or for lang to have to rush an FCP for some new name that can still break user code. - This avoids backing out a whole implementation. ### Review advice This PR is best reviewed commit-by-commit. - Commit 1 adds a test `tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs` which demonstrates the current name resolution regression re. `align`. This test fails against current master. - Commit 2 carries out the renames and test reblesses. Notably, commit 2 will cause `tests/ui/attributes/fn-align-nameres-ambiguity-143834.rs` to change from fail (nameres regression) to pass. This PR, if the approach still seems acceptable, will need a beta-backport to address the beta regression.
2025-07-22Rollup merge of #144027 - RalfJung:clippy, r=Mark-Simulacrum许杰友 Jieyou Xu (Joe)-63/+84
clippy: make tests work in stage 1 This finally fixes https://github.com/rust-lang/rust/issues/78717 :) Similar to what Miri already does, the clippy test step needs to carefully consider which compiler is used to build clippy and which compiler is linked into clippy (and thus must be used to build the test dependencies). On top of that we have some extra complications that Miri avoided by using `cargo-miri` for building its test dependencies: we need cargo to use the right rustc and the right sysroot, but https://github.com/rust-lang/cargo/issues/4423 makes this quite hard to do. See the long comment in `src/tools/clippy/tests/compile-test.rs` for details. Some clippy tests tried to import rustc crates; that fundamentally requires a full bootstrap loop so it cannot work in stage 1. I had to kind of guess what those tests were doing so I don't know if my changes there make any sense. Cc ```@flip1995``` ```@Kobzol```
2025-07-22Rollup merge of #143816 - Kobzol:compiletest-check-macro, r=jieyouxu许杰友 Jieyou Xu (Joe)-140/+63
Implement `check` for compiletest and RA using tool macro Small cleanup to reduce the number of places that require custom check steps. Of course I had to include one mini hack because of Rust Analyzer.. but I think it's worth it here. r? ````@jieyouxu````
2025-07-22Rollup merge of #142097 - ZuseZ4:offload-host1, r=oli-obk许杰友 Jieyou Xu (Joe)-0/+8
gpu offload host code generation r? ghost This will generate most of the host side code to use llvm's offload feature. The first PR will only handle automatic mem-transfers to and from the device. So if a user calls a kernel, we will copy inputs back and forth, but we won't do the actual kernel launch. Before merging, we will use LLVM's Info infrastructure to verify that the memcopies match what openmp offloa generates in C++. `LIBOMPTARGET_INFO=-1 ./my_rust_binary` should print that a memcpy to and later from the device is happening. A follow-up PR will generate the actual device-side kernel which will then do computations on the GPU. A third PR will implement manual host2device and device2host functionality, but the goal is to minimize cases where a user has to overwrite our default handling due to performance issues. I'm trying to get a full MVP out first, so this just recognizes GPU functions based on magic names. The final frontend will obviously move this over to use proper macros, like I'm already doing it for the autodiff work. This work will also be compatible with std::autodiff, so one can differentiate GPU kernels. Tracking: - https://github.com/rust-lang/rust/issues/131513
2025-07-21Merge pull request #20273 from ShoyuVanilla/match-adjustsChayim Refael Friedman-48/+94
fix: Apply adjusts to pats and exprs when doing pat analysis
2025-07-22fix: Apply adjusts to pats and exprs when doing pat analysisShoyu Vanilla-48/+94