Commit Graph

286275 Commits

Author SHA1 Message Date
Pietro Albini
33794fd196
mention --edition restrictions in rustc-dev-guide 2025-04-10 12:34:57 +02:00
Matthias Krüger
b14671e1bd
Rollup merge of #139599 - joshtriplett:style-tracking, r=traviscross
Tracking issue template: fine-grained information on style update status

Inspired by some of the communication issues around the stabilization of
`let`-chains, give more fine-grained information about the status of
updating style for any new syntax.

This does not change the process or blockers in any way; it only
*documents* the current state in the tracking issue. For instance, in
the case of `let`-chains, we would have checked the boxes for "Style
team decision" and "(non-blocking) Formatting has been implemented", and
not checked the box for the style guide. That would have then provided
better supporting information for any decisions.
2025-04-10 11:10:20 +02:00
Matthias Krüger
d7171bc8ce
Rollup merge of #139592 - camelid:doctest-md-opts, r=notriddle
rustdoc: Enable Markdown extensions when looking for doctests

Fixes #139064.

We should enable these to avoid misinterpreting uses of the extended
syntax as code blocks. This happens in practice with multi-paragraph
footnotes, as discovered in #139064.
2025-04-10 11:10:19 +02:00
Matthias Krüger
e3bcfbf3cf
Rollup merge of #139589 - saethlin:vacation, r=camelid
saethlin is back from vacation
2025-04-10 11:10:19 +02:00
Matthias Krüger
c100846574
Rollup merge of #139580 - fmease:unrotate, r=fmease
Temporarily leave the review rotation

r? ghost
2025-04-10 11:10:18 +02:00
Matthias Krüger
7509b4652c
Rollup merge of #139568 - nnethercote:empty-trait-name, r=compiler-errors
Don't use empty trait names

Helps with #137978. Details in individual commits.

r? ```@davidtwco```
2025-04-10 11:10:17 +02:00
Matthias Krüger
e8994abe52
Rollup merge of #139563 - EnzymeAD:better-autodiff-err, r=jieyouxu
emit a better error message for using the macro incorrectly

fixing: https://github.com/EnzymeAD/rust/issues/185
I feel like it's not a perfect message either, so I'm open to suggestions.
But at the end of the day users will need to read the docs anyway, and emitting
multi-line errors each time this gets triggered can probably become annoying?

r? ``@jieyouxu`` since you've reviewed my frontend work back in the days.

Tracking:

- https://github.com/rust-lang/rust/issues/124509
2025-04-10 11:10:17 +02:00
Matthias Krüger
12172ebf70
Rollup merge of #139560 - programmerjake:patch-5, r=jieyouxu
fix title of offset_of_enum feature

tracking issue #120141
2025-04-10 11:10:16 +02:00
Matthias Krüger
c808b20360
Rollup merge of #139530 - oli-obk:rustc-intrinsic-cleanup, r=RalfJung
Remove some dead or leftover code related to rustc-intrinsic abi removal

r? ```@RalfJung```

PR that removed the ABI: https://github.com/rust-lang/rust/pull/139455

tracking issue: https://github.com/rust-lang/rust/issues/132735
2025-04-10 11:10:16 +02:00
Matthias Krüger
2b0e47eb4c
Rollup merge of #139507 - Zalathar:trim-env-name, r=jieyouxu
compiletest: Trim whitespace from environment variable names

When a test contains a directive like `//@ exec-env: FOO=bar`, compiletest currently includes that leading space in the name of the environment variable, so it is defined as ` FOO` instead of `FOO`.

This is an annoying footgun that is pretty much never intended, especially since most other directives *do* trim whitespace. So let's get rid of it by trimming the environment variable name.

Values remain untrimmed, since there could conceivably be a use-case for values with leading space, but perhaps we'll end up trimming values too in the future.

Recently observed in https://github.com/rust-lang/rust/pull/138603#issuecomment-2783709359.

Fixes #132990.
Supersedes #133148.

---

try-job: test-various
2025-04-10 11:10:15 +02:00
Matthias Krüger
7f08e638c4
Rollup merge of #139449 - Nadrieril:peel-recursive, r=lcnr
match ergonomics: replace `peel_off_references` with a recursive call

This makes it imo quite a bit easier to follow how the binding mode gets calculated.

