about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2025-04-28Rollup merge of #140056 - yuk1ty:fix-static-mut-error-message, r=jieyouxuGuillaume Gomez-1/+1
Fix a wrong error message in 2024 edition Fixes https://github.com/rust-lang/rust/issues/139952
2025-04-28Unelide lifetimeLaurențiu Nicola-1/+1
2025-04-28Merge pull request #19706 from Veykril/push-nkpmknlvzyomLukas Wirth-24/+19
fix: Address minor FIXME
2025-04-28fix: Address minor FIXMELukas Wirth-24/+19
2025-04-28Merge pull request #19704 from Veykril/push-wrvznvvpvtvpLukas Wirth-125/+172
Add expression fill mode variant for filling with underscore expressions
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-85/+104
async_drop_in_place::{closure}, scoped async drop added.
2025-04-28Add foldhash license exceptionLaurențiu Nicola-0/+1
2025-04-28Add expression fill mode variant for filling with underscore expressionsLukas Wirth-125/+172
2025-04-28Auto merge of #123239 - Urgau:dangerous_implicit_autorefs, ↵bors-0/+4
r=jdonszelmann,traviscross Implement a lint for implicit autoref of raw pointer dereference - take 2 *[t-lang nomination comment](https://github.com/rust-lang/rust/pull/123239#issuecomment-2727551097)* This PR aims at implementing a lint for implicit autoref of raw pointer dereference, it is based on #103735 with suggestion and improvements from https://github.com/rust-lang/rust/pull/103735#issuecomment-1370420305. The goal is to catch cases like this, where the user probably doesn't realise it just created a reference. ```rust pub struct Test { data: [u8], } pub fn test_len(t: *const Test) -> usize { unsafe { (*t).data.len() } // this calls <[T]>::len(&self) } ``` Since #103735 already went 2 times through T-lang, where they T-lang ended-up asking for a more restricted version (which is what this PR does), I would prefer this PR to be reviewed first before re-nominating it for T-lang. ---- Compared to the PR it is as based on, this PR adds 3 restrictions on the outer most expression, which must either be: 1. A deref followed by any non-deref place projection (that intermediate deref will typically be auto-inserted) 2. A method call annotated with `#[rustc_no_implicit_refs]`. 3. A deref followed by a `addr_of!` or `addr_of_mut!`. See bottom of post for details. There are several points that are not 100% clear to me when implementing the modifications: - ~~"4. Any number of automatically inserted deref/derefmut calls." I as never able to trigger this. Am I missing something?~~ Fixed - Are "index" and "field" enough? ---- cc `@JakobDegen` `@WaffleLapkin` r? `@RalfJung` try-job: dist-various-1 try-job: dist-various-2
2025-04-28Add bootstrap cfgLaurențiu Nicola-0/+1
2025-04-28Format codeLaurențiu Nicola-1/+3
2025-04-28Merge from rust-lang/rustLaurențiu Nicola-18186/+35821
2025-04-28Add or-patterns to pattern typesOli Scherer-0/+18
2025-04-28Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-04-28ci: use aws codebuild for the `dist-x86_64-linux` jobMarcoIeni-2/+2
2025-04-28Introduce `BoxMarker` to pretty-printing.Nicholas Nethercote-4/+4
The pretty-printers open and close "boxes" of text a lot. The open and close operations must be matched. The matching is currently all implicit and very easy to get wrong. (#140280 and #140246 are two recent pretty-printing fixes that both involved unclosed boxes.) This commit introduces `BoxMarker`, a marker type that represents an open box. It makes box opening/closing explicit, which makes it much easier to understand and harder to get wrong. The commit also removes many comments are on `end` calls saying things like "end outer head-block", "Close the outer-box". These demonstrate how confusing the implicit approach was, but aren't necessary any more.
2025-04-28use repo name in push pr titleTshepang Mbambo-1/+1
I found "Rustc dev guide subtree update awkward"
2025-04-28Merge from rustcThe rustc-dev-guide Cronjob Bot-339/+502
2025-04-28Preparing for merge from rustcThe rustc-dev-guide Cronjob Bot-1/+1
2025-04-28add a FIXMEonur-ozkan-2/+3
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-28Rollup merge of #139224 - epage:nocapture, r=thomccChris Denton-4/+6
fix(test): Expose '--no-capture' in favor of `--nocapture` This improves consistency with commonly expected CLI conventions, avoiding a common stutter people make when running tests (trying what they expect and then having to check the docs to then user whats accepted). An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this). Overall, we're shifting focus for features to custom test harnesses (see #134283). Most of `pytest`s modes will likely be irrelevant in that situation. As for the rest, its too early to tell which, if any, may be relevant, so we're sticking with this small, quality of life improvement. I expect we'll warn about `--nocapture` being deprecated in the future after a sufficient transition period has been allowed. By deprecating `--nocapture`, we intend that custom test harnesses do not need to support it for reasons outside of their own compatibility requirements, much like the deprecation in #134283 I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`. I feel like T-testing-devex should do a wider look at environment variables role in lib`test` before evaluating whether to - Deprecate it in favor of the user passing CLI flags or the test runner providing its own config - Deprecate in favor of `RUST_TEST_NO_CAPTURE` - Deprecate in favor of `RUST_TEST_CAPTURE` Other CLI flags were evaluated for casing consistency: - `--logfile` has the same problem but was deprecated in #134283 Regarding the implementation, I moved `--nocapture` out of `optgroups()`, into `parse_opts()`, out of an abundance of caution in passing the options without a deprecated value to the usage generation. However, the usage does not actually show optional flags, so this could potentially be dropped, simplifying the PR. Note: `compiletest` added `--no-capture` instead of `--nocapture` in #134809 T-testing-devex FCP: https://github.com/rust-lang/rust/issues/133073#issuecomment-2486921104 Fixes #133073
2025-04-28Rollup merge of #138737 - Ayush1325:r-efi-update, r=tgross35Chris Denton-4/+4
uefi: Update r-efi - Bump up the version to 5.2.0 try-job: x86_64-gnu-distcheck try-job: x86_64-gnu try-job: test-various
2025-04-28Rollup merge of #138395 - Kobzol:ci-download-gcc, r=Mark-SimulacrumChris Denton-0/+3
Download GCC from CI on test builders This should reduce the duration of the `x86_64-gnu-llvm-18` job, which runs on PR CI, which is currently the only one that builds GCC (outside of the x64 dist builder). Since we handle the GCC download in the GCC step, and not eagerly in config, we can set this flag globally across all test builders, as it won't do anything unless they actually try to build GCC. Opening as a draft to test if it works on CI, because I still need to implement logic to avoid the download if there are any local modifications to GCC (essentially the "if-unchanged" mode, although I want to try something a bit different). r? ```@ghost```
2025-04-27Auto merge of #140362 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 10 commits in d811228b14ae2707323f37346aee3f4147e247e6..7918c7eb59614c39f1c4e27e99d557720976bdd7 2025-04-15 15:18:42 +0000 to 2025-04-27 09:44:23 +0000 - overriding-dependencies.md: better readability (rust-lang/cargo#15459) - source-replacement.md: fix typo (rust-lang/cargo#15458) - Stabilize automatic garbage collection. (rust-lang/cargo#14287) - Update doctest xcompile flags (rust-lang/cargo#15455) - fix: Suggest similar looking feature names when feature is missing (rust-lang/cargo#15454) - fix(unit-graph): switch to Package ID Spec (rust-lang/cargo#15447) - chore(deps): update cargo-semver-checks to v0.41.0 (rust-lang/cargo#15446) - Implement RFC3695: Allow boolean literals as cfg predicates (rust-lang/cargo#14649) - chore: remove duplicate word in comment (rust-lang/cargo#15437) - Fix formatting of CliUnstable parsing (rust-lang/cargo#15434) r? ghost
2025-04-27Rollup merge of #140348 - ehuss:lint-docs-edition, r=compiler-errorsMatthias Krüger-14/+8
Update lint-docs to default to Rust 2024 This updates the lint-docs tool to default to the 2024 edition. The lint docs are supposed to illustrate the code with the latest edition, and I just forgot to update this in https://github.com/rust-lang/rust/pull/133349. Some docs needed to add the `edition` attribute since they were assuming a particular edition, but were missing the explicit annotation. This also includes a commit to simplify the edition handling in lint-docs.
2025-04-27Merge pull request #4293 from primoly/unsafe-attributesBen Kimock-4/+4
Mark unsafe attributes as such
2025-04-27`unsafe(no_mangle)` in `miri_start` examplesprimoly-4/+4
2025-04-27Update cargoWeihang Lo-0/+0
2025-04-27Merge pull request #2351 from rust-lang/rustc-pullYuki Okushi-7423/+14760
2025-04-27ci: clean more disk space in codebuildMarcoIeni-50/+81
2025-04-27CI: docker: host-x86_64: test-various: uefi_qemu_test: Update r-efiAyush Singh-4/+4
- Update r-efi to 5.2.0 Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-04-27Auto merge of #140291 - GuillaumeGomez:doctest-2024-stdout, r=notriddlebors-1/+16
Correctly display stdout and stderr in case a doctest is failing Fixes https://github.com/rust-lang/rust/issues/140289. Since the doctest is actually running itself, we need to handle the output directly inside it. cc `@fmease` r? `@notriddle`
2025-04-27bypass linker configuration and cross target check on `x check`onur-ozkan-1/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-26Auto merge of #140288 - Zalathar:new-executor, r=jieyouxubors-7/+11
compiletest: Re-land using the new non-libtest executor by default This PR re-lands #139998, which had the misfortune of triggering download-rustc in its CI jobs, so we didn't get proper test metrics for comparison with the old implementation. So that was PR was reverted in #140233, with the intention of re-landing it alongside a dummy compiler change to inhibit download-rustc. --- Original PR description for #139998: >The new executor was implemented in #139660, but required a manual opt-in. This PR activates the new executor by default, but leaves the old libtest-based executor in place (temporarily) to make reverting easier if something unexpectedly goes horribly wrong. > >Currently the new executor can be explicitly disabled by passing the `-N` flag to compiletest (e.g. `./x test ui -- -N`), but eventually that flag will be removed, alongside the removal of the libtest dependency. The flag is mostly there to make manual comparative testing easier if something does go wrong. > >As before, there *should* be no user-visible difference between the old executor and the new executor. --- r? jieyouxu
2025-04-27Fix bad handling of macros if there is already a `main` functionGuillaume Gomez-1/+4
2025-04-26Update lint-docs to default to Rust 2024Eric Huss-1/+1
This updates the lint-docs tool to default to the 2024 edition. The lint docs are supposed to illustrate the code with the latest edition, and I just forgot to update this in https://github.com/rust-lang/rust/pull/133349. Some docs needed to add the `edition` attribute since they were assuming a particular edition, but were missing the explicit annotation.
2025-04-26lint-docs: Don't hard-code the valid editionsEric Huss-14/+8
This removes the hard-coded list of edition support in the lint-docs tool, and instead just assumes the edition attribute is something valid. There isn't a real reason to have this, as rustc will error if given a wrong number. This should be easier to maintain going forward.
2025-04-26Merge pull request #19692 from vishruth-thimmaiah/remove_underscore_for_used_varChayim Refael Friedman-0/+212
feat: adds an assist to remove underscores from used variables
2025-04-27feat: adds an assist to remove underscores from used variablesVishruth-Thimmaiah-0/+212
adds an assist that suggests removing any underscore prefixes from used variables.
2025-04-26Don't escape `'static`Chayim Refael Friedman-2/+10
As it is a valid lifetime without escaping. It does need to be escaped as a label, but we have no way to distinguish that.
2025-04-26Escape raw names in labels properlyChayim Refael Friedman-5/+26
2025-04-26Rollup merge of #140226 - alexcrichton:update-wasm-component-ld, r=jieyouxuMatthias Krüger-1/+1
Update wasm-component-ld to 0.5.13 This commit updates the vendored `wasm-component-ld` binary to 0.5.13 which includes some various bug fixes and new feature updates for upcoming component model features coming down the pike. Not expected to break any existing workflows, just a normal update.
2025-04-26replace command that does not workTshepang Mbambo-3/+6
2025-04-26copy-paste easeTshepang Mbambo-1/+1
2025-04-26use correct code block markersTshepang Mbambo-24/+24
2025-04-26Merge pull request #2343 from hwhsu1231-fork/fix-prefix-chapterTshepang Mbambo-0/+5
fix(docs): add newlines between prefix/suffix chapters
2025-04-26Merge pull request #2345 from rust-lang/extraneousTshepang Mbambo-3/+3
toolchain version does not need to be specified
2025-04-26Fix error message for static references or mutable referencesyuk1ty-1/+1
2025-04-25Clarify text for add_braces assistWilfred Hughes-3/+3
"to arm expression" is hard to parse, because "arm" can be a verb. Not all Rust users may know that "arm" refers to a `match` expression either. Tweak the wording to make the sentence easier to parse, and clarify that this assist refers to `match`. Use the same wording style for the closure version too.
2025-04-26Merge from rustcThe Miri Cronjob Bot-171/+302