summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-12-12bless testPietro Albini-3/+2
2022-12-11fix test errouz-a-3/+4
2022-12-11re-add test and blessouz-a-1/+31
2022-12-11revert-overflowouz-a-39/+8
2022-12-11Bump the const eval step limitOli Scherer-4/+4
2022-11-20Add testMichael Goulet-0/+47
2022-11-15Don't silently eat label before block in block-like exprMichael Goulet-0/+219
2022-11-15Use `nominal_obligations_without_const` in wf for FnDefDeadbeef-0/+5
2022-10-29Auto merge of #103450 - cjgillot:elision-nodedup, r=Mark-Simulacrumbors-1/+19
Do not consider repeated lifetime params for elision. Fixes https://github.com/rust-lang/rust/issues/103330
2022-10-29Rollup merge of #103699 - compiler-errors:dyn-star-cast-bad, r=TaKO8KiGuillaume Gomez-0/+58
Emit proper error when casting to `dyn*` Fixes #103679
2022-10-29Rollup merge of #103704 - xxchan:xxchan/applicable-bug, r=compiler-errorsMatthias Krüger-0/+37
Add a test for TAIT used with impl/dyn Trait inside RPIT close https://github.com/rust-lang/rust/issues/101750
2022-10-29Rollup merge of #103383 - compiler-errors:tait-scope, r=oli-obkMatthias Krüger-4/+4
Note scope of TAIT more accurately This maybe explains why the person was confused in #101897, since we say "same module" but really should've said "same impl". r? ``@oli-obk``
2022-10-29Rollup merge of #103342 - Rageking8:add-test-for-issue-98634, r=compiler-errorsMatthias Krüger-0/+110
Add test for issue 98634 Fixes #98634
2022-10-29Auto merge of #102233 - petrochenkov:effvis, r=jackh726bors-209/+209
privacy: Rename "accessibility levels" to "effective visibilities" And a couple of other naming and comment tweaks. Related to https://github.com/rust-lang/rust/issues/48054 For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often. So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
2022-10-28Add a test for TAIT used with impl/dyn Trait inside RPITxxchan-0/+37
2022-10-28Auto merge of #103683 - ↵bors-0/+5
fee1-dead-contrib:fix-deferred-cast-checks-constness, r=oli-obk Retain ParamEnv constness when running deferred cast checks Fixes #103677.
2022-10-28Emit proper error when casting to Ddyn-starMichael Goulet-0/+58
2022-10-28Retain ParamEnv constness when running deferred cast checksDeadbeef-0/+5
Fixes #103677.
2022-10-28Auto merge of #103671 - matthiaskrgr:rollup-iuugpep, r=matthiaskrgrbors-28/+761
Rollup of 5 pull requests Successful merges: - #102642 (Add tests for static async functions in traits) - #103283 (Add suggestions for unsafe impl error codes) - #103523 (Fix unwanted merge of inline doc comments for impl blocks) - #103550 (diagnostics: do not suggest static candidates as traits to import) - #103641 (Don't carry MIR location in `ConstraintCategory::CallArgument`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-28Rollup merge of #103631 - Rageking8:Add-test-for-issue-36007, r=compiler-errorsMatthias Krüger-0/+20
Add test for issue 36007 Fixes #36007 r? ``@compiler-errors``
2022-10-28Rollup merge of #103609 - BoxyUwU:fix_impl_self_cycle, r=compiler-errorsMatthias Krüger-74/+27
Emit a nicer error on `impl Self {` currently it emits a "cycle detected error" but this PR makes it emit a more user friendly error specifically saying that `Self` is disallowed in that position. this is a pretty hacky fix so i dont expect this to be merged (I basically only made this PR because i wanted to see if CI passes) r? ``@compiler-errors``
2022-10-28Rollup merge of #103608 - compiler-errors:rpitit-early-lt, r=cjgillotMatthias Krüger-0/+23
Remap early bound lifetimes in return-position `impl Trait` in traits too Fixes part of #103457 r? ``@cjgillot,`` though feel free to reassign, just thought you'd have sufficient context to review.
2022-10-28Rollup merge of #103641 - compiler-errors:issue-103624, r=cjgillotMatthias Krüger-28/+94
Don't carry MIR location in `ConstraintCategory::CallArgument` It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies. So instead, revert the commit a6b5f95fb028f9feb4a2957c06b35035be2c6155, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in #103220. Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen. Fixes #103624
2022-10-28Rollup merge of #103550 - notriddle:notriddle/no-suggest-static-candidates, ↵Matthias Krüger-0/+34
r=wesleywiser diagnostics: do not suggest static candidates as traits to import If it's a static candidate, then it's already implemented. Do not suggest it a second time for implementing. Partial fix for #102354
2022-10-28Rollup merge of #103283 - nbarrios1337:unsafe-impl-suggestions, r=cjgillotMatthias Krüger-0/+54
Add suggestions for unsafe impl error codes Adds suggestions for users to add `unsafe` to trait impls that should be `unsafe`, and remove `unsafe` from trait impls that do not require `unsafe` With the folllowing code: ```rust struct Foo {} struct Bar {} trait Safe {} unsafe trait Unsafe {} impl Safe for Foo {} // ok impl Unsafe for Foo {} // E0200 unsafe impl Safe for Bar {} // E0199 unsafe impl Unsafe for Bar {} // ok // omitted empty main fn ``` The current rustc output is: ``` error[E0199]: implementing the trait `Safe` is not unsafe --> e0200.rs:13:1 | 13 | unsafe impl Safe for Bar {} // E0199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration --> e0200.rs:11:1 | 11 | impl Unsafe for Foo {} // E0200 | ^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors Some errors have detailed explanations: E0199, E0200. For more information about an error, try `rustc --explain E0199`. ``` With this PR, the future rustc output would be: ``` error[E0199]: implementing the trait `Safe` is not unsafe --> ../../temp/e0200.rs:13:1 | 13 | unsafe impl Safe for Bar {} // E0199 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | help: remove `unsafe` from this trait implementation | 13 - unsafe impl Safe for Bar {} // E0199 13 + impl Safe for Bar {} // E0199 | error[E0200]: the trait `Unsafe` requires an `unsafe impl` declaration --> ../../temp/e0200.rs:11:1 | 11 | impl Unsafe for Foo {} // E0200 | ^^^^^^^^^^^^^^^^^^^^^^ | = note: the trait `Unsafe` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword help: add `unsafe` to this trait implementation | 11 | unsafe impl Unsafe for Foo {} // E0200 | ++++++ error: aborting due to 2 previous errors Some errors have detailed explanations: E0199, E0200. For more information about an error, try `rustc --explain E0199`. ``` ``@rustbot`` label +T-compiler +A-diagnostics +A-suggestion-diagnostics
2022-10-28Rollup merge of #102642 - bryangarza:afit-tests, r=compiler-errorsMatthias Krüger-0/+579
Add tests for static async functions in traits This patch adds test cases for AFIT, the majority of which are currently expected to run as `check-fail`. --- Note: I grabbed the cases from https://hackmd.io/SwRcXCiWQV-WRJ4BYs53fA Also, I'm not sure if the `async-associated-types2` and `async-associated-types2-desugared` are correct, I modified them a bit from the examples in the HackMD.
2022-10-28add test for issue 98634Rageking8-0/+110
2022-10-27Update tests based on feedbackBryan Garza-26/+7
- Add comment to some tests that will break when #102745 is implemented - Mark a test with known-bug - Delete duplicate test
2022-10-27Update src/test/ui/async-await/in-trait/async-example.rsBryan Garza-2/+2
Co-authored-by: Michael Goulet <michael@errs.io>
2022-10-27Add additional tests for static AFITBryan Garza-0/+169
2022-10-27Update tests based on feedbackBryan Garza-33/+48
2022-10-27Update static AFIT tests based on feedbackBryan Garza-144/+28
2022-10-27Add tests for static async functions in traitsBryan Garza-0/+530
This patch adds test cases for AFIT, the majority of which are currently expected to run as `check-fail`.
2022-10-27use proper spansBoxy-20/+39
2022-10-27DoItBoxy-82/+16
2022-10-27Only ban duplication across parameters.Camille GILLOT-0/+3
2022-10-27Erase regions from CallArgument, add test + blessMichael Goulet-6/+72
2022-10-27Revert "Make ClosureOutlivesRequirement not rely on an unresolved type"Michael Goulet-22/+22
This reverts commit a6b5f95fb028f9feb4a2957c06b35035be2c6155.
2022-10-27add test for issue 36007Rageking8-0/+20
2022-10-27Rollup merge of #103110 - RalfJung:manual-send, r=thomccMatthias Krüger-1/+1
remove redundant Send impl for references Also explain why the other instance is not redundant, move it next to the trait they are implementing, and out of the redundant module. This seems to go back all the way to https://github.com/rust-lang/rust/commit/35ca50bd5676db31a8074a216d1aadad7d434de8, not sure why the module was added. The instance for `&mut` is the default instance we get anyway, and we don't have anything similar for `Sync`, so IMO we should be consistent and not have the redundant instance here, either.
2022-10-27Auto merge of #103623 - matthiaskrgr:rollup-318yc1t, r=matthiaskrgrbors-16/+104
Rollup of 9 pull requests Successful merges: - #103035 (Even nicer errors from assert_unsafe_precondition) - #103106 (Try to say that memory outside the AM is always exposed) - #103475 (Make param index generation a bit more robust) - #103525 (Move a wf-check into the site where the value is instantiated) - #103564 (library: allow some unused things in Miri) - #103586 (Process registered region obligation in `resolve_regions_with_wf_tys`) - #103592 (rustdoc: remove redundant CSS selector `.notable-traits .notable`) - #103593 (Remove an unused parser function (`Expr::returns`)) - #103611 (Add test for issue 103574) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-27Rollup merge of #103611 - Rageking8:fix-103574, r=lcnrMatthias Krüger-4/+56
Add test for issue 103574 Fixes #103574 Together with some slight formatting. r? `@lcnr`
2022-10-27Rollup merge of #103586 - compiler-errors:issue-103573, r=jackh726Matthias Krüger-0/+36
Process registered region obligation in `resolve_regions_with_wf_tys` Fixes #103573
2022-10-27Rollup merge of #103525 - oli-obk:const_impl_on_non_const_trait, r=lcnrMatthias Krüger-12/+12
Move a wf-check into the site where the value is instantiated r? ``@lcnr``
2022-10-27Auto merge of #103601 - compiler-errors:no-opaque-probe-in-nll-relate, r=oli-obkbors-0/+24
Remove `commit_if_ok` probe from NLL type relation It was not really necessary to add the `commit_if_ok` in #100092 -- I added it to protect us against weird inference error messages due to recursive RPIT calls, but we are always on the error path when this happens anyways, and I can't come up with an example that makes this manifest. Fixes #103599 r? `@oli-obk` since you reviewed #100092, feel free to re-roll. :b: :loudspeaker: beta-nominating this since it's on beta (which forks in ~a week~ two days :fearful:) -- worst case we could revert the original PR on beta and land this on nightly, to give it some extra soak time...
2022-10-27add tests and slight formattingRageking8-4/+56
2022-10-27Remap early bound lifetimes tooMichael Goulet-0/+23
2022-10-26No need to probe when relating opaques in nll_relateMichael Goulet-0/+24
2022-10-26Process registered region obligation in resolve_regions_with_wf_tysMichael Goulet-0/+36
2022-10-26Auto merge of #103572 - Dylan-DPC:rollup-a8bnxrw, r=Dylan-DPCbors-122/+25
Rollup of 6 pull requests Successful merges: - #95710 (Stabilize arbitrary_enum_discriminant, take 2) - #102706 (Support excluding the generation of the standalone docs) - #103428 (Removed verbose printing from the `PrettyPrinter` when printing constants) - #103543 (Update books) - #103546 (interpret: a bit of cast cleanup) - #103554 (rustdoc: add visible focus outline to rustdoc-toggle) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup