rust/tests/crashes
bors 1d4a7670d4 Auto merge of #131985 - compiler-errors:const-pred, r=fee1-dead
Represent trait constness as a distinct predicate

cc `@rust-lang/project-const-traits`
r? `@ghost` for now

Also mirrored everything that is written below on this hackmd here: https://hackmd.io/`@compiler-errors/r12zoixg1l`

# Tl;dr:

* This PR removes the bulk of the old effect desugaring.
* This PR reimplements most of the effect desugaring as a new predicate and set of a couple queries. I believe it majorly simplifies the implementation and allows us to move forward more easily on its implementation.

I'm putting this up both as a request for comments and a vibe-check, but also as a legitimate implementation that I'd like to see land (though no rush of course on that last part).

## Background

### Early days

Once upon a time, we represented trait constness in the param-env and in `TraitPredicate`. This was very difficult to implement correctly; it had bugs and was also incomplete; I don't think this was anyone's fault though, it was just the limit of experimental knowledge we had at that point.

Dealing with `~const` within predicates themselves meant dealing with constness all throughout the trait solver. This was difficult to keep track of, and afaict was not handled well with all the corners of candidate assembly.

Specifically, we had to (in various places) remap constness according to the param-env constness:

574b64a97f/compiler/rustc_trait_selection/src/traits/select/mod.rs (L1498)

This was annoying and manual and also error prone.

### Beginning of the effects desugaring

Later on, #113210 reimplemented a new desugaring for const traits via a `<const HOST: bool>` predicate. This essentially "reified" the const checking and separated it from any of the remapping or separate tracking in param-envs. For example, if I was in a const-if-const environment, but I wanted to call a trait that was non-const, this reification would turn the constness mismatch into a simple *type* mismatch of the effect parameter.

While this was a monumental step towards straightening out const trait checking in the trait system, it had its own issues, since that meant that the constness of a trait (or any item within it, like an associated type) was *early-bound*. This essentially meant that `<T as Trait>::Assoc` was *distinct* from `<T as ~const Trait>::Assoc`, which was bad.

### Associated-type bound based effects desugaring

After this, #120639 implemented a new effects desugaring. This used an associated type to more clearly represent the fact that the constness is not an input parameter of a trait, but a property that could be computed of a impl. The write-up linked in that PR explains it better than I could.

However, I feel like it really reached the limits of what can comfortably be expressed in terms of associated type and trait calculus. Also, `<const HOST: bool>` remains a synthetic const parameter, which is observable in nested items like RPITs and closures, and comes with tons of its own hacks in the astconv and middle layer.

For example, there are pieces of unintuitive code that are needed to represent semantics like elaboration, and eventually will be needed to make error reporting intuitive, and hopefully in the future assist us in implementing built-in traits (eventually we'll want something like `~const Fn` trait bounds!).

elaboration hack: 8069f8d17a/compiler/rustc_type_ir/src/elaborate.rs (L133-L195)

trait bound remapping hack for diagnostics: 8069f8d17a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs (L2370-L2413)

I want to be clear that I don't think this is a issue of implementation quality or anything like that; I think it's simply a very clear sign that we're using types and traits in a way that they're not fundamentally supposed to be used, especially given that constness deserves to be represented as a first-class concept.

### What now?

This PR implements a new desugaring for const traits. Specifically, it introduces a `HostEffect` predicate to represent the obligation an impl is const, rather than using associated type bounds and the compat trait that exists for effects today.

### `HostEffect` predicate

A `HostEffect` clause has two parts -- the `TraitRef` we're trying to prove, and a `HostPolarity::{Maybe, Const}`.

`HostPolarity::Const` corresponds to `T: const Trait` bounds, which must *always* be proven as const, and which can be written in any context. These are lowered directly into the predicates of an item, since they're not "context-specific".

On the other hand, `HostPolarity::Maybe` corresponds to `T: ~const Trait` bounds which must only exist in a conditionally-const context like a method in a `#[const_trait]`, or a `const fn` free function. We do not lower these immediately into the predicates of an item; instead, we collect them into a new query called the **`const_conditions`**. These are the set of trait refs that we need to prove have const implementations for an item to be const.

Notably, they're represented as bare (poly) trait refs because they are meant to be paired back together with a `HostPolarity` when they're being registered in typeck (see next section).

For example, given:

```rust
const fn foo<T: ~const A + const B>() {}
```

`foo`'s const conditions would contain `T: A`, but not `T: B`. On the flip side, foo's predicates (`predicates_of`) query would contain `HostEffect(T: B, HostPolarity::Const)` but not `HostEffect(T: A, HostPolarity::Maybe)` since we don't need to prove that predicate in a non-const environment (and it's not even the right predicate to prove in an unconditionally const environment).

