about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-05-16Auto merge of #111556 - cjgillot:copy-prop-nrvo, r=oli-obkbors-198/+567
Merge return place with other locals in CopyProp. This reintroduces a limited form of NRVO. r? wg-mir-opt
2023-05-16Rollup merge of #111642 - GuillaumeGomez:only-impl-from-bodies, r=notriddleMatthias Krüger-0/+36
[rustdoc] Only keep impl blocks from bodies Fixes https://github.com/rust-lang/rust/issues/111415. The problem was that we kept everything inside bodies whereas only impl blocks are actually accessible from outside bodies. r? `@notriddle`
2023-05-16Rollup merge of #111610 - bvanjoi:fix-99597, r=compiler-errorsMatthias Krüger-0/+30
fix(diagnostic): wrap parens for ref impl trait param Fixes https://github.com/rust-lang/rust/issues/99597 When parameters are an `impl_trait` which it needed to add trait, and it is a reference, add parentheses to the type of the parameter in the suggestion
2023-05-16Rollup merge of #111573 - compiler-errors:erase-re-error, r=WaffleLapkinMatthias Krüger-0/+47
Erase `ReError` properly Fixes #111341 Since we check whether a type has free regions before erasing (to short circuit unnecesary folding), we need to consider `ReError` as a free region, or else we'll skip it when erasing a type that only mentions `ReError`. cc `@nnethercote`
2023-05-16Rollup merge of #111533 - clubby789:drop-tracking-error, r=oli-obkMatthias Krüger-0/+35
Handle error body in generator layout Fixes #111468 I feel like making this query return `Option<GeneratorLayout>` might be better but had some issues with that approach
2023-05-16Use error term if missing associated item in new solverMichael Goulet-1/+15
2023-05-16Auto merge of #105750 - oli-obk:valtrees, r=lcnrbors-40/+53
Always fall back to PartialEq when a constant in a pattern is not recursively structural-eq Right now we destructure the constant as far as we can, but with this PR we just don't take it apart anymore. This is preparatory work for moving to always using valtrees, as these will just do a single conversion of the constant to a valtree at the start, and if that fails, fall back to `PartialEq`. This removes a few cases where we emitted the `unreachable pattern` lint, because we stop looking into the constant deeply enough to detect that a constant is already covered by another pattern. Previous work: https://github.com/rust-lang/rust/pull/70743 This is groundwork towards fixing https://github.com/rust-lang/rust/issues/83085 and https://github.com/rust-lang/rust/issues/105047
2023-05-16Add regression test for #111415Guillaume Gomez-0/+36
2023-05-16Rollup merge of #111614 - aDotInTheVoid:nonsense, r=cjgillotNilstrieb-0/+30
Add more interesting nonsense to weird-exprs.rs Some cursed things rust allows that I've ran into. [The second is taken from here](https://twitter.com/Lucretiel/status/1638929955751964679)
2023-05-16Rollup merge of #111602 - tmiasko:erroneous-constant-used, r=oli-obkNilstrieb-220/+15
Suppress "erroneous constant used" for constants tainted by errors When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not. Fixes #110891.
2023-05-16Rollup merge of #111449 - compiler-errors:recover-impl-generics-correctly, ↵Nilstrieb-0/+14
r=Nilstrieb Recover `impl<T ?Sized>` correctly Fixes #111327 r? ````@Nilstrieb```` but you can re-roll Alternatively, happy to close this if we're okay with just saying "sorry #111327 is just a poor side-effect of parser ambiguity" 🤷
2023-05-16Rollup merge of #111428 - bvanjoi:fix-109250, r=NilstriebNilstrieb-25/+65
refactor(resolve): clean up the early error return caused by non-call closes https://github.com/rust-lang/rust/issues/109250 It seems no bad happened, r? ``@Nilstrieb``
2023-05-16fix(diagnostic): wrap parens for ref impl trait parambohan-0/+30
2023-05-15Auto merge of #111221 - compiler-errors:yeet-generalizer, r=lcnrbors-0/+45
Combine three generalizer implementations Fixes #111092 Fixes #109505 This code is a bit delicate and there were subtle changes between them, so I'll leave inline comments where further inspection is needed. Regarding this comment from #109813 -- "add tests triggering all codepaths: at least the combine and the const generalizer", can't really do that now, and I don't really know how we'd get a higher-ranked const error since non-lifetime binders doesn't *really* support `for<const ..>` (it errors out when you try to use it). r? `@lcnr`
2023-05-15Add more interesting nonsense to weird-exprs.rsAlona Enraght-Moony-0/+30
2023-05-15Recover `impl<T ?Sized>` correctlyMichael Goulet-0/+14
2023-05-15Tweaks and a testMichael Goulet-0/+45
2023-05-15Rollup merge of #111587 - cbeuw:copy-for-deref, r=oli-obkMatthias Krüger-11/+34
Custom MIR: Support `Rvalue::CopyForDeref` r? `@oli-obk` or `@tmiasko` or `@JakobDegen`
2023-05-15Rollup merge of #111578 - Zoxc:query-macro-move, r=cjgillotMatthias Krüger-2/+2
Move expansion of query macros in rustc_middle to rustc_middle::query This moves the expansion of `define_callbacks!` and `define_feedable!` from `rustc_middle::ty::query` to `rustc_middle::query`. This means that types used in queries are both imported and used in `rustc_middle::query` instead of being split between these modules. It also decouples `rustc_middle::ty::query` further from `rustc_middle` which is helpful since we want to move `rustc_middle::ty::query` to the query system crates.
2023-05-15Rollup merge of #111525 - scottmcm:slice-position-tweak, r=Mark-SimulacrumMatthias Krüger-7/+27
Stop checking for the absence of something that doesn't exist A couple of codegen tests are doing ``` // CHECK-NOT: slice_index_len_fail ``` However, that function no longer exists: [the only places](https://github.com/search?q=repo%3Arust-lang%2Frust+slice_index_len_fail&type=code) it occurs in the repo are in those tests. So this PR updates the tests to check for the absense of the functions that are actually used today to panic for out-of-bounds indexing.
2023-05-15Always fall back to PartialEq when a constant in a pattern is not ↵Oli Scherer-40/+53
recursively structural-eq
2023-05-15Address FIXMEAndy Wang-11/+6
2023-05-15Add CopyForDeref to custom MIRAndy Wang-0/+28
2023-05-15Rollup merge of #111531 - chenyukang:yukang-fix-111416-ice, r=compiler-errorsMatthias Krüger-0/+21
Fix ice caused by shorthand fields in NoFieldsForFnCall Fixes #111416
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-2/+2
2023-05-15Suppress "erroneous constant used" for constants tainted by errorsTomasz Miąsko-220/+15
When constant evaluation fails because its MIR is tainted by errors, suppress note indicating that erroneous constant was used, since those errors have to be fixed regardless of the constant being used or not.
2023-05-14Erase ReError properlyMichael Goulet-0/+47
2023-05-14Shorten lifetime of panic temporaries in panic_fmt caseDavid Tolnay-38/+11
2023-05-14Add ui test to reproduce non-Send panic temporaryDavid Tolnay-0/+46
2023-05-14Merge return place with other locals in CopyProp.Camille GILLOT-198/+567
2023-05-14Auto merge of #111517 - lukas-code:addr-of-mutate, r=tmiaskobors-0/+34
allow mutating function args through `&raw const` Fixes https://github.com/rust-lang/rust/issues/111502 by "turning off the sketchy optimization while we figure out if this is ok", like `@JakobDegen` said. The first commit in this PR removes some suspicious looking logic from the same method, but should have no functional changes, since it doesn't modify the `context` outside of the method. Best reviewed commit by commit. r? opsem
2023-05-14Auto merge of #111552 - matthiaskrgr:rollup-4nidoti, r=matthiaskrgrbors-92/+253
Rollup of 4 pull requests Successful merges: - #111463 (Better diagnostics for `env!` where variable contains escape) - #111477 (better diagnostics for `impl<..> impl Trait for Type`) - #111534 (rustdoc-json: Add tests for `#![feature(inherent_associated_types)]`) - #111549 ([rustdoc] Convert more GUI tests colors to their original format) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-05-14Rollup merge of #111549 - GuillaumeGomez:update-gui-format, r=notriddleMatthias Krüger-86/+86
[rustdoc] Convert more GUI tests colors to their original format Follow-up of https://github.com/rust-lang/rust/pull/111459. The update for the `browser-ui-test` version is about improvements for color handling (alpha for hex format in particular). r? `@notriddle`
2023-05-14Rollup merge of #111534 - aDotInTheVoid:ita-rdj, r=fmease,GuillaumeGomezMatthias Krüger-0/+83
rustdoc-json: Add tests for `#![feature(inherent_associated_types)]` Follow up to #109410, CC `@fmease` r? `@GuillaumeGomez`
2023-05-14Rollup merge of #111477 - y21:extra-impl-in-trait-impl, r=compiler-errorsMatthias Krüger-0/+64
better diagnostics for `impl<..> impl Trait for Type` Fixes #109963
2023-05-14Rollup merge of #111463 - clubby789:env-escaped-var, r=cjgillotMatthias Krüger-6/+20
Better diagnostics for `env!` where variable contains escape Fixes #110559
2023-05-14Auto merge of #111440 - cjgillot:refprop-debuginfo, r=oli-obkbors-584/+1356
Allow MIR debuginfo to point to a variable's address MIR optimizations currently do not to operate on borrowed locals. When enabling #106285, many borrows will be left as-is because they are used in debuginfo. This pass allows to replace this pattern directly in MIR debuginfo: ```rust a => _1 _1 = &raw? mut? _2 ``` becomes ```rust a => &_2 // No statement to borrow _2. ``` This pass is implemented as a drive-by in ReferencePropagation MIR pass. This transformation allows following following MIR opts to treat _2 as an unborrowed local, and optimize it as such, even in builds with debuginfo. In codegen, when encountering `a => &..&_2`, we create a list of allocas: ```llvm store ptr %_2.dbg.spill, ptr %a.ref0.dbg.spill store ptr %a.ref0.dbg.spill, ptr %a.ref1.dbg.spill ... call void `@llvm.dbg.declare(metadata` ptr %a.ref{n}.dbg.spill, /* ... */) ``` Caveat: this transformation looses the exact type, we do not differentiate `a` as a immutable, mutable reference or a raw pointer. Everything is declared to `*mut` to codegen. I'm not convinced this is a blocker.
2023-05-14Auto merge of #111425 - Bryanskiy:privacy_ef, r=petrochenkovbors-0/+53
Populate effective visibilities in `rustc_privacy` (take 2) Same as https://github.com/rust-lang/rust/pull/110907 + regressions fixes. Fixes https://github.com/rust-lang/rust/issues/111359. r? `@petrochenkov`
2023-05-14Convert more GUI tests colors to their original formatGuillaume Gomez-86/+86
2023-05-13Auto merge of #111363 - asquared31415:tidy_no_random_ui_tests, r=fee1-deadbors-38/+48
Add a tidy check to find unexpected files in UI tests, and clean up the results While looking at UI tests, I noticed several weird files that were not being tested, some from even pre-1.0. I added a tidy check that fails if any files not known to compiletest or not used in tests (via manual list) are present in the ui tests. Unfortunately the root entry limit had to be raised by 1 to accommodate the stderr file for one of the tests. r? `@fee1-dead`
2023-05-13Auto merge of #111374 - tmiasko:align-unsized-locals, r=cjgillotbors-0/+30
Align unsized locals Allocate an extra space for unsized locals and manually align the storage, since alloca doesn't support dynamic alignment. Fixes #71416. Fixes #71695.
2023-05-13Handle error body when in generator layoutclubby789-0/+35
2023-05-13rustdoc-json: Add tests for `#![feature(inherent_associated_types)]`Alona Enraght-Moony-0/+83
2023-05-13fmtyukang-2/+1
2023-05-13Add multiple borrow test.Camille GILLOT-55/+89
2023-05-13Do not ICE on deeply nested borrows.Camille GILLOT-0/+13
2023-05-13Iterate ReferencePropagation to fixpoint.Camille GILLOT-398/+797
2023-05-13Add mir-opt test.Camille GILLOT-0/+173
2023-05-13Add debuginfo test.Camille GILLOT-0/+165
2023-05-13Support ConstantIndex in debuginfo.Camille GILLOT-12/+3