about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-09-28Rollup merge of #116215 - estebank:parse-type-angle-bracket-tweak, ↵Matthias Krüger-25/+147
r=compiler-errors Tweak wording of missing angle backets in qualified path
2023-09-28Tweak wording of missing angle backets in qualified pathEsteban Küber-25/+147
2023-09-27Auto merge of #109597 - cjgillot:gvn, r=oli-obkbors-16/+6609
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 ```
2023-09-27Rollup merge of #116187 - estebank:small-tweak, r=compiler-errorsMatthias Krüger-5/+22
Add context to `let: Ty = loop { break };` We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-27Rollup merge of #116178 - ↵Matthias Krüger-0/+18
Milo123459:milo/add-test-for-const-async-function-in-main, r=wesleywiser Add test for `const async fn` This adds a test for #102796
2023-09-27Rollup merge of #116149 - compiler-errors:anonymize, r=lcnrMatthias Krüger-0/+13
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
2023-09-27Rollup merge of #115934 - oli-obk:smir_identity, r=spastorinoMatthias Krüger-17/+16
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`
2023-09-27Auto merge of #116163 - compiler-errors:lazyness, r=oli-obkbors-62/+1
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`
2023-09-27Auto merge of #116156 - oli-obk:opaque_place_unwrap, r=compiler-errorsbors-0/+36
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.
2023-09-26Add context to `let: Ty = loop { break };`Esteban Küber-5/+22
We weren't accounting for the case where `break` was immediately within the `loop` block.
2023-09-26add testMilo-0/+18
fix tidy remove dir
2023-09-26Anonymize binders for refining_impl_trait checkMichael Goulet-0/+13
2023-09-26Auto merge of #116175 - matthiaskrgr:rollup-cwteiwy, r=matthiaskrgrbors-6/+70
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
2023-09-26Rollup merge of #116162 - fmease:gate-n-validate-rustc_safe_intrinsic, ↵Matthias Krüger-6/+32
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``
2023-09-26Rollup merge of #116099 - eduardosm:issue-79865-regression, r=oli-obkMatthias Krüger-0/+38
Add regression test for issue #79865 Closes https://github.com/rust-lang/rust/issues/79865
2023-09-26Auto merge of #115893 - RalfJung:match-require-partial-eq, r=oli-obkbors-2/+50
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.
2023-09-26Auto merge of #116125 - RalfJung:const-param-ty-eq, r=compiler-errorsbors-3/+34
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`.
2023-09-26Auto merge of #116124 - WaffleLapkin:fix-proc-macro-literal-to-string, ↵bors-0/+149
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
2023-09-26Don't store lazyness in DefKindMichael Goulet-62/+1
2023-09-26Auto merge of #116072 - compiler-errors:rpitit-implied-bounds, r=aliemjaybors-0/+81
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
2023-09-26Auto merge of #116080 - estebank:issue-115905-2, r=compiler-errorsbors-37/+231
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.
2023-09-25Use verbose suggestion for `break` without valueEsteban Küber-48/+72
2023-09-25Auto merge of #116084 - fmease:rustdoc-fix-x-crate-async-fn, r=GuillaumeGomezbors-14/+37
rustdoc: correctly render the return type of cross-crate async fns Fixes #115760.
2023-09-25Handle all arbitrary `loop` nesting in `break` type errorsEsteban Küber-3/+115
2023-09-25Gate and validate #[rustc_safe_intrinsic]León Orell Valerian Liehr-6/+32
2023-09-25Account for more cases of nested `loop`s for `break` type mismatchesEsteban Küber-8/+54
2023-09-25Only prevent field projections into opaque types, not types containing ↵Oli Scherer-0/+36
opaque types
2023-09-25rename lint; add tracking issueRalf Jung-8/+8
2023-09-25Auto merge of #113396 - ↵bors-0/+38
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)
2023-09-25Handle yet another case of `break` type mismatchEsteban Küber-1/+4
2023-09-25Point at previous breaks that have the expected typeEsteban Küber-1/+10
2023-09-25Split out the stable part of smir into its own crate to prevent accidental ↵Oli Scherer-5/+6
usage of forever unstable things
2023-09-25Fix test by adding a stable way to get an opaque DefKindOli Scherer-12/+10
2023-09-25rustdoc: correctly render ret ty of cross-crate async fnsLeón Orell Valerian Liehr-14/+37
2023-09-25Auto merge of #116078 - eduardosm:closure-inherit-target-feature, ↵bors-0/+58
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)
2023-09-24Added additional visit steps to visit_generic_param() in order to avoid ICE ↵Lenko Donchev-0/+38
on no bound vars.
2023-09-24Auto merge of #116117 - cjgillot:drop-tracking-mir-noscope, r=compiler-errorsbors-15/+15
Remove dead diagnostic code for generators This code has become unreachable with #107421.
2023-09-24ConstParamTy: require EqRalf Jung-3/+34
2023-09-24Add a test for printing literals via `proc-macro`Maybe Waffle-0/+149
2023-09-24Auto merge of #116120 - GuillaumeGomez:regression-102467, r=compiler-errorsbors-0/+24
Add regression test for #102467 Fixes #102467. r? `@compiler-errors`
2023-09-24Add assembly test to make sure that inlining works as expected when closures ↵Eduardo Sánchez Muñoz-0/+58
inherit target features
2023-09-24work towards rejecting consts in patterns that do not implement PartialEqRalf Jung-2/+50
2023-09-24Add regression test for #102467Guillaume Gomez-0/+24
2023-09-24Remove span from BrAnon.Camille GILLOT-15/+15
2023-09-24Do not clone valtree and slice constants.Camille GILLOT-0/+574
2023-09-24Embed simplification into VnState.Camille GILLOT-24/+24
2023-09-24Do not check copiability.Camille GILLOT-18/+20
2023-09-24Add global value numbering pass.Camille GILLOT-23/+6040
2023-09-24Auto merge of #115794 - cjgillot:aggregate-no-box, r=davidtwcobors-0/+953
Do not create a DerefLen place for `Box<[T]>`. Fixes https://github.com/rust-lang/rust/issues/115789
2023-09-24Auto merge of #104385 - BlackHoleFox:apple-minimum-bumps, r=petrochenkovbors-8/+8
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.`