### Type checking const bodies

When type checking bodies in HIR, when we encounter a call expression, we additionally register the callee item's const conditions with the `HostPolarity` from the body we're typechecking (`Const` for unconditionally const things like `const`/`static` items, and `Maybe` for conditionally const things like const fns; and we don't register `HostPolarity` predicates for non-const bodies).

When type-checking a conditionally const body, we augment its param-env with `HostEffect(..., Maybe)` predicates.

### Checking that const impls are WF

We extend the logic in `compare_method_predicate_entailment` to also check the const-conditions of the impl method, to make sure that we error for:

```rust
#[const_trait] Bar {}
#[const_trait] trait Foo {
    fn method<T: Bar>();
}

impl Foo for () {
    fn method<T: ~const Bar>() {} // stronger assumption!
}
```

We also extend the WF check for impls to register the const conditions of the trait that is being implemented. This is to make sure we error for:

```rust
#[const_trait] trait Bar {}
#[const_trait] trait Foo<T> where T: ~const Bar {}

impl<T> const Foo<T> for () {}
//~^ `T: ~const Bar` is missing!
```

### Proving a `HostEffect` predicate

We have several ways of proving a `HostEffect` predicate:

1. Matching a `HostEffect` predicate from the param-env
2. From an impl - we do impl selection very similar to confirming a trait goal, except we filter for only const impls, and we additionally register the impl's const conditions (i.e. the impl's `~const` where clauses).

Later I expect that we will add more built-in implementations for things like `Fn`.

## What next?

After this PR, I'd like to split out the work more so it can proceed in parallel and probably amongst others that are not me.

* Register `HostEffect` goal for places in HIR typeck that correspond to call terminators, like autoderef.
* Make traits in libstd const again.
    * Probably need to impl host effect preds in old solver.
* Implement built-in `HostEffect` rules for traits like `Fn`.
* Rip out const checking from MIR altogether.

## So what?

This ends up being super convenient basically everywhere in the compiler. Due to the design of the new trait solver, we end up having an almost parallel structure to the existing trait and projection predicates for assembling `HostEffect` predicates; adding new candidates and especially new built-in implementations is now basically trivial, and it's quite straightforward to understand the confirmation logic for these predicates.

Same with diagnostics reporting; since we have predicates which represent the obligation to prove an impl is const, we can simplify and make these diagnostics richer without having to write a ton of logic to intercept and rewrite the existing `Compat` trait errors.

Finally, it gives us a much more straightforward path for supporting the const effect on the old trait solver. I'm personally quite passionate about getting const trait support into the hands of users without having to wait until the new solver lands[^1], so I think after this PR lands we can begin to gauge how difficult it would be to implement constness in the old trait solver too. This PR will not do this yet.

