-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 7 pull requests #120861
Rollup of 7 pull requests #120861
Commits on Feb 3, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 0bfcafd - Browse repository at this point
Copy the full SHA 0bfcafdView commit details
Commits on Feb 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 22d582a - Browse repository at this point
Copy the full SHA 22d582aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 548929d - Browse repository at this point
Copy the full SHA 548929dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a63d3f - Browse repository at this point
Copy the full SHA 7a63d3fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7057188 - Browse repository at this point
Copy the full SHA 7057188View commit details -
Configuration menu - View commit details
-
Copy full SHA for f0d002b - Browse repository at this point
Copy the full SHA f0d002bView commit details -
Configuration menu - View commit details
-
Copy full SHA for f3c2483 - Browse repository at this point
Copy the full SHA f3c2483View commit details -
Configuration menu - View commit details
-
Copy full SHA for 14e0dab - Browse repository at this point
Copy the full SHA 14e0dabView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83f3bc4 - Browse repository at this point
Copy the full SHA 83f3bc4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b6b9c5 - Browse repository at this point
Copy the full SHA 8b6b9c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for e59d9b1 - Browse repository at this point
Copy the full SHA e59d9b1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4ef1790 - Browse repository at this point
Copy the full SHA 4ef1790View commit details -
Configuration menu - View commit details
-
Copy full SHA for 69a5264 - Browse repository at this point
Copy the full SHA 69a5264View commit details -
Rollup merge of rust-lang#120584 - compiler-errors:u, r=lcnr
For a rigid projection, recursively look at the self type's item bounds to fix the `associated_type_bounds` feature Given a deeply nested rigid projection like `<<<T as Trait1>::Assoc1 as Trait2>::Assoc2 as Trait3>::Assoc3`, this PR adjusts both trait solvers to look at the item bounds for all of `Assoc3`, `Assoc2`, and `Assoc1` in order to satisfy a goal. We do this because the item bounds for projections may contain relevant bounds for *other* nested projections when the `associated_type_bounds` (ATB) feature is enabled. For example: ```rust #![feature(associated_type_bounds)] trait Trait1 { type Assoc1: Trait2<Assoc2: Foo>; // Item bounds for `Assoc1` are: // `<Self as Trait1>::Assoc1: Trait2` // `<<Self as Trait1>::Assoc1 as Trait2>::Assoc2: Foo` } trait Trait2 { type Assoc2; } trait Foo {} fn hello<T: Trait1>(x: <<T as Trait1>::Assoc1 as Trait2>::Assoc2) { fn is_foo(_: impl Foo) {} is_foo(x); // Currently fails with: // ERROR the trait bound `<<Self as Trait1>::Assoc1 as Trait2>::Assoc2: Foo` is not satisfied } ``` This has been a long-standing place of brokenness for ATBs, and is also part of the reason why ATBs currently desugar so differently in various positions (i.e. sometimes desugaring to param-env bounds, sometimes desugaring to RPITs, etc). For example, in RPIT and TAIT position, `impl Foo<Bar: Baz>` currently desugars to `impl Foo<Bar = impl Baz>` because we do not currently take advantage of these nested item bounds if we desugared them into a single set of item bounds on the opaque. This is obviously both strange and unnecessary if we just take advantage of these bounds as we should. ## Approach This PR repeatedly peels off each projection of a given goal's self type and tries to match its item bounds against a goal, repeating with the self type of the projection. This is pretty straightforward to implement in the new solver, only requiring us to loop on the self type of a rigid projection to discover inner rigid projections, and we also need to introduce an extra probe so we can normalize them. In the old solver, we can do essentially the same thing, however we rely on the fact that projections *should* be normalized already. This is obviously not always the case -- however, in the case that they are not fully normalized, such as a projection which has both infer vars and, we bail out with ambiguity if we hit an infer var for the self type. ## Caveats
⚠️ In the old solver, this has the side-effect of actually stalling some higher-ranked trait goals of the form `for<'a> <?0 as Tr<'a>>: Tr2`. Because we stall them, they no longer are eagerly treated as error -- this cause some existing `known-bug` tests to go from fail -> pass. I'm pretty unconvinced that this is a problem since we make code that we expect to pass in the *new* solver also pass in the *old* solver, though this obviously doesn't solve the *full* problem. ## And then also... We also adjust the desugaring of ATB to always desugar to a regular associated bound, rather than sometimes to an impl Trait **except** for when the ATB is present in a `dyn Trait`. We need to lower `dyn Trait<Assoc: Bar>` to `dyn Trait<Assoc = impl Bar>` because object types need all of their associated types specified. I would also be in favor of splitting out the ATB feature and/or removing support for object types in order to stabilize just the set of positions for which the ATB feature is consistent (i.e. always elaborates to a bound).Configuration menu - View commit details
-
Copy full SHA for ba5161f - Browse repository at this point
Copy the full SHA ba5161fView commit details -
Rollup merge of rust-lang#120589 - devnexen:cpuaff_fbsd_upd, r=m-ou-se
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.
Configuration menu - View commit details
-
Copy full SHA for a4c5094 - Browse repository at this point
Copy the full SHA a4c5094View commit details -
Rollup merge of rust-lang#120596 - GuillaumeGomez:jump-to-def-non-loc…
…al-link, r=notriddle,fmease [rustdoc] Correctly generate path for non-local items in source code pages While browsing some crates using the "jump to def" feature, I realized that a lot of items didn't have a link generated. The reason is because we only cache foreign items if they appear in the documented API. This means that for the others, we need to infer them. r? `@notriddle`
Configuration menu - View commit details
-
Copy full SHA for d7251bb - Browse repository at this point
Copy the full SHA d7251bbView commit details -
Rollup merge of rust-lang#120629 - c410-f3r:testsssssss, r=petrochenkov
Move some test files r? `@petrochenkov`
Configuration menu - View commit details
-
Copy full SHA for 4cfee4b - Browse repository at this point
Copy the full SHA 4cfee4bView commit details -
Rollup merge of rust-lang#120846 - petrochenkov:jobs, r=oli-obk
Update jobserver-rs to 0.1.28 Fixes the issues found in rust-lang#120515 besides the diagnostic wording.
Configuration menu - View commit details
-
Copy full SHA for dadff64 - Browse repository at this point
Copy the full SHA dadff64View commit details -
Rollup merge of rust-lang#120850 - petrochenkov:empimpres, r=cjgillot
ast_lowering: Fix regression in `use ::{}` imports. Fixes rust-lang#120789
Configuration menu - View commit details
-
Copy full SHA for 9e5639e - Browse repository at this point
Copy the full SHA 9e5639eView commit details -
Rollup merge of rust-lang#120853 - blyxyas:no-collect, r=cjgillot
Avoid a collection and iteration on empty passes Just some mini optimization I saw in the wild. This way, we avoid a `collect` and `map` on an empty `passes`. Honestly, I don't even think this is big enough of a change to make a benchmark, but I'd still like to see results. Based on [this book](https://nnethercote.github.io/perf-book/iterators.html#collect-and-extend)
Configuration menu - View commit details
-
Copy full SHA for 0b6980b - Browse repository at this point
Copy the full SHA 0b6980bView commit details