about summary refs log tree commit diff
path: root/tests/crashes
AgeCommit message (Collapse)AuthorLines
2025-05-05Be a bit more relaxed about not yet constrained infer vars in closure upvar ↵Michael Goulet-11/+0
analysis
2025-05-04Auto merge of #140549 - BoxyUwU:proper_const_norm, r=lcnrbors-23/+11
Set groundwork for proper const normalization r? lcnr Updates a lot of our normalization/alias infrastructure to be setup to handle mgca aliases and normalization once const items are represented more like aliases than bodies. Inherent associated consts are still super busted, I didn't update the assertions that IACs the right arg setup because that winds up being somewhat involved to do *before* proper support for normalizing const aliases is implemented. I dont *intend* for this to have any effect on stable. We continue normalizing via ctfe on stable and the codepaths in `project` for consts should only be reachable with mgca or ace.
2025-05-01Crashes testsBoxy-23/+11
2025-05-01crashes: more testsMatthias Krüger-0/+332
2025-04-29Adjust testsMichael Goulet-16/+0
2025-04-28AsyncDrop implementation using shim codegen of ↵Andrew Zhogin-33/+0
async_drop_in_place::{closure}, scoped async drop added.
2025-04-21Rollup merge of #140021 - compiler-errors:no-deep-norm-ice, r=lcnrChris Denton-13/+0
Don't ICE on pending obligations from deep normalization in a loop See the comment I left inline in `compiler/rustc_trait_selection/src/traits/normalize.rs`. Fixes https://github.com/rust-lang/rust/issues/133868 r? lcnr
2025-04-19Don't ICE on pending obligations from deep normalization in a loopMichael Goulet-13/+0
2025-04-19Rollup merge of #139091 - mejrs:format, r=compiler-errorsChris Denton-20/+0
Rewrite on_unimplemented format string parser. This PR rewrites the format string parser for `rustc_on_unimplemented` and `diagnostic::on_unimplemented`. I plan on moving this code (and more) into the new attribute parsing system soon and wanted to PR it separately. This PR introduces some minor differences though: - `rustc_on_unimplemented` on trait *implementations* is no longer checked/used - this is actually never used (outside of some tests) so I plan on removing it in the future. - for `rustc_on_unimplemented`, it introduces the `{This}` argument in favor of `{ThisTraitname}` (to be removed later). It'll be easier to parse. - for `rustc_on_unimplemented`, `Self` can now consistently be used as a filter, rather than just `_Self`. It used to not match correctly on for example `Self = "[{integer}]"` - Some error messages now have better spans. Fixes https://github.com/rust-lang/rust/issues/130627
2025-04-18Rollup merge of #138599 - adwinwhite:recursive-overflow, r=wesleywiserMatthias Krüger-102/+0
avoid overflow when generating debuginfo for expanding recursive types Fixes #135093 Fixes #121538 Fixes #107362 Fixes #100618 Fixes #115994 The overflow happens because expanding recursive types keep creating new nested types when recurring into sub fields. I fixed that by returning an empty stub node when expanding recursion is detected.
2025-04-14Normalize ADT fields in find_tails_for_unsizingMichael Goulet-42/+0
2025-04-14Handle regions equivalent to 'static in non_local_boundsMatthew Jasper-14/+0
`non_local_bounds` would only find non local bounds that strictly bound a given region, but it's possible that a local region is equated to 'static when showing a type referencing a locally bound lifetime, such as `dyn Any + 'a` in the tests added, is well-formed. In this case we should return 'static.
2025-04-14Disable usage on trait impls and aliasesmejrs-20/+0
2025-04-11Use delayed bug for normalization errors in drop elaborationMatthew Jasper-67/+0
Normalization can fail from errors from other items so use a delayed bug instead of checking the body.
2025-04-11Auto merge of #139578 - ferrocene:pa-compiletest-edition, r=jieyouxubors-14/+22
Fix breakage when running compiletest with `--test-args=--edition=2015` Compiletest has an `--edition` flag to change the default edition tests are run with. Unfortunately no test suite successfully executes when that flag is passed. If the edition is set to something greater than 2015 the breakage is expected, since the test suite currently supports only edition 2015 (Ferrous Systems will open an MCP about fixing that soonish). Surprisingly, the test suite is also broken if `--edition=2015` is passed to compiletest. This PR focuses on fixing the latter. This PR fixes the two categories of failures happening when `--edition=2015` is passed: * Some edition-specific tests set their edition through `//@ compile-flags` instead of `//@ edition`. Compiletest doesn't parse the compile flags, so it would see no `//@ edition` and add another `--edition` flag, leading to a rustc error. * Compiletest would add the edition after `//@ compile-flags`, while some tests depend on flags passed to `//@ compile-flags` being the last flags in the rustc invocation. Note that for the first category, I opted to manually go and replace all `//@ compile-flags` setting an edition with an explicit `//@ edition`. We could've changed compiletest to instead check whether an edition was set in `//@ compile-flags`, but I thought it was better to enforce a consistent way to set the edition in tests. I also added the edition to the stamp, so that changing `--edition` results in tests being re-executed. r? `@jieyouxu`
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-14/+22
2025-04-07Remove crash test that do not ICE anymoreSantiago Pastorino-52/+0
2025-04-05Rollup merge of #139341 - nnethercote:fix-137874, r=petrochenkovStuart Cook-4/+0
Apply `Recovery::Forbidden` when reparsing pasted macro fragments. Fixes #137874. The changes to the output of `tests/ui/associated-consts/issue-93835.rs` partly undo the changes seen when `NtTy` was removed in #133436, which is good. r? ``@petrochenkov``
2025-04-04Apply `Recovery::Forbidden` when reparsing pasted macro fragments.Nicholas Nethercote-4/+0
Fixes #137874. Removes `tests/crashes/137874.rs`; the new test is simpler (defines its own macro) but tests the same thing. The changes to the output of `tests/ui/associated-consts/issue-93835.rs` partly undo the changes seen when `NtTy` was removed in #133436, which is good.
2025-04-03add `TypingMode::Borrowck`lcnr-38/+0
2025-04-02Rollup merge of #135295 - eyraudh:master, r=compiler-errorsStuart Cook-9/+0
Check empty SIMD vector in inline asm fixes [#134334](https://github.com/rust-lang/rust/issues/134334)
2025-03-31Feed HIR for by-move coroutine body def, since the inliner tries to read its ↵Michael Goulet-12/+0
attrs
2025-03-23fix: Check empty SIMD vector in inline asmHadrien Eyraud-9/+0
2025-03-22Auto merge of #138719 - lcnr:concrete_opaque_types-closures, r=oli-obkbors-12/+0
merge opaque types defined in nested bodies A small step towards https://github.com/rust-lang/types-team/issues/129 r? `@oli-obk`
2025-03-20Do not rely on type_var_origin in OrphanCheckErr::NonLocalInputTypeMichael Goulet-10/+0
2025-03-19merge opaque types of nested bodieslcnr-12/+0
2025-03-18Remove existing AFIDT implementationMichael Goulet-20/+0
2025-03-17(re)move fixed crash testsAdwin White-102/+0
2025-03-13EUV: fix place of deref pattern's interior's scrutineedianne-12/+0
The place previously used here was that of the temporary holding the reference returned by `Deref::deref` or `DerefMut::deref_mut`. However, since the inner pattern of `deref!(inner)` expects the deref-target type itself, this would ICE when that type was inspected (e.g. by the EUV case for slice patterns). This adds a deref projection to fix that. Since current in-tree consumers of EUV (upvar inference and clippy) don't care about Rvalues, the place could be simplified to `self.cat_rvalue(pat.hir_id, self.pat_ty_adjusted(subpat)?)` to save some cycles. I personally find EUV to be a bit fragile, so I've opted for pedantic correctness. Maybe a `HACK` comment would suffice though?
2025-03-11Auto merge of #138366 - matthiaskrgr:rollup-cn16m7q, r=matthiaskrgrbors-13/+0
Rollup of 10 pull requests Successful merges: - #137715 (Allow int literals for pattern types with int base types) - #138002 (Disable CFI for weakly linked syscalls) - #138051 (Add support for downloading GCC from CI) - #138231 (Prevent ICE in autodiff validation by emitting user-friendly errors) - #138245 (stabilize `ci_rustc_if_unchanged_logic` test for local environments) - #138256 (Do not feed anon const a type that references generics that it does not have) - #138284 (Do not write user type annotation for const param value path) - #138296 (Remove `AdtFlags::IS_ANONYMOUS` and `Copy`/`Clone` condition for anonymous ADT) - #138352 (miri native_calls: ensure we actually expose *mutable* provenance to the memory FFI can access) - #138354 (remove redundant `body` arguments) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-11Rollup merge of #138284 - compiler-errors:const-param-ty-annotation, r=BoxyUwUMatthias Krüger-8/+0
Do not write user type annotation for const param value path As I noted in the code comment, `DefKind::ConstParam` isn't actually *generic* over its own args, we just use the identity args from the body when lowering the value path so we have something to plug into the `EarlyBinder` we get back from `type_of` for the const param. So skip over it in `write_user_type_annotation_from_args`. Somewhat unrelated, but I left an explanation for a somewhat mysterious quirk in the THIR lowering of user type annotations for patterns having to do with ctors and their `type_of` not actually being the type of the pattern node it's ascribing. Fixes #138048 r? ``@BoxyUwU``
2025-03-11Rollup merge of #138256 - compiler-errors:anon-const-ty, r=BoxyUwUMatthias Krüger-5/+0
Do not feed anon const a type that references generics that it does not have Fixes #137865 See the comment I left in the code. We could alternatively give these anon consts the generics from the parent, but that would be moving in a GCE-esque direction that we may not want. Open to tweaks here. r? BoxyUwU
2025-03-11Auto merge of #128440 - oli-obk:defines, r=lcnrbors-24/+36
Add `#[define_opaques]` attribute and require it for all type-alias-impl-trait sites that register a hidden type Instead of relying on the signature of items to decide whether they are constraining an opaque type, the opaque types that the item constrains must be explicitly listed. A previous version of this PR used an actual attribute, but had to keep the resolved `DefId`s in a side table. Now we just lower to fields in the AST that have no surface syntax, instead a builtin attribute macro fills in those fields where applicable. Note that for convenience referencing opaque types in associated types from associated methods on the same impl will not require an attribute. If that causes problems `#[defines()]` can be used to overwrite the default of searching for opaques in the signature. One wart of this design is that closures and static items do not have generics. So since I stored the opaques in the generics of functions, consts and methods, I would need to add a custom field to closures and statics to track this information. During a T-types discussion we decided to just not do this for now. fixes #131298
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-24/+36
2025-03-10Rollup merge of #138278 - Bryanskiy:delegation-ice-1, r=petrochenkovMatthias Krüger-38/+0
Delegation: fix ICE with invalid `MethodCall` generation `ExprKind::MethodCall` is now generated instead of `ExprKind::Call` if - the resolved function has a `&self` argument - the resolved function is an associated item <- was missed before Fixes https://github.com/rust-lang/rust/issues/128190 Fixes https://github.com/rust-lang/rust/issues/128119 Fixes https://github.com/rust-lang/rust/issues/127916 r? `@petrochenkov`
2025-03-10Delegation: fix ICE with invalid MethodCall generationBryanskiy-38/+0
2025-03-09Do not feed anon const a type that references generics that it does not haveMichael Goulet-5/+0
2025-03-09Do not write user type annotation for const param value pathMichael Goulet-8/+0
2025-03-08crashes: couple more testsMatthias Krüger-0/+569
2025-03-07Make synthetic RPITIT assoc ty name handling more rigorous.Nicholas Nethercote-12/+0
Currently it relies on special treatment of `kw::Empty`, which is really easy to get wrong. This commit makes the special case clearer in the type system by using `Option`. It's a bit clumsy, but the synthetic name handling itself is a bit clumsy; better to make it explicit than sneak it in. Fixes #133426.
2025-03-05Rollup merge of #138028 - workingjubilee:is-rustic-abi, r=compiler-errors许杰友 Jieyou Xu (Joe)-11/+0
compiler: add `ExternAbi::is_rustic_abi` Various parts of the compiler were hand-rolling this extremely simple check that is nonetheless easy to get wrong as the compiler evolves over time. Discourage them from being so "original" again by replacing it with a single implementation on the type that represents these ABIs. This simplifies a surprising amount of code as a result. Also fixes #132981, an ICE that emerged due to other checks being made stricter.
2025-03-04compiler: use `is_rustic_abi` in ty_utilsJubilee Young-11/+0
expands some conditionals to include different "rustic" ABIs, so that we actually handle passing args through all "rustic" ABIs
2025-03-03Check signature WF when lowering MIR bodyMichael Goulet-2/+13
2025-02-26Bless testsGary Guo-13/+0
2025-02-23Rollup merge of #137458 - compiler-errors:render-fn, r=fmeaseJacob Pratt-11/+0
Fix missing self subst when rendering `impl Fn*<T>` with no output type r? `@fmease` or reassign Fixes #133597 cc #137456
2025-02-23Fix missing self subst when rendering Fn* trait with no output typeMichael Goulet-11/+0
2025-02-23Rollup merge of #137180 - compiler-errors:sym-regions, r=oli-obkMatthias Krüger-46/+0
Give `global_asm` a fake body to store typeck results, represent `sym fn` as a hir expr to fix `sym fn` operands with lifetimes There are a few intertwined problems with `sym fn` operands in both inline and global asm macros. Specifically, unlike other anon consts, they may evaluate to a type with free regions in them without actually having an item-level type annotation to give them a "proper" type. This is in contrast to named constants, which always have an item-level type annotation, or unnamed constants which are constrained by their position (e.g. a const arg in a turbofish, or a const array length). Today, we infer the type of the operand by looking at the HIR typeck results; however, those results are region-erased, so during borrowck we ICE since we don't expect to encounter erased regions. We can't just fill this type with something like `'static`, since we may want to use real (free) regions: ```rust fn foo<'a>() { asm!("/* ... */", sym bar::<&'a ()>); } ``` The first idea may be to represent `sym fn` operands using *inline* consts instead of anon consts. This makes sense, since inline consts can reference regions from the parent body (like the `'a` in the example above). However, this introduces a problem with `global_asm!`, which doesn't *have* a parent body; inline consts *must* be associated with a parent body since they are not a body owner of their own. In #116087, I attempted to fix this by using two separate `sym` operands for global and inline asm. However, this led to a lot of confusion and also some unattractive code duplication. In this PR, I adjust the lowering of `global_asm!` so that it's lowered in a "fake" HIR body. This body contains a single expression which is `ExprKind::InlineAsm`; we don't *use* this HIR body, but it's used in typeck and borrowck so that we can properly infer and validate the the lifetimes of `sym fn` operands. I then adjust the lowering of `sym fn` to instead be represented with a HIR expression. This is both because it's no longer necessary to represent this operand as an anon const, since it's *just* a path expression, and also more importantly to sidestep yet another ICE (https://github.com/rust-lang/rust/issues/137179), which has to do with the existing code breaking an invariant of def-id creation and anon consts. Specifically, we are not allowed to synthesize a def-id for an anon const when that anon const contains expressions with def-ids whose parent is *not* that anon const. This is somewhat related to https://github.com/rust-lang/rust/pull/130443#issuecomment-2445678945, which is also a place in the compiler where synthesizing anon consts leads to def-id parenting issue. As a side-effect, this consolidates the type checking for inline and global asm, so it allows us to simplify `InlineAsmCtxt` a bit. It also allows us to delete a bit of hacky code from anon const `type_of` which was there to detect `sym fn` operands specifically. This also could be generalized to support `const` asm operands with types with lifetimes in them. Since we specifically reject these consts today, I'm not going to change the representation of those consts (but they'd just be turned into inline consts). r? oli-obk -- mostly b/c you're patient and also understand the breadth of the code that this touches, please reassign if you don't want to review this. Fixes #111709 Fixes #96304 Fixes #137179
2025-02-22Make a fake body to store typeck results for global_asmMichael Goulet-46/+0
2025-02-21Do not deduplicate list of associated types provided by dyn principalMichael Goulet-105/+0
2025-02-19Rework `OperandRef::extract_field` to stop calling `to_immediate_scalar` on ↵Scott McMurray-0/+33
things which are already immediates That means it stops trying to truncate things that are already `i1`s.