cc ```@dianne```
2025-04-10 11:10:14 +02:00
Matthias Krüger
b131828f0d
Rollup merge of #139423 - compiler-errors:field-autoderef, r=oli-obk
Suppress missing field error when autoderef bottoms out in infer

I see this error repeatedly when doing refactorings, and it's pretty misleading b/c it's not the source of the error.
2025-04-10 11:10:14 +02:00
Matthias Krüger
aecce2161d
Rollup merge of #138605 - xizheyin:issue-138567, r=GuillaumeGomez
Clean up librustdoc::html::render to be better encapsulated

Closes #138567
2025-04-10 11:10:13 +02:00
Matthias Krüger
070148acf1
Rollup merge of #138167 - GuillaumeGomez:rustdoc-hidden-stripper-improvement, r=camelid
Small code improvement in rustdoc hidden stripper

This is a very minor code improvement following https://github.com/rust-lang/rust/pull/137534. It doesn't change anything about the performance issue.

r? ```@notriddle```
2025-04-10 11:10:13 +02:00
bors
7d7de5bf3c Auto merge of #139088 - spastorino:ergonomic-ref-counting-2, r=nikomatsakis
Ergonomic ref counting: optimize away clones when possible

This PR build on top of https://github.com/rust-lang/rust/pull/134797. It optimizes codegen of ergonomic ref-counting when the type being `use`d is only known to be copy after monomorphization. We avoid codening a clone and generate bitwise copy instead.

RFC: https://github.com/rust-lang/rfcs/pull/3680
Tracking issue: https://github.com/rust-lang/rust/issues/132290
Project goal: https://github.com/rust-lang/rust-project-goals/issues/107

r? `@nikomatsakis`

This PR could better sit on top of https://github.com/rust-lang/rust/pull/131650 but as it did not land yet I've decided to just do minimal changes. It may be the case that doing what I'm doing regress the performance and we may need to go the full route of https://github.com/rust-lang/rust/pull/131650.
cc `@saethlin` in this regard.
2025-04-10 09:08:23 +00:00
Ralf Jung
fb30824850
Merge pull request #4209 from LorrensP-2158466/freebsd_futex
Implement FreeBSD syscall _umtx_op  for futex support
2025-04-10 09:04:44 +00:00
LorrensP-2158466
88a82be263 feature: implement WAIT & WAKE operations of FreeBSD _umtx_op syscall for Futex support 2025-04-10 10:30:02 +02:00
onur-ozkan
b1053fdb76 handle config.channel default for tarballs
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-10 11:16:12 +03:00
Pietro Albini
9cf6e8cbf6
include --edition in the compiletest stamp 2025-04-10 09:57:17 +02:00
Pietro Albini
2638e4e8b2
prevent configuring the edition with //@compile-flags 2025-04-10 09:57:15 +02:00
Pietro Albini
cd3a7bb961
ensure //@compile-flags are last even when passing --edition 2025-04-10 09:56:39 +02:00
Pietro Albini
cd371b90e2
replace //@ compile-flags: --edition with //@ edition 2025-04-10 09:56:37 +02:00
Jieyou Xu
59a1f3314c
compiletest: update to Edition 2024 2025-04-10 15:01:48 +08:00
Jakub Beránek
9a26863acc
Apply LTO when building rustc tools 2025-04-10 08:56:57 +02:00
Ralf Jung
726e33f0e3 path: add more Windows tests 2025-04-10 08:40:22 +02:00
Jieyou Xu
c615d10743
tests: use specific-purpose needs-crate-type over ignore-$target directives
Not all existing tests are converted, I only updated ones that I can
easily find via directive comments.
2025-04-10 12:52:08 +08:00
Jieyou Xu
5fe7712a10
rustc-dev-guide: document needs-crate-type 2025-04-10 12:52:08 +08:00
Jieyou Xu
57135c4273
compiletest: add needs-crate-type directive
The `//@ needs-crate-type: $crate_types...` directive takes a
comma-separated list of crate types that the target platform must
support in order for the test to be run.
2025-04-10 12:52:08 +08:00
Nicholas Nethercote
9bb1008e1d Avoid empty identifiers for delegate params and args.
Instead use `argN`. The empty identifiers could flow to
`Liveness::should_warn`, where they would trigger a bounds error.

