| Age | Commit message (Collapse) | Author | Lines |
|
Fix a wrong error message in 2024 edition
Fixes https://github.com/rust-lang/rust/issues/139952
|
|
|
|
fix: Address minor FIXME
|
|
|
|
Add expression fill mode variant for filling with underscore expressions
|
|
async_drop_in_place::{closure}, scoped async drop added.
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
I found "Rustc dev guide subtree update awkward"
|
|
|
|
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
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
|
|
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
|
|
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```
|
|
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
|
|
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.
|
|
Mark unsafe attributes as such
|
|
|
|
|
|
|
|
|
|
- Update r-efi to 5.2.0
Signed-off-by: Ayush Singh <ayush@beagleboard.org>
|
|
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`
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
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
|
|
|
|
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 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.
|
|
feat: adds an assist to remove underscores from used variables
|
|
adds an assist that suggests removing any underscore prefixes from used
variables.
|
|
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.
|
|
|
|
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.
|
|
|
|
|
|
|
|
fix(docs): add newlines between prefix/suffix chapters
|
|
toolchain version does not need to be specified
|
|
|
|
"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.
|
|
|