| Age | Commit message (Collapse) | Author | Lines |
|
r=compiler-errors
Tweak wording of missing angle backets in qualified path
|
|
|
|
Implement a global value numbering MIR optimization
The aim of this pass is to avoid repeated computations by reusing past assignments. It is based on an analysis of SSA locals, in order to perform a restricted form of common subexpression elimination.
By opportunity, this pass allows for some simplifications by combining assignments. For instance, this pass could be able to see through projections of aggregates to directly reuse the aggregate field (not in this PR).
We handle references by assigning a different "provenance" index to each `Ref`/`AddressOf` rvalue. This ensure that we do not spuriously merge borrows that should not be merged. Meanwhile, we consider all the derefs of an immutable reference to a freeze type to give the same value:
```rust
_a = *_b // _b is &Freeze
_c = *_b // replaced by _c = _a
```
|
|
Add context to `let: Ty = loop { break };`
We weren't accounting for the case where `break` was immediately within the `loop` block.
|
|
Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser
Add test for `const async fn`
This adds a test for #102796
|
|
Anonymize binders for `refining_impl_trait` check
We're naively using the equality impl for `ty::Clause` in the refinement check, which is okay *except* for binders, which carry some information about where they come from in the AST. Those locations are not gonna be equal between traits and impls, so anonymize those clauses so that this doesn't matter.
Fixes #116135
|
|
Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things
Some groundwork for being able to work on https://github.com/rust-lang/project-stable-mir/issues/27 at all
r? `@spastorino`
|
|
Don't store lazyness in `DefKind::TyAlias`
1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query.
2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase.
r? `@oli-obk` cc `@fmease`
|
|
Only prevent field projections into opaque types, not types containing opaque types
fixes https://github.com/rust-lang/rust/issues/115778
I did not think that original condition through properly... I'll also need to check the similar check around the other `ProjectionKind::OpaqueCast` creation site (this one is in hir, the other one is in mir), but I'll do that change in another PR that doesn't go into a beta backport.
|
|
We weren't accounting for the case where `break` was immediately within
the `loop` block.
|
|
fix tidy
remove dir
|
|
|
|
Rollup of 5 pull requests
Successful merges:
- #116099 (Add regression test for issue #79865)
- #116131 (Rename `cold_path` to `outline`)
- #116151 (Fix typo in rustdoc unstable features doc)
- #116153 (Update books)
- #116162 (Gate and validate `#[rustc_safe_intrinsic]`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=Nilstrieb
Gate and validate `#[rustc_safe_intrinsic]`
Copied over from #116159:
> This was added as ungated in https://github.com/rust-lang/rust/pull/100719/files#diff-09c366d3ad3ec9a42125253b610ca83cad6b156aa2a723f6c7e83eddef7b1e8fR502, probably because the author looked at the surrounding attributes, which are ungated because they are gated specially behind the staged_api feature.
>
> I don't think we need to crater this, the attribute is entirely useless without the intrinsics feature, which is already unstable..
r? ``@Nilstrieb``
|
|
Add regression test for issue #79865
Closes https://github.com/rust-lang/rust/issues/79865
|
|
lint towards rejecting consts in patterns that do not implement PartialEq
I think we definitely don't want to allow such consts, so even while the general plan around structural matching is up in the air, we can start the process of getting non-PartialEq matches out of the ecosystem.
|
|
ConstParamTy: require Eq as supertrait
As discussed with `@BoxyUwu` [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/.60ConstParamTy.60.20and.20.60Eq.60).
We want to say that valtree equality on const generic params agrees with `==`, but that only makes sense if `==` actually exists, hence we should have an appropriate bound. Valtree equality is an equivalence relation, so such a type can always be `Eq` and not just `PartialEq`.
|
|
r=compiler-errors
Properly print cstr literals in `proc_macro::Literal::to_string`
Previously we printed the contents of the string, rather than the actual string literal (e.g. `the c string` instead of `c"the c string"`).
Fixes #112820
cc #105723
|
|
|
|
Use placeholders to prevent using inferred RPITIT types to imply their own well-formedness
The issue here is that we use the same signature to do RPITIT inference as we do to compute implied bounds. To fix this, when gathering the assumed wf types for the method, we replace all of the infer vars (that will be eventually used to infer RPITIT types) with type placeholders, which imply nothing about lifetime bounds.
This solution kind of sucks, but I'm not certain there's another feasible way to fix this. If anyone has a better solution, I'd be glad to hear it.
My naive first solution was, instead of using placeholders, to replace the signature with the RPITIT projections that it originally started out with. But turns out that we can't just use the unnormalized signature of the trait method in `implied_outlives_bounds` since we normalize during WF computation -- that would cause a query cycle in `collect_return_position_impl_trait_in_trait_tys`.
idk who to request review...
r? `@lcnr` or `@aliemjay` i guess.
Fixes #116060
|
|
Point at more causes of expectation of break value when possible
Follow up to #116071.
r? `@compiler-errors`
Disregard the first commit, which is in the other PR.
|
|
|
|
rustdoc: correctly render the return type of cross-crate async fns
Fixes #115760.
|
|
|
|
|
|
|
|
opaque types
|
|
|
|
lenko-d:dont_ICE_when_no_bound_vars_for_lifetime_binders, r=compiler-errors
Don't ICE when no bound vars found while doing closure hir type check
The problem was that we were not visiting the const generic default argument in a bound where predicate when the HIR gets traversed in hir_analysis -> collect -> resolve_bound_vars.
Fixes [112574](https://github.com/rust-lang/rust/issues/112574)
|
|
|
|
|
|
usage of forever unstable things
|
|
|
|
|
|
r=Mark-Simulacrum
Add assembly test to make sure that inlining works as expected when closures inherit target features
Closes https://github.com/rust-lang/rust/issues/108338 (the added test proves that it is working correctly)
|
|
on no bound vars.
|
|
Remove dead diagnostic code for generators
This code has become unreachable with #107421.
|
|
|
|
|
|
Add regression test for #102467
Fixes #102467.
r? `@compiler-errors`
|
|
inherit target features
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Do not create a DerefLen place for `Box<[T]>`.
Fixes https://github.com/rust-lang/rust/issues/115789
|
|
Raise minimum supported Apple OS versions
This implements the proposal to raise the minimum supported Apple OS versions as laid out in the now-completed MCP (https://github.com/rust-lang/compiler-team/issues/556).
As of this PR, rustc and the stdlib now support these versions as the baseline:
- macOS: 10.12 Sierra
- iOS: 10
- tvOS: 10
- watchOS: 5 (Unchanged)
In addition to everything this breaks indirectly, these changes also erase the `armv7-apple-ios` target (currently tier 3) because the oldest supported iOS device now uses ARMv7s. Not sure what the policy around tier3 target removal is but shimming it is not an option due to the linker refusing.
[Per comment](https://github.com/rust-lang/compiler-team/issues/556#issuecomment-1297175073), this requires a FCP to merge. cc `@wesleywiser.`
|