Fixes #139512.
2025-04-10 14:46:53 +10:00
Scott McMurray
4207c786e7 PR feedback 2025-04-09 21:44:59 -07:00
Nicholas Nethercote
3cb9966235 Add a HIR pretty printing test for delegation.
Note that some of the output is currently bogus, with missing params and
args:
```
fn add(: _, : _) -> _ { m::add(, ) }
```
The next commit will fix this.
2025-04-10 14:09:37 +10:00
bors
9d28fe3976 Auto merge of #139000 - compiler-errors:rigid-missing-item, r=lcnr
Rigidly project missing item due to guaranteed impossible sized predicate

This is a somewhat involved change, but it amounts to treating missing impl items due to guaranteed impossible where clauses (dyn/str/slice sized, cc #135480) as *rigid projections* rather than projecting to an error term, since that was preventing either reporting a proper error (in an empty param env) *or* successfully type checking the code (in the presence of trivially false where clauses).

Fixes https://github.com/rust-lang/rust/issues/138970

r? `@lcnr` `@oli-obk`
2025-04-10 04:03:59 +00:00
Jieyou Xu
4f7c02dda1
compiletest: don't use stringly paths for compose_and_run 2025-04-10 09:38:47 +08:00
bors
6813f955a6 Auto merge of #139279 - BoxyUwU:bump-boostrap, r=jieyouxu
Bump boostrap compiler to new beta

try-job: `*msvc*`
2025-04-10 00:43:25 +00:00
Nicholas Nethercote
663a317c20 Address review comments. 2025-04-10 09:39:21 +10:00
Nicholas Nethercote
1b3fc585cb Rename some name variables as ident.
It bugs me when variables of type `Ident` are called `name`. It leads to
silly things like `name.name`. `Ident` variables should be called
`ident`, and `name` should be used for variables of type `Symbol`.

This commit improves things by by doing `s/name/ident/` on a bunch of
`Ident` variables. Not all of them, but a decent chunk.
2025-04-10 09:30:55 +10:00
bors
51548ce71f Auto merge of #139595 - matthiaskrgr:rollup-kaa8aim, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #138470 (Test interaction between RFC 2229 migration and use closures)
 - #138628 (Add more ergonomic clone tests)
 - #139164 (std: improve documentation for get_mut() methods regarding forgotten guards)
 - #139488 (Add missing regression GUI test)
 - #139489 (compiletest: Add directive `dont-require-annotations`)
 - #139513 (Report higher-ranked trait error when higher-ranked projection goal fails in new solver)
 - #139521 (triagebot: roll compiler reviewers for rustc/unstable book)
 - #139532 (Update `u8`-to-and-from-`i8` suggestions.)
 - #139551 (report call site of inlined scopes for large assignment lints)
 - #139575 (Remove redundant words)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-04-09 21:35:22 +00:00
Michael Goulet
6cd724bb43 Make unnormalizable item ambiguous in coherence 2025-04-09 20:31:58 +00:00
Michael Goulet
830aeb6102 Use a query rather than recomputing the tail repeatedly 2025-04-09 20:26:58 +00:00
Michael Goulet
ccdfd310be Mark GAT WC as GoalSource::AliasWellFormed so that we recurse into them in error reporting 2025-04-09 20:26:57 +00:00
Michael Goulet
27836e1e57 Rigidly project missing item due to guaranteed impossible sized predicate 2025-04-09 20:26:57 +00:00
Josh Triplett
7103aea39a Tracking issue template: fine-grained information on style update status
Inspired by some of the communication issues around the stabilization of
`let`-chains, give more fine-grained information about the status of
updating style for any new syntax.

This does not change the process or blockers in any way; it only
*documents* the current state in the tracking issue. For instance, in
the case of `let`-chains, we would have checked the boxes for "Style
team decision" and "(non-blocking) Formatting has been implemented", and
not checked the box for the style guide. That would have then provided
better supporting information for any decisions.
2025-04-09 12:59:37 -07:00
Oli Scherer
d0ea07e908
Merge pull request #4259 from Urgau/triagebot-new-feat
triagebot: enable `[canonicalize-issue-links]` and `[no-mentions]`
2025-04-09 18:56:17 +00:00
onur-ozkan
9847c73893 set rust.channel to "auto-detect" for dist profile
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-04-09 21:52:00 +03:00
Urgau
57c2a021a4
triagebot: enable [canonicalize-issue-links] and [no-mentions] 2025-04-09 20:29:19 +02:00
Matthias Krüger
7aab307541
Rollup merge of #139575 - timesince:master, r=wesleywiser
Remove redundant words

Remove redundant words
2025-04-09 20:23:13 +02:00
Matthias Krüger
e962e52725
Rollup merge of #139551 - jogru0:121672, r=oli-obk
report call site of inlined scopes for large assignment lints

Addressed issue: #121672
Tracking issue: #83518

r? `@oli-obk`

I tried to follow your comment about what to do [here](https://github.com/rust-lang/rust/issues/121672#issuecomment-1972783675). However, I'm totally unfamiliar with the code so far (this is my first contribution touching compiler code), so I apologize in advance if I did something stupid 😅

In particular, I'm not sure I use the _correct_ source scope to look for inline data, as there is a whole `IndexVec` of them. My changes definitely did something, as can be seen by the added ui test. However, the result is not as anticipated in the issue:
```
LL |     let cell = std::cell::UnsafeCell::new(data);
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ value moved from here
```
instead of
```
LL |     let cell = std::cell::UnsafeCell::new(data);
   |                                           ^^^^ value moved from here
```
raising my suspicion that maybe I got the wrong source scope.
2025-04-09 20:23:12 +02:00
Matthias Krüger
a8b0d56f6f
Rollup merge of #139532 - bjoernager:master, r=tgross35
Update `u8`-to-and-from-`i8` suggestions.

`u8::cast_signed` and `i8::cast_unsigned` have been stabilised, but `i8::from_ne_bytes` et al. still suggest using `as i8` or `as u8`.
2025-04-09 20:23:12 +02:00
Matthias Krüger
78e59af997
Rollup merge of #139521 - jieyouxu:compiler-doc-reviewers, r=GuillaumeGomez,ehuss
triagebot: roll compiler reviewers for rustc/unstable book

r? compiler
2025-04-09 20:23:11 +02:00
Matthias Krüger
584cd13924
Rollup merge of #139513 - compiler-errors:higher-ranked-proj, r=lcnr
Report higher-ranked trait error when higher-ranked projection goal fails in new solver

~~See HACK comment inline. Not actually sure if it should be marked as a *HACK*, b/c~~ it's kinda a legitimate case we want to care about unless we're going to make the proof tree visitor *smarter* about the leak check than the actual trait solver itself.

Encountered this while battling with `NiceRegionError`s in the old solver b/c I wondered what this code ended up giving us in the *new* solver as a comparison:
```rust
trait Foo {}

impl<T: FnOnce(&())> Foo for T {}

fn baz<T: Foo>() {}

fn main() {
    baz::<fn(&'static ())>();
}
```

On master it's pretty bad:
```
error[E0271]: type mismatch resolving `<fn(&()) as FnOnce<(&(),)>>::Output == ()`
 --> <source>:8:11
  |
8 |     baz::<fn(&'static ())>();
  |           ^^^^^^^^^^^^^^^ types differ
  |
note: required for `fn(&'static ())` to implement `Foo`
 --> <source>:3:22
  |
3 | impl<T: FnOnce(&())> Foo for T {}
  |         -----------  ^^^     ^
  |         |
  |         unsatisfied trait bound introduced here
```

After this PR it's much better:
```
error[E0277]: the trait bound `fn(&'static ()): Foo` is not satisfied
 --> /home/mgx/test.rs:8:11
  |
8 |     baz::<fn(&'static ())>();
  |           ^^^^^^^^^^^^^^^ the trait `for<'a> FnOnce(&'a ())` is not implemented for `fn(&'static ())`
  |
  = note: expected a closure with arguments `(&'static (),)`
             found a closure with arguments `(&(),)`
note: required for `fn(&'static ())` to implement `Foo`
 --> /home/mgx/test.rs:3:22
  |
3 | impl<T: FnOnce(&())> Foo for T {}
  |         -----------  ^^^     ^
  |         |
  |         unsatisfied trait bound introduced here
note: required by a bound in `baz`
 --> /home/mgx/test.rs:5:11
  |
5 | fn baz<T: Foo>() {}
  |           ^^^ required by this bound in `baz`
```

r? lcnr
2025-04-09 20:23:11 +02:00