about summary refs log tree commit diff
path: root/tests/crashes
AgeCommit message (Collapse)AuthorLines
2024-05-25Rollup merge of #125451 - oli-obk:const_type_mismatch, r=compiler-errorsMatthias Krüger-97/+0
Fail relating constants of different types fixes #121585 fixes #121858 fixes #124151 I gave this several attempts before, but we lost too many important diagnostics until I managed to make compilation never bail out early. We have reached this point, so now we can finally fix all those ICEs by bubbling up an error instead of continueing when we encounter a bug.
2024-05-24Rollup merge of #125501 - compiler-errors:opaque-opaque-anon-ct, r=BoxyUwUMatthias Krüger-22/+0
Resolve anon const's parent predicates to direct parent instead of opaque's parent When an anon const is inside of an opaque, #99801 added a hack to resolve the anon const's parent predicates *not* to the opaque's predicates, but to the opaque's *parent's* predicates. This is insufficient when considering nested opaques. This means that the `predicates_of` an anon const might reference duplicated lifetimes (installed by `compute_bidirectional_outlives_predicates`) when computing known outlives in MIR borrowck, leading to these ICEs: Fixes #121574 Fixes #118403 ~~Instead, we should be using the `OpaqueTypeOrigin` to acquire the owner item (fn/type alias/etc) of the opaque, whose predicates we're fine to mention.~~ ~~I think it's a bit sketchy that we're doing this at all, tbh; I think it *should* be fine for the anon const to inherit the predicates of the opaque it's located inside. However, that would also mean that we need to make sure the `generics_of` that anon const line up in the same way.~~ ~~None of this is important to solve right now; I just want to fix these ICEs so we can land #125468, which accidentally fixes these issues in a different and unrelated way.~~ edit: We don't need this special case anyways because we install the right parent item in `generics_of` anyways: https://github.com/rust-lang/rust/blob/213ad10c8f0fc275648552366275dc4e07f97462/compiler/rustc_hir_analysis/src/collect/generics_of.rs#L150 r? `@BoxyUwU`
2024-05-24Actually just remove the special case altogetherMichael Goulet-22/+0
2024-05-24Add regression testsOli Scherer-22/+0
2024-05-24Use regular type equating instead of a custom queryOli Scherer-6/+0
2024-05-24Fail relating constants of different typesOli Scherer-91/+0
2024-05-24Auto merge of #125457 - fmease:gacs-diag-infer-plac-missing-ty, ↵bors-10/+0
r=compiler-errors Properly deal with missing/placeholder types inside GACs Fixes #124833. r? oli-obk (#123130)
2024-05-24Handle trait/impl GAC mismatches when inferring missing/placeholder typesLeón Orell Valerian Liehr-10/+0
2024-05-23Allow const eval failures if the cause is a type layout issueOli Scherer-7/+0
2024-05-22Auto merge of #124227 - compiler-errors:hack-check-method-res, r=estebankbors-52/+0
Make sure that the method resolution matches in `note_source_of_type_mismatch_constraint` `note_source_of_type_mismatch_constraint` is a pile of hacks that I implemented to cover up another pile of hacks. It does a bunch of re-confirming methods, but it wasn't previously checking that the methods it was looking (back) up were equal to the methods we previously had. This PR adds those checks. Fixes #118185
2024-05-18crashes: add moreMatthias Krüger-0/+126
2024-05-12Propagate errors rather than using return_if_errMichael Goulet-8/+0
2024-05-11ignore generics args in attribute pathsbohan-46/+0
2024-05-09update crasheslcnr-14/+0
2024-05-08Rollup merge of #124775 - matthiaskrgr:boom, r=jieyouxuMatthias Krüger-0/+148
crashes: add lastest batch of crash tests
2024-05-08Rollup merge of #124548 - gurry:113272-ice-failed-to-normalize, ↵Matthias Krüger-16/+0
r=compiler-errors Handle normalization failure in `struct_tail_erasing_lifetimes` Fixes #113272 The ICE occurred because the struct being normalized had an error. This PR adds some defensive code to guard against that.
2024-05-07Auto merge of #124219 - gurry:122989-ice-unexpected-anon-const, ↵bors-8/+0
r=compiler-errors Do not ICE on `AnonConst`s in `diagnostic_hir_wf_check` Fixes #122989 Below is the snippet from #122989 that ICEs: ```rust trait Traitor<const N: N<2> = 1, const N: N<2> = N> { fn N(&N) -> N<2> { M } } trait N<const N: Traitor<2> = 12> {} ``` The `AnonConst` that triggers the ICE is the `2` in the param `const N: N<2> = 1`. The currently existing code in `diagnostic_hir_wf_check` deals only with `AnonConst`s that are default values of some param, but the `2` is not a default value. It is just an `AnonConst` HIR node inside a `TraitRef` HIR node corresponding to `N<2>`. Therefore the existing code cannot handle it and this PR ensures that it does.
2024-05-05crashes: add lastest batch of crash testsMatthias Krüger-0/+148
2024-05-04Lower never patterns to Unreachable in mirNadrieril-12/+0
2024-05-03Auto merge of #123602 - cjgillot:gvn-borrowed, r=oli-obkbors-40/+0
Account for immutably borrowed locals in MIR copy-prop and GVN For the most part, we consider that immutably borrowed `Freeze` locals still fulfill SSA conditions. As the borrow is immutable, any use of the local will have the value given by the single assignment, and there can be no surprise. This allows copy-prop to merge a non-borrowed local with a borrowed local. We chose to keep copy-classes heads unborrowed, as those may be easier to optimize in later passes. This also allows to GVN the value behind an immutable borrow. If a SSA local is borrowed, dereferencing that borrow is equivalent to copying the local's value: re-executing the assignment between the borrow and the dereference would be UB. r? `@ghost` for perf
2024-05-01Handle normalization failure in `struct_tail_erasing_lifetimes`Gurinder Singh-16/+0
Fixes an ICE that occurred when the struct in question has an error
2024-04-29Rollup merge of #124504 - gurry:123710-union-ICE, r=oli-obk许杰友 Jieyou Xu (Joe)-17/+0
Mark unions non-const-propagatable in `KnownPanicsLint` without calling layout Fixes #123710 The ICE occurs during the layout calculation of the union `InvalidTag` in #123710 because the following assert fails:https://github.com/rust-lang/rust/blob/5fe8b697e729b6eb64841a3905e57da1b47f4ca3/compiler/rustc_abi/src/layout.rs#L289-L292 The layout calculation is invoked by `KnownPanicsLint` when it is trying to figure out which locals it can const prop. Since `KnownPanicsLint` is never actually going to const props unions thanks to PR https://github.com/rust-lang/rust/pull/121628 there's no point calling layout to check if it can. So in this fix I skip the call to layout and just mark the local non-const propagatable if it is a union.
2024-04-29Prohibit const prop of unions in `KnownPanicsLint`Gurinder Singh-17/+0
as they have a potential to ICE during layout calculation
2024-04-28add test for https://github.com/rust-lang/rust/issues/109812Matthias Krüger-0/+22
2024-04-27Rollup merge of #124394 - gurry:123863-ice-unexpected-region, r=lcnrMatthias Krüger-6/+0
Fix ICE on invalid const param types Fixes ICE #123863 which occurs because the const param has a type which is not a `bool`, `char` or an integral type. The ICEing code path begins here in `typeck_with_fallback`: https://github.com/rust-lang/rust/blob/cb3752d20e0f5d24348062211102a08d46fbecff/compiler/rustc_hir_typeck/src/lib.rs#L167 The `fallback` invokes the `type_of` query and that eventually ends up calling `ct_infer` from the lowering code over here: https://github.com/rust-lang/rust/blob/cb3752d20e0f5d24348062211102a08d46fbecff/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs#L561 and `ct_infer` ICEs at this location: https://github.com/rust-lang/rust/blob/cb3752d20e0f5d24348062211102a08d46fbecff/compiler/rustc_hir_analysis/src/collect.rs#L392 To fix the ICE it I'm triggering a `span_delayed_bug` before we hit `ct_infer` if the type of the const param is not one of the supported types ### Edit On `@lcnr's` suggestion I've changed the approach to not let `ReStatic` region hit the `bug!` in `ct_infer` instead of triggering a `span_delayed_bug`.
2024-04-27Fix ICE on invalid const param typesGurinder Singh-6/+0
2024-04-26crashes: add more testsMatthias Krüger-0/+102
2024-04-25Add testMichael Goulet-5/+0
2024-04-23Rollup merge of #123993 - compiler-errors:coroutine-obl, r=lcnrLeón Orell Valerian Liehr-10/+0
Do `check_coroutine_obligations` once per typeck root We only need to do `check_coroutine_obligations` once per typeck root, especially since the new solver can't really (easily) associate which obligations correspond to which coroutines. This requires us to move the checks for sized coroutine fields into `mir_coroutine_witnesses`, but that's fine imo. r? lcnr
2024-04-23Rollup merge of #124057 - gurry:124031-ice-layout-errored, r=compiler-errorsMatthias Krüger-17/+0
Fix ICE when ADT tail has type error Fixes #124031
2024-04-22Do not ICE on `AnonConst`s in `diagnostic_hir_wf_check`Gurinder Singh-8/+0
2024-04-22Fix ICE when ADT tail has type errorGurinder Singh-17/+0
2024-04-21crashes: add a couple more ICE testsMatthias Krüger-0/+62
2024-04-21Make sure that the method resolution matches in ↵Michael Goulet-52/+0
note_source_of_type_mismatch_constraint
2024-04-20Remove no_core ICE test.Camille GILLOT-40/+0
2024-04-20Auto merge of #124176 - matthiaskrgr:tests_are_the_best, r=jieyouxubors-0/+122
add more known crashes tests r? `@jieyouxu`
2024-04-19add more known-crashes testsMatthias Krüger-0/+122
2024-04-19Remove old ICE tests that no longer ICE (yay!)Maybe Waffle-24/+0
2024-04-19Auto merge of #124038 - matthiaskrgr:one_or_two_more_tests, r=jieyouxubors-0/+297
crashes: add a couple more ice tests
2024-04-18crashes: add a couple more testsMatthias Krüger-0/+297
2024-04-18The ICE in 121127 needs debuginfoScott McMurray-1/+2
2024-04-18Auto merge of #124046 - matthiaskrgr:one_or_two_more_tests____some_on_top, ↵bors-0/+723
r=jieyouxu crashes: add even more tests?!? adds more tests that were not already added with https://github.com/rust-lang/rust/pull/124038 from the past 10 months or so. Need a couple more passes through the tracker to filter out more missing ice /fixed tests but we're slowly getting there.
2024-04-18crashes: add even more tests?!?Matthias Krüger-0/+723
2024-04-17Validate nested static itemsOli Scherer-17/+0
2024-04-17Rollup merge of #123675 - oli-obk:static_wf_ice, r=compiler-errorsGuillaume Gomez-17/+0
Taint const qualifs if a static is referenced that didn't pass wfcheck It is correct to only check the signature here, as the ICE is caused by `USE_WITH_ERROR` trying to allocate memory to store the result of `WITH_ERROR` before evaluating it. fixes #123153
2024-04-16Taint const qualifs if a static is referenced that didn't pass wfcheckOli Scherer-17/+0
2024-04-16Fail candidate assembly for erroneous typesGurinder Singh-12/+0
Trait predicates for types which have errors may still evaluate to OK leading to downstream ICEs. Now we return a selection error for such types in candidate assembly and thereby prevent such issues
2024-04-15crash -> testMichael Goulet-10/+0
2024-04-15crashes: readme: add reminder to add Fixes #abcde to prs to automatically ↵Matthias Krüger-0/+7
close issues.
2024-04-14crashes: limit a couple tests to only run on x86_64 and/or not on windowsMatthias Krüger-10/+6