about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-06-05Auto merge of #110945 - wackbyte:doc-vis-on-inherent-assoc-types, r=jshabors-1/+26
rustdoc: render visibility on associated types This should only affect inherent associated types (#8995).
2023-06-05Auto merge of #112272 - jieyouxu:issue-112269, r=compiler-errorsbors-0/+40
Show note for type ascription on a local binding interpreted as a constant pattern and not a new variable Given the code ```rust pub fn main() { const y: i32 = 4; let y: i32 = 3; } ``` `y` in the let binding is actually interpreted as a constant pattern and is not a new variable, causing confusing diagnostics about refutable patterns in local binding. This PR extends the note for type ascription of a constant pattern to `AscribeUserType` patterns which have `Constant` subpatterns. Fixes #112269.
2023-06-04Auto merge of #112266 - Swatinem:fix-async-block-inference, r=compiler-errorsbors-0/+55
Fix type-inference regression in #112225 The type inference of argument-position closures and async blocks regressed in 1.70 as the evaluation order of async blocks changed, as they are not implicitly wrapped in an identity-function anymore. Fixes #112225 by making sure the evaluation order stays the same as it used to. r? `@compiler-errors` As this was a stable-to-stable regression, it might be worth to consider backporting. Although the workaround for this is trivial as well: Just wrap the async block in another block.
2023-06-04Rollup merge of #112274 - GuillaumeGomez:migrate-gui-test-color-11, r=notriddleMatthias Krüger-6/+6
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. The update for `browser-ui-test` version is because for hex color conversions, it used a precision of 1 instead of 2, which was problematic. r? `@notriddle`
2023-06-04Migrate GUI colors test to original CSS color formatGuillaume Gomez-6/+6
2023-06-04Show note for type ascription interpreted as a constant pattern, not a new ↵许杰友 Jieyou Xu (Joe)-0/+40
variable Given the code ```rust pub fn main() { const y: i32 = 4; let y: i32 = 3; } ``` `y` in the let binding is actually interpreted as a constant pattern and is not a new variable, causing confusing diagnostics about refutable patterns in local binding. This commit extends the note for type ascription as a constant pattern to `AscribeUserType` patterns as well.
2023-06-04Rollup merge of #112178 - GuillaumeGomez:fix-inline-private-intermediate, ↵Matthias Krüger-2/+25
r=notriddle Fix bug where private item with intermediate doc hidden re-export was not inlined This fixes this bug: ```rust mod private { /// Original. pub struct Bar3; } /// Hidden. #[doc(hidden)] pub use crate::private::Bar3; /// Visible. pub use self::Bar3 as Reexport; ``` In this case, `private::Bar3` should be inlined and renamed `Reexport` but instead we have: ``` pub use self::Bar3 as Reexport; ``` and no links. There were actually two issues: the first one is that we forgot to check if the next intermediate re-export was doc hidden. The second was that we made the `#[doc(hidden)]` attribute inheritable, which shouldn't be possible. r? `@notriddle`
2023-06-04Fix type-inference regression in #112225Arpad Borsos-0/+55
The type inference of argument-position closures and async blocks regressed in 1.70 as the evaluation order of async blocks changed, as they are not implicitly wrapped in an identity-function anymore. Fixes #112225 by making sure the evaluation order stays the same as it used to.
2023-06-04Auto merge of #112240 - cjgillot:recurse-inline, r=scottmcmbors-265/+386
Only check inlining counter after recursing. This PR aims to reduce the strength of https://github.com/rust-lang/rust/pull/105119 even more. In the current implementation, we check the inline count before recursing. This means that we never actually reach inlining depth 3. This PR checks the counter after recursion, to give a chance to inline at depth >= 3. r? `@scottmcm` cc `@JakobDegen`
2023-06-03Rollup merge of #112215 - compiler-errors:check-sized-better, r=cjgillotMatthias Krüger-0/+62
only suppress coercion error if type is definitely unsized we previously suppressed coercion errors when the return type was `dyn Trait` because we expect a far more descriptive `Sized` trait error to be emitted instead, however the code that does this suppression does not consider where-clause predicates since it just looked at the HIR. let's do that instead by creating an obligation and checking if it may hold. fixes #110683 fixes #112208
2023-06-03Rollup merge of #111878 - ferrocene:pa-codegen-tests, r=Mark-SimulacrumMatthias Krüger-55/+64
Fix codegen test suite for bare-metal-like targets For Ferrocene I needed to run the test suite for custom target with no unwinding and static relocation. Running the tests uncovered ~20 failures due to the test suite not accounting for these options. This PR fixes them by: * Fixing `CHECK`s to account for functions having extra LLVM IR attributes (in this case `nounwind`). * Fixing `CHECK`s to account for the `dso_local` LLVM IR modifier, which is [added to every item when relocation is static](https://github.com/rust-lang/rust/blob/f3d597b31c0f101a02c230798afa31a36bdacbc6/compiler/rustc_codegen_llvm/src/mono_item.rs#L139-L142). * Fixing `CHECK`s to account for missing `uwtables` attributes. * Added the `needs-unwind` attributes for tests that are designed to check unwinding. There is no part of Rust CI that checks this unfortunately, and testing whether the PR works locally is kinda hard because you need a target with std enabled but no unwinding and static relocations. Still, this works in my local testing, and if future PRs accidentally break this Ferrocene will take care of sending followup PRs.
2023-06-03Rollup merge of #111659 - y21:suggest-as-deref, r=cjgillotMatthias Krüger-0/+259
suggest `Option::as_deref(_mut)` on type mismatch in option combinator if it passes typeck Fixes #106342. This adds a suggestion to call `.as_deref()` (or `.as_deref_mut()` resp.) if typeck fails due to a type mismatch in the function passed to an `Option` combinator such as `.map()` or `.and_then()`. For example: ```rs fn foo(_: &str) {} Some(String::new()).map(foo); ``` The `.map()` method requires its argument to satisfy `F: FnOnce(String)`, but it received `fn(&str)`, which won't pass. However, placing a `.as_deref()` before the `.map()` call fixes this since `&str == &<String as Deref>::Target`
2023-06-03Update reexport-attr-merge rustdoc testGuillaume Gomez-2/+2
2023-06-03Only check inlining counter after recusing.Camille GILLOT-265/+386
2023-06-03Auto merge of #111516 - compiler-errors:issue-111500, r=jackh726bors-2/+44
Don't use `can_eq` in `derive(..)` suggestion for missing method Unsatisfied predicates returned from method probe may reference inference vars from that probe, so drop this extra check I added in #110877 for more accurate derive suggestions... Fixes #111500
2023-06-03Auto merge of #111350 - chenyukang:yukang-remove-type-asc, r=Nilstriebbors-2/+2
Remove leftover of type ascription feature gating Fixes #111325 r? `@Nilstrieb`
2023-06-03remove type ascription feature gateyukang-2/+2
2023-06-02Rollup merge of #112223 - compiler-errors:new-solver-auto-proj, r=BoxyUwUMichael Goulet-1/+15
Don't ICE in new solver when auto traits have associated types People can write malformed auto traits, and that shouldn't cause the new solver to ICE
2023-06-02Rollup merge of #112183 - compiler-errors:new-solver-anon-ct, r=BoxyUwUMichael Goulet-24/+50
Normalize anon consts in new solver We don't do any of that `expand_abstract_consts` stuff so this isn't sufficient to make GCE work, but it does allow, e.g. `[(); 1]: Default`, to solve. r? `@BoxyUwU`
2023-06-02Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obkMichael Goulet-29/+95
Lower `unchecked_div`/`_rem` to MIR's `BinOp::Div`/`Rem` As described in <https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/enum.BinOp.html#variant.Div>, the ordinary `BinOp`s for these are already UB for division by zero ([or overflow](https://llvm.org/docs/LangRef.html#sdiv-instruction), [demo](https://rust.godbolt.org/z/71e7P7Exh)), as MIR building is responsible for inserting code to panic for those cases regardless of whether the overflow checks are enabled. So we can lower these in the same arm that lowers `wrapping_add` to MIR `BinOp::Add` and such, as all these cases turn into ordinary `Rvalue::BinaryOp`s.
2023-06-02Normalize anon consts in new solverMichael Goulet-24/+50
2023-06-02Don't ICE in new solver when auto traits have associated typesMichael Goulet-1/+15
2023-06-02only suppress coercion error if type is definitely unsizedMichael Goulet-0/+62
2023-06-02Rollup merge of #112205 - GuillaumeGomez:double-hyphen-to-dash, r=notriddleMatthias Krüger-0/+9
Add rustdoc test for double-hyphen to dash doc comment conversion Fixes https://github.com/rust-lang/rust/issues/64081. This PR adds a regression test for #64081 so the issue can be closed. r? `@notriddle`
2023-06-02Rollup merge of #112182 - rcvalle:rust-cfi-fix-111185, r=compiler-errorsMatthias Krüger-3/+3
CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj Fixes https://github.com/rust-lang/rust/issues/111185 by normalizing ty::Alias before encoding.
2023-06-02Add rustdoc test for double-hyphen to dash doc comment conversionGuillaume Gomez-0/+9
2023-06-02Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errorsbors-142/+416
Rollup of 7 pull requests Successful merges: - #111670 (Require that const param tys implement `ConstParamTy`) - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - #112030 (Migrate `item_trait_alias` to Askama) - #112150 (Support 128-bit atomics on all x86_64 Apple targets) - #112174 (Fix broken link) - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - #112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - #112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-01Rollup merge of #112193 - clubby789:offset-of-tuple-sized, r=est31Michael Goulet-6/+65
Check tuple elements are `Sized` in `offset_of` Fixes #112186
2023-06-01Rollup merge of #111914 - rcvalle:rust-cfi-fix-111184, r=compiler-errorsMichael Goulet-0/+17
CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi… Fixes https://github.com/rust-lang/rust/issues/111184 by encoding ty::Generator parent substs only.
2023-06-01Rollup merge of #111670 - compiler-errors:const-param-ty, r=BoxyUwUMichael Goulet-136/+334
Require that const param tys implement `ConstParamTy` 1. Require that const param tys implement `ConstParamTy` instead of using `search_for_adt_const_param_violation` 2. Add `StructuralPartialEq` as a supertrait for `ConstParamTy`, since we need to make sure that we derive *both* `PartialEq` and `Eq` 3. Implement `ConstParamTy` for tuples up to 12 (or whatever the default for tuples is) 4. Add some custom diagnostics to `ConstParamTy` errors, to avoid regressions from (1.). It's still not as great as it could be -- will point out inline in comments. r? `@BoxyUwU`
2023-06-02Auto merge of #111677 - fee1-dead-contrib:rustc_const_eval-translatable, ↵bors-96/+104
r=oli-obk,RalfJung Use translatable diagnostics in `rustc_const_eval` This PR: * adds a `no_span` parameter to `note` / `help` attributes when using `Subdiagnostic` to allow adding notes/helps without using a span * has minor tweaks and changes to error messages
2023-06-02Auto merge of #111553 - cjgillot:mir-e2e, r=scottmcmbors-1082/+1762
Add a few MIR pre-codegen tests r? `@scottmcm`
2023-06-02Test invalid tuple field identifiersclubby789-0/+47
2023-06-02Check tuple elements are `Sized` in `offset_of`clubby789-6/+18
2023-06-01CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(BindeRamon de C Valle-0/+17
Fixes #111184 by encoding ty::Generator parent substs only.
2023-06-01Rebase fallout.Camille GILLOT-272/+334
2023-06-01Remove brittle test.Camille GILLOT-46/+0
2023-06-01Restrict test to x64.Camille GILLOT-3/+4
2023-06-01Annotate needs-unwind.Camille GILLOT-17/+19
2023-06-01Remove duplication.Camille GILLOT-1406/+541
2023-06-01Remove spurious comments.Camille GILLOT-3/+0
2023-06-01Add chained comparison e2e test.Camille GILLOT-0/+400
2023-06-01Add e2e mir test for checked arithmetic.Camille GILLOT-0/+285
2023-06-01Add loop tests.Camille GILLOT-0/+1585
2023-06-01Make slice_filter a pre-codegen test.Camille GILLOT-1082/+341
2023-06-01Rollup merge of #112147 - zirconium-n:issue-110934, r=compiler-errorsMatthias Krüger-0/+11
add inline-const test for elided lifetimes being infer vars Fixes #110934
2023-06-01Rollup merge of #112133 - GuillaumeGomez:migrate-gui-test-color-10, r=notriddleMatthias Krüger-3/+3
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? ```@notriddle```
2023-06-01CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(ProjRamon de C Valle-3/+3
Fixes #111185 by normalizing ty::Alias before encoding.
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-133/+316
2023-06-01Impl ConstParamTy for tuples, make PartialStructuralEq a supertrait tooMichael Goulet-3/+18