[^1]: Though this is not a prerequisite or by any means the only justification for this PR.
2024-10-24 17:33:42 +00:00
..
23707.rs crashes: limit a couple tests to only run on x86_64 and/or not on windows 2024-04-14 23:53:39 +02:00
34127.rs crashes: limit a couple tests to only run on x86_64 and/or not on windows 2024-04-14 23:53:39 +02:00
54888.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
57276.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
74451.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
79409.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
79590.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
87577.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
88296.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
90110.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
91985.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
92004.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
92470.rs crashes: add more tests 2024-04-26 17:20:16 +02:00
93182.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
93237.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
94846.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
95134.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
96304.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
98322.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
100041.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
100618.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
101036.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
101557.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
102047.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
102252.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
103708.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
103899.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
104685.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
105238-1.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
105238-2.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
105249.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
105275.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
105299.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
105937.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
106473.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
107362.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
108499.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
108814.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
109681.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
110378.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
110534.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
110627.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
111419.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
111709-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
111709.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
111742.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
112201.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
112623.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
113280.rs crashes: limit a couple tests to only run on x86_64 and/or not on windows 2024-04-14 23:53:39 +02:00
113379.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
113846.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
114198-2.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
114198.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
114212-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
114212.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
114317.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
114484.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
114663.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
114920.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
115435.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
115994.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
116519-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
116519.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
116554.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
116947.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117392-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117392.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117460.rs add crashtests for several old unfixed ICEs 2024-08-30 12:50:07 +02:00
117496.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117629.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117696-1.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117696-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117795.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
118038.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
118244.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
118545.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
118590.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
118603.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
118952-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
118952.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119095.rs add crashtests for several old unfixed ICEs 2024-08-30 12:50:07 +02:00
119692.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
119694.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119701.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119729.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119783.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119786.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119824.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
120016.rs more crash tests 2024-09-18 00:10:25 +02:00
120033.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
120254.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
120811.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
120873.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
120911.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121097.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121127.rs Make validate_mir pull optimized/ctfe MIR for all bodies 2024-08-03 15:18:09 -04:00
121363.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
121411.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121429.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121538.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
121575.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121623.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121858.rs Partially implement ConstArgHasType 2024-05-29 17:06:54 +01:00
121963.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122259.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
122529.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122630.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
122681.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122704.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122710.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122823.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122903-1.rs Adjust crash bug to still reproduce. 2024-05-31 11:04:32 +00:00
122904-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
122904.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
123077-2.rs crashes: limit a couple tests to only run on x86_64 and/or not on windows 2024-04-14 23:53:39 +02:00
123140.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
123141.rs Partially implement ConstArgHasType 2024-05-29 17:06:54 +01:00
123157.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
123456.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
123629.rs add a few more crashtests 2024-09-01 22:28:23 +02:00
123690.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
123809.rs Mark Parser::eat/check methods as must_use 2024-07-29 21:29:08 -04:00
123810.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
123887.rs crashes: increment the number of tracked ones 2024-05-27 17:32:56 +02:00
123893.rs Give inlining bonuses to things that optimize out 2024-06-19 21:35:37 -07:00
123959.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
124020.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
124021.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
124189.rs crashes: add a couple more ICE tests 2024-04-21 21:04:32 +02:00
124340.rs crashes: add more tests 2024-04-26 17:20:16 +02:00
124350.rs crashes: add more tests 2024-04-26 17:20:16 +02:00
124352.rs crashes: add more tests 2024-04-26 17:20:16 +02:00
124375.rs more asm! -> naked_asm! in tests 2024-10-06 18:12:25 +02:00
124436.rs crashes: add lastest batch of crash tests 2024-05-05 23:41:08 +02:00
124440.rs crashes: add lastest batch of crash tests 2024-05-05 23:41:08 +02:00
124751.rs crashes: add lastest batch of crash tests 2024-05-05 23:41:08 +02:00
125014.rs crashes: increment the number of tracked ones 2024-05-27 17:32:56 +02:00
125059.rs crashes: increment the number of tracked ones 2024-05-27 17:32:56 +02:00
125185.rs crashes: add more 2024-05-18 23:56:57 +02:00
125249.rs Change RTN to use .. again 2024-06-28 14:20:43 -04:00
125323.rs crashes: increment the number of tracked ones 2024-05-27 17:32:56 +02:00
125476.rs Keep object-size-dependent tests failing 2024-09-19 16:23:38 -07:00
125553.rs remove fixed crashes, add fixed crashes to tests, add new cashed found in the meantime 2024-05-27 20:41:09 +02:00
125680.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125758.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125768.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125769.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125772.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125801.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125810.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125841.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125874.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125879.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
125957.rs tests: add more crashes 2024-06-09 10:16:12 +02:00
126182.rs more ice tests 2024-06-16 20:38:08 +02:00
126267.rs safe transmute: Rename BikeshedIntrinsicFrom to TransmuteFrom 2024-08-27 14:05:54 +00:00
126269.rs more ice tests 2024-06-16 20:38:08 +02:00
126359.rs more ice tests 2024-06-16 20:38:08 +02:00
126443.rs add crashtests for several old unfixed ICEs 2024-08-30 12:50:07 +02:00
126646.rs crashes: add more tests 2024-06-29 09:33:28 +02:00
126667.rs crashes: add more tests 2024-06-29 09:33:28 +02:00
126680.rs crashes: add more tests 2024-06-29 09:33:28 +02:00
126696.rs crashes: add more tests 2024-06-29 09:33:28 +02:00
126725.rs crashes: add more tests 2024-06-29 09:33:28 +02:00
126850.rs crashes: add more tests 2024-06-29 09:33:28 +02:00
126942.rs crashes: add latest 2024-07-04 23:44:10 +02:00
126944.rs crashes: add latest 2024-07-04 23:44:10 +02:00
126982.rs crashes: add latest 2024-07-04 23:44:10 +02:00
127033.rs add a few more crashtests 2024-09-01 22:28:23 +02:00
127351.rs add more tests 2024-07-21 17:50:57 +02:00
127353.rs add more tests 2024-07-21 17:50:57 +02:00
127628.rs add more tests 2024-07-21 17:50:57 +02:00
127643.rs add more tests 2024-07-21 17:50:57 +02:00
127676.rs add more tests 2024-07-21 17:50:57 +02:00
127742.rs add more tests 2024-07-21 17:50:57 +02:00
127804.rs more crash tests 2024-09-18 00:10:25 +02:00
127916.rs add more tests 2024-07-21 17:50:57 +02:00
127972.rs Retroactively feature gate ConstArgKind::Path 2024-08-19 01:14:22 +01:00
128094.rs tests: more crashes 2024-08-04 21:25:49 +02:00
128097.rs add crashtests for several old unfixed ICEs 2024-08-30 12:50:07 +02:00
128119.rs more crash tests 2024-09-18 00:10:25 +02:00
128176.rs Rename feature object_safe_for_dispatch to dyn_compatible_for_dispatch 2024-10-10 00:57:59 +02:00
128190.rs tests: more crashes 2024-08-04 21:25:49 +02:00
128232.rs more crash tests 2024-09-18 00:10:25 +02:00
128346.rs tests: more crashes 2024-08-04 21:25:49 +02:00
128695.rs crashes: more tests 2024-08-15 22:44:16 +02:00
129075.rs crashes: more tests 2024-08-15 22:44:16 +02:00
129095.rs crashes: more tests 2024-08-15 22:44:16 +02:00
129109.rs crashes: more tests 2024-08-15 22:44:16 +02:00
129127.rs crashes: more tests 2024-08-15 22:44:16 +02:00
129150.rs crashes: more tests 2024-08-19 00:38:28 +02:00
129209.rs crashes: more tests 2024-08-19 00:38:28 +02:00
129214.rs crashes: more tests 2024-08-19 00:38:28 +02:00
129372.rs add a few more crashtests 2024-09-01 22:28:23 +02:00
129425.rs couple more crash tests 2024-08-30 12:38:22 +02:00
129444.rs couple more crash tests 2024-08-30 12:38:22 +02:00
129556.rs couple more crash tests 2024-08-30 12:38:22 +02:00
130104.rs tests: more ice tests 2024-09-15 21:18:41 +02:00
130310.rs Revert "Add recursion limit to FFI safety lint" 2024-09-23 12:43:44 -04:00
130346.rs tests: more ice tests 2024-09-15 21:18:41 +02:00
130411.rs more crash tests 2024-09-18 00:10:25 +02:00
130425.rs more crash tests 2024-09-18 00:10:25 +02:00
130521.rs Rename feature object_safe_for_dispatch to dyn_compatible_for_dispatch 2024-10-10 00:57:59 +02:00
130524.rs crashes: more tests 2024-09-29 11:58:09 +02:00
130627.rs crashes: more tests 2024-09-29 11:58:09 +02:00
130687.rs crashes: more tests 2024-09-29 11:58:09 +02:00
130779.rs crashes: more tests 2024-09-29 11:58:09 +02:00
130956.rs add more crash tests 2024-10-09 15:34:45 +02:00
130967.rs add more crash tests 2024-10-09 15:34:45 +02:00
130970.rs crashes: more tests 2024-09-29 11:58:09 +02:00
131046.rs add more crash tests 2024-10-09 15:34:45 +02:00
131048.rs add more crash tests 2024-10-09 15:34:45 +02:00
131050.rs add more crash tests 2024-10-09 15:34:45 +02:00
131052.rs add more crash tests 2024-10-09 15:34:45 +02:00
131101.rs add more crash tests 2024-10-09 15:34:45 +02:00
131102.rs add more crash tests 2024-10-09 15:34:45 +02:00
131103.rs add more crash tests 2024-10-09 15:34:45 +02:00
131227.rs add more crash tests 2024-10-09 15:34:45 +02:00
131292.rs add more crash tests 2024-10-09 15:34:45 +02:00
131294-2.rs add more crash tests 2024-10-09 15:34:45 +02:00
131294.rs add more crash tests 2024-10-09 15:34:45 +02:00
131295.rs add more crash tests 2024-10-09 15:34:45 +02:00
131298.rs add more crash tests 2024-10-09 15:34:45 +02:00
131342-2.rs add more crash tests 2024-10-09 15:34:45 +02:00
131342.rs add more crash tests 2024-10-09 15:34:45 +02:00
131347.rs add more crash tests 2024-10-09 15:34:45 +02:00
131373.rs add more crash tests 2024-10-09 15:34:45 +02:00
131406.rs add more crash tests 2024-10-09 15:34:45 +02:00
131507.rs add latest crash tests 2024-10-12 11:29:38 +02:00
131534.rs add latest crash tests 2024-10-12 11:29:38 +02:00
131535.rs add latest crash tests 2024-10-12 11:29:38 +02:00
131538.rs add latest crash tests 2024-10-12 11:29:38 +02:00
131637.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131648.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131668.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131758.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131762.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131787.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131886.rs add latest crash tests 2024-10-20 10:05:39 +02:00
131915.rs add latest crash tests 2024-10-20 10:05:39 +02:00
const_mut_ref_check_bypass.rs turn errors that should be impossible due to our static checks into ICEs 2024-09-10 10:27:30 +02:00
README.md crashes: readme: add reminder to add Fixes #abcde to prs to automatically close issues. 2024-04-15 21:44:04 +02:00

This is serves as a collection of crashes so that accidental ICE fixes are tracked. This was formally done at https://github.com/rust-lang/glacier but doing it inside the rustc testsuite is more convenient.

It is imperative that a test in the suite causes an internal compiler error/panic or makes rustc crash in some other way. A test will "pass" if rustc exits with something other than 1 or 0.

When adding crashes from https://github.com/rust-lang/rust/issues, the issue number should be noted in the file name (12345.rs should suffice) and perhaps also inside the file via //@ known-bug #4321

If you happen to fix one of the crashes, please move it to a fitting subdirectory in tests/ui and give it a meaningful name. Also please add a doc comment at the top of the file explaining why this test exists. :) Adding Fixes #NNNNN Fixes #MMMMM to the description of your pull request will ensure the corresponding tickets will be closed automatically upon merge. The ticket ids can be found in the file name or the known-bug annotation inside the testfile.