about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-10-13Validate MIR in the `drop_order` testNathan Whitaker-0/+1
2022-10-14Auto merge of #103026 - matthiaskrgr:rollup-gfmlfkt, r=matthiaskrgrbors-0/+241
Rollup of 7 pull requests Successful merges: - #103000 (Add suggestion to the "missing native library" error) - #103006 (rustdoc: don't ICE on `TyKind::Typeof`) - #103008 (replace ReErased with fresh region vars in opaque types) - #103011 (Improve rustdoc `unsafe-fn` GUI test) - #103013 (Add new bootstrap entrypoints to triagebot) - #103016 (Ensure enum cast moves) - #103021 (Add links to relevant pages to find constraint information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-14Suppress irrefutable let patterns lint for prefixes in match guardsest31-14/+23
In match guards, irrefutable prefixes might use the bindings created by the match pattern. Ideally, we check for this, but we can do the next best thing and just not lint for irrefutable prefixes in match guards.
2022-10-14Rollup merge of #103016 - nbdd0121:enum, r=pnkfelixMatthias Krüger-0/+17
Ensure enum cast moves Fix #102389 r? ``@pnkfelix``
2022-10-14Rollup merge of #103008 - aliemjay:opaque-parent-substs, r=oli-obkMatthias Krüger-0/+194
replace ReErased with fresh region vars in opaque types See inline comments. Prior art #102943. cc ``@compiler-errors`` ``@oli-obk`` Fixes #100267 Fixes #101940 Fixes #102649 Fixes #102510
2022-10-14Rollup merge of #103000 - wesleywiser:suggest_libname, r=compiler-errorsMatthias Krüger-0/+30
Add suggestion to the "missing native library" error If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`. In this situation, we now detect that case and suggest the user only provide the library name itself.
2022-10-13Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errorsbors-6/+53
Check hidden types in dead code fixes #99490 r? `@compiler-errors` best reviewed commit by commit
2022-10-13Adding fuchsia-ignore and needs-unwind to compiler test casesAndrew Pollack-2/+9
2022-10-13Report duplicate definition in impls with overlap check.Camille GILLOT-29/+30
2022-10-13Add test for issue 102389Gary Guo-0/+17
2022-10-13replace ReErased with fresh region vars in opaque typesAli MJ Al-Nasrawy-0/+194
2022-10-13Move some tests to more reasonable directoriesCaio-28/+0
2022-10-13Rollup merge of #102999 - compiler-errors:issue-102985, r=fee1-deadDylan DPC-0/+37
Delay `is_intrinsic` query until after we've determined the callee is a function Fixes #102985
2022-10-13Rollup merge of #102956 - TaKO8Ki:fix-102946, r=fee1-deadDylan DPC-0/+33
Use `full_res` instead of `expect_full_res` Fixes #102946 Fixes #102978
2022-10-13Rollup merge of #102947 - compiler-errors:sort-elaborated-existentials, ↵Dylan DPC-0/+25
r=cjgillot Sort elaborated existential predicates in `object_ty_for_trait` r? `@cjgillot` I think that #102845 caused #102933. Depending on the order that we elaborate these existential projection predicates, there's no guarantee that they'll be sorted by def id, which is what is failing the assertion in the issue. Fixes #102933 Fixes #102973
2022-10-13Rollup merge of #102765 - TaKO8Ki:follow-up-to-102708, r=compiler-errorsDylan DPC-1/+24
Suggest `==` to the first expr which has `ExprKind::Assign` kind follow-up to #102708 [playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4241dc33ed8af02e1ef530d6b14903fd)
2022-10-13Add suggestion to the "missing native library" errorWesley Wiser-0/+30
If we fail to locate a native library that we are linking with, it could be the case the user entered a complete file name like `foo.lib` or `libfoo.a` when we expect them to simply provide `foo`. In this situation, we now detect that case and suggest the user only provide the library name itself.
2022-10-13resolve: Add some asserts for unexpected lifetime rib combinationsVadim Petrochenkov-0/+89
2022-10-13Delay intrinsic call until after we've determined the callee is a functionMichael Goulet-0/+37
2022-10-13Sort elaborated existential predicates in object_ty_for_traitMichael Goulet-0/+25
2022-10-12Let chains should still drop temporariesNathan Whitaker-0/+63
by the end of the condition's execution
2022-10-13Rollup merge of #102974 - Rageking8:fix-small-word-dupe-typos, r=JohnTitorYuki Okushi-16/+16
Fix small word dupe typos
2022-10-13Rollup merge of #102967 - Rageking8:add-test-for-issue-102964, r=TaKO8KiYuki Okushi-0/+29
Add test for issue 102964 Fixes #102964
2022-10-13Rollup merge of #102641 - eholk:dyn-star-box, r=compiler-errorsYuki Okushi-0/+17
Support casting boxes to dyn* Boxes have a pointer type at codegen time which LLVM does not allow to be transparently converted to an integer. Work around this by inserting a `ptrtoint` instruction if the argument is a pointer. r? ``@compiler-errors`` Fixes #102427
2022-10-12Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakisbors-95/+68
Support default-body trait functions with return-position `impl Trait` in traits Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form. This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later. Fixes #101665
2022-10-12add regression testLukas Markeffsky-0/+20
2022-10-13fix small word dupe typosRageking8-16/+16
2022-10-12Rollup merge of #102927 - compiler-errors:let, r=davidtwcoDylan DPC-6/+70
Fix `let` keyword removal suggestion in structs (1.) Fixes a bug where, given this code: ```rust struct Foo { let x: i32, } ``` We were parsing the field name as `let` instead of `x`, which causes issues later on in the type-checking phase. (2.) Also, suggestions for `let: i32` as a field regressed, displaying this extra `help:` which is removed by this PR ``` help: remove the let, the `let` keyword is not allowed in struct field definitions | 2 - let: i32, 2 + : i32, ``` (3.) Makes the suggestion text a bit more succinct, since we don't need to re-explain that `let` is not allowed in this position (since it's in a note that follows). This causes the suggestion to render inline as well. cc `@gimbles,` this addresses a few nits I mentioned in your PR.
2022-10-12Add broken test for AFIT with RPITITMichael Goulet-0/+33
2022-10-12add test for issue 102964Rageking8-0/+29
2022-10-12Auto merge of #102460 - flba-eb:fix_85261_prevent_alloc_after_fork, r=thomccbors-1/+42
Prevent UB in child process after calling libc::fork After calling libc::fork, the child process tried to access a TLS variable when processing a panic. This caused a memory allocation which is UB in the child. To prevent this from happening, the panic handler will not access the TLS variable in case `panic::always_abort` was called before. Fixes #85261 (not only on Android systems, but also on Linux/QNX with TLS disabled, see issue for more details) Main drawbacks of this fix: * Panic messages can incorrectly omit `core::panic::PanicInfo` struct in case several panics (of multiple threads) occur at the same time. The handler cannot distinguish between multiple panics in different threads or recursive ones in the same thread, but the message will contain a hint about the uncertainty. * `panic_count::increase()` will be a bit slower as it has an additional `if`, but this should be irrelevant as it is only called in case of a panic.
2022-10-12fix #102946Takayuki Maeda-0/+33
2022-10-12Rollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillotDylan DPC-21/+31
Check representability in adt_sized_constraint Now that representability is a query, we can use it to preemptively avoid a cycle in `adt_sized_constraint`. I moved the representability check into `check_mod_type_wf` to avoid a scenario where rustc quits before checking all the types for representability. This also removes the check from rustdoc, which is alright AFAIK. r? ``@cjgillot``
2022-10-12Rollup merge of #102187 - b-naber:inline-const-source-info, r=eholkDylan DPC-0/+67
Use correct location for type tests in promoted constants Previously we forgot to remap the location in a type test collected when visiting the body of a promoted constant back to the usage location, causing an ICE when trying to get span information for that type test. Fixes https://github.com/rust-lang/rust/issues/102117
2022-10-12Rollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwcoDylan DPC-2/+2
Migrate rustc_passes diagnostics Picks up abandoned work from https://github.com/rust-lang/rust/pull/100870 I would like to do this collaboratively, as there is a lot of work! Here's the process: - Comment below that you are willing to help and I will add you as a collaborator to my `rust` fork (that gives you write access) - Indicate which file/task you would like to work on (so we don't duplicate work) from the list below - Do the work, push up a commit, comment that you're done with that file/task - Repeat until done 😄 ### Files to Migrate (in `compiler/rustc_passes/src/`) - [x] check_attr.rs ``@CleanCut`` - [x] check_const.rs ``@CleanCut`` - [x] dead.rs ``@CleanCut`` - [x] debugger_visualizer.rs ``@CleanCut`` - [x] diagnostic_items.rs ``@CleanCut`` - [x] entry.rs ``@CleanCut`` - [x] lang_items.rs ``@CleanCut`` - [x] layout_test.rs ``@CleanCut`` - [x] lib_features.rs ``@CleanCut`` - [x] ~liveness.rs~ ``@CleanCut`` Nothing to do - [x] loops.rs ``@CleanCut`` - [x] naked_functions.rs ``@CleanCut`` - [x] stability.rs ``@CleanCut`` - [x] weak_lang_items.rs ``@CleanCut`` ### Tasks - [x] Rebase on current `master` ``@CleanCut`` - [x] Review work from [the earlier PR](https://github.com/rust-lang/rust/pull/100870) and make sure it all looks good - [x] compiler/rustc_error_messages/locales/en-US/passes.ftl ``@CleanCut`` - [x] compiler/rustc_passes/src/check_attr.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/errors.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lang_items.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lib.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/weak_lang_items.rs ``@CleanCut``
2022-10-12Do not register placeholder region outlives when considering_regions is falseMichael Goulet-0/+61
2022-10-11wip: trying to enable #[track_caller] on async fnEric Holk-0/+1
2022-10-11Fix let removal suggestion in structMichael Goulet-6/+70
2022-10-11Rollup merge of #102893 - TaKO8Ki:fix-102878, r=davidtwcoMatthias Krüger-0/+70
Fix ICE #102878 Fixes #102878
2022-10-11Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkovMatthias Krüger-22/+89
Check uniqueness of impl items by trait item when applicable. When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items. This means that a plain item and one generated by a macro 2.0 do not collide. This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls. This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice. There should be no stable breakage, since macros 2.0 are still unstable. r? ``@petrochenkov`` cc ``@RalfJung`` Fixes https://github.com/rust-lang/rust/issues/71614.
2022-10-11Report duplicate definitions in trait impls during resolution.Camille GILLOT-22/+89
2022-10-10Add a test case for #[track_caller] on async fnEric Holk-0/+74
2022-10-10Check representability in adt_sized_constraintCameron Steffen-21/+31
2022-10-10Rollup merge of #102876 - SparrowLii:import-candidate, r=fee1-deadMatthias Krüger-4/+83
suggest candidates for unresolved import Currently we prompt suggestion of candidates(help notes of `use xxx::yyy`) for names which cannot be resolved, but we don't do that for import statements themselves that couldn't be resolved. It seems reasonable to add candidate help information for these statements as well. Fixes #102711
2022-10-10Rollup merge of #101789 - gimbles:let, r=estebankMatthias Krüger-2/+8
`let`'s not needed in struct field definitions Fixes #101683
2022-10-10Rollup merge of #101360 - compiler-errors:multiple-closure-bounds, ↵Matthias Krüger-0/+39
r=petrochenkov Point out incompatible closure bounds Fixes #100295
2022-10-11fix #102878Takayuki Maeda-0/+70
2022-10-10`let` is not allowed in struct field definitionsgimbles-2/+8
Co-authored-by: jyn514 <jyn514@gmail.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2022-10-10Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8KiDylan DPC-2/+2
Rename `AssocItemKind::TyAlias` to `AssocItemKind::Type` Thanks `@camsteffen` for catching this in ast too, cc https://github.com/rust-lang/rust/pull/102829#issuecomment-1272649247
2022-10-10Rollup merge of #102853 - cjgillot:skip-opaque-cast, r=jackh726Dylan DPC-0/+17
Skip chained OpaqueCast when building captures. Fixes https://github.com/rust-lang/rust/issues/102089