Rollup of 10 pull requests - #163227
Rollup of 10 pull requests#163227
Conversation
Detect `ident: Type` or `self: Type` inside trait bodies to emit a clearer diagnostics.
…t `dyn` as a keyword
A reflexive `'a: 'a` leaf is always satisfied, so filter it out in `And::new` instead of pattern matching for it in the places which happen to build such a constraint. An AND which ends up empty is trivially true, which makes the OR containing it true. This is how a reflexive candidate discharges a root type outlives constraint, so `destructure_type_outlives_constraints_in_root` no longer has to look at region outlives leaves at all.
Add this note to lifetime errors:
```text
error[E0521]: borrowed data escapes outside of function
--> $DIR/static-impl-obligation.rs:163:9
|
LL | fn bar<'a>(x: &'a &'a u32) {
| -- - `x` is a reference that is only valid in the function body
| |
| lifetime `'a` defined here
LL | let y: &dyn Foo = x;
LL | y.hello();
| ^^^^^^^^^
| |
| `x` escapes the function body here
| argument requires that `'a` must outlive `'static`
|
note: `'static` requirement for `<(dyn o::Foo + 'static)>::hello` introduced here
--> $DIR/static-impl-obligation.rs:158:40
|
LL | impl dyn Foo + 'static where Self: 'static {
| ^^^^^^^ `'static` requirement introduced here
LL | fn hello(&'static self) where Self: 'static {}
| ^^^^^^^ `'static` requirement introduced here
```
This currently only accounts for explicit bounds, other obligations like those arising from `Self` in a `impl dyn Trait {}` or from the receiver in `fn foo(&'static self)` are not accounted for.
```
note: `'static` lifetime requirement from `<(dyn b::Foo + 'static)>::hello` introduced here
--> $DIR/static-impl-obligation.rs:16:18
|
LL | impl dyn Foo {
LL | fn hello(&'static self) {}
| ^^^^^^^^^^^^^ lifetime requirement introduced here
```
```
note: `'static` lifetime requirement from `<(dyn a::Foo + 'static)>::hello` introduced here
--> $DIR/static-impl-obligation.rs:4:5
|
LL | impl dyn Foo {
| ^^^^^^^^^^^^ lifetime requirement introduced here
LL | fn hello(&self) {}
|
```
… lifetime
```
note: `'static` lifetime requirement from `<(dyn a::Foo + 'static)>::hello` introduced here
--> $DIR/static-impl-obligation.rs:4:10
|
LL | impl dyn Foo {
| ^^^^^^^ `dyn Trait` introduces an implicit `'static` lifetime requirement
LL | fn hello(&self) {}
|
```
```
note: `'static` lifetime requirement from `<(dyn e::Foo + 'static)>::hello` introduced here
--> $DIR/static-impl-obligation.rs:48:20
|
LL | impl dyn Foo + 'static {
| ^^^^^^^ lifetime requirement introduced here
LL | fn hello(&self) {}
|
```
FreeBSD 13.1 had introduced a sched cpu affinity compatibility layer with Linux. 13.0 and even 13.1 being EOL, we can simplify here.
…_region_constraints, r=BoxyUwU trait solver: Handle reflexive region constraints Fixes rust-lang/project-assumptions-on-binders#19 A reflexive placeholder constraint like `'a: 'a` can show up after we compute transitive region constraints. We then try to pull it out of the current universe by looking for lower-universe candidates. With none to choose from it becomes false, even though `'a: 'a` was true the whole time. I first had this buried in the binder region work, which made a green test pretty meaningless because too much else was changing around it. Split out on its own, the fix is just to accept equal regions before doing the universe rewrite. I think that is the sensible place to stop: it handles the direct case and the reflexive edges made by the transitive pass. I added a regression for the direct case. cc/ @BoxyUwU o/
…e, r=fee1-dead Avoid ICEs when recovering malformed function parameters Fixes rust-lang#160337 Fixes rust-lang#160490
revert rust-lang#162715 due to rust-lang#163149 cc rust-lang#163149 rust-lang#153947 also probably should be reopened, given that it'll go back to ICEing after the revert. I'll probably start a zulip thread before reopening the PR, since this change ends up accepting _a lot_ of weird code that was previously accepted and I'm not sure what the desired behavior would be here. r? oli-obk
Update deprecated rustc_hir imports 2 Followup to rust-lang#160336, see also rust-lang#163170 and rust-lang/rust-clippy/pull/17714 There is one more PR after this, they're split up to hopefully not be too conflict-y.
…r, r=Darksonn Add `inline` attribute to `NonZero::from_str` `<integer>::from_str`, `T::from_str_radix`, `T::from_ascii_bytes`, and `T::from_ascii_bytes_radix` has the `inline` attribute, buy `NonZero::from_str` does not.
…nthey std::thread::available_parallelism merging linux/android/freebsd version FreeBSD 13.1 had introduced a sched cpu affinity compatibility layer with Linux. 13.0 and even 13.1 being EOL, we can simplify here.
fix(parser): emit targeted diagnostic for fields inside traits Fixes rust-lang#161815 Detect `ident: Type` or `self: Type` inside trait bodies to emit a clearer diagnostic.
This comment has been minimized.
This comment has been minimized.
Rollup of 10 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-gnu-llvm-21-3 try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 1a8fa55 (parent) -> 6eeff9a (this PR) Test differencesShow 915 test diffsStage 1
Stage 2
Additionally, 876 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 6eeff9a52c3e35c4c4cbf5651f342dcd2191866f --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (6eeff9a): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 0.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 490.745s -> 488.343s (-0.49%) |
|
📌 Perf builds for each rolled up PR:
parent commit: 1a8fa55580 In the case of a perf regression, run the following command with the SHAs of each PR you suspect might be the cause: |
Successful merges:
inlineattribute toNonZero::from_str#163216 (Addinlineattribute toNonZero::from_str)for<…> dyn …don't unconditionally treatdynas a keyword #162340 (When trying to recover fromfor<…> dyn …don't unconditionally treatdynas a keyword)'staticobligations from an fn being called #163115 (Point at'staticobligations from an fn being called)Failed merges:
StashKey::AssociatedTypeSuggestion#162942 (RemoveStashKey::AssociatedTypeSuggestion)r? @ghost
Create a similar rollup