rust/tests/crashes
bors 5753b30676 Auto merge of #117967 - adetaylor:fix-lifetime-elision-bug, r=lcnr
Fix ambiguous cases of multiple & in elided self lifetimes

This change proposes simpler rules to identify the lifetime on `self` parameters which may be used to elide a return type lifetime.

## The old rules

(copied from [this comment](https://github.com/rust-lang/rust/pull/117967#discussion_r1420554242))

Most of the code can be found in [late.rs](https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_resolve/late.rs.html) and acts on AST types. The function [resolve_fn_params](https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_resolve/late.rs.html#2006), in the success case, returns a single lifetime which can be used to elide the lifetime of return types.

Here's how:
* If the first parameter is called self then we search that parameter using "`self` search rules", below
* If no unique applicable lifetime was found, search all other parameters using "regular parameter search rules", below

(In practice the code does extra work to assemble good diagnostic information, so it's not quite laid out like the above.)

### `self` search rules

This is primarily handled in [find_lifetime_for_self](https://doc.rust-lang.org/stable/nightly-rustc/src/rustc_resolve/late.rs.html#2118) , and is described slightly [here](https://github.com/rust-lang/rust/issues/117715#issuecomment-1813115477) already. The code:

1. Recursively walks the type of the `self` parameter (there's some complexity about resolving various special cases, but it's essentially just walking the type as far as I can see)
2. Each time we find a reference anywhere in the type, if the **direct** referent is `Self` (either spelled `Self` or by some alias resolution which I don't fully understand), then we'll add that to a set of candidate lifetimes
3. If there's exactly one such unique lifetime candidate found, we return this lifetime.

### Regular parameter search rules

1. Find all the lifetimes in each parameter, including implicit, explicit etc.
2. If there's exactly one parameter containing lifetimes, and if that parameter contains exactly one (unique) lifetime, *and if we didn't find a `self` lifetime parameter already*, we'll return this lifetime.

## The new rules

There are no changes to the "regular parameter search rules" or to the overall flow, only to the `self` search rules which are now:

1. Recursively walks the type of the `self` parameter, searching for lifetimes of reference types whose referent **contains** `Self`.[^1]
2. Keep a record of:
   * Whether 0, 1 or n unique lifetimes are found on references encountered during the walk
4. If no lifetime was found, we don't return a lifetime. (This means other parameters' lifetimes may be used for return type lifetime elision).
5. If there's one lifetime found, we return the lifetime.
6. If multiple lifetimes were found, we abort elision entirely (other parameters' lifetimes won't be used).

[^1]: this prevents us from considering lifetimes from inside of the self-type

## Examples that were accepted before and will now be rejected

```rust
fn a(self: &Box<&Self>) -> &u32
fn b(self: &Pin<&mut Self>) -> &String
fn c(self: &mut &Self) -> Option<&Self>
fn d(self: &mut &Box<Self>, arg: &usize) -> &usize // previously used the lt from arg
```

### Examples that change the elided lifetime

```rust
fn e(self: &mut Box<Self>, arg: &usize) -> &usize
//         ^ new                ^ previous
```

## Examples that were rejected before and will now be accepted

```rust
fn f(self: &Box<Self>) -> &u32
```

---

*edit: old PR description:*

```rust
  struct Concrete(u32);

  impl Concrete {
      fn m(self: &Box<Self>) -> &u32 {
          &self.0
      }
  }
```

resulted in a confusing error.

```rust
  impl Concrete {
      fn n(self: &Box<&Self>) -> &u32 {
          &self.0
      }
  }
```

resulted in no error or warning, despite apparent ambiguity over the elided lifetime.

Fixes https://github.com/rust-lang/rust/issues/117715
2024-07-18 13:33:38 +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
74299.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
97501.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
101962.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +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
110630.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
111419.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
111699.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +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
115808.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
115994.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
116308.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +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
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
117829-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117829.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
117942.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
118320.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +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
118987-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
118987.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119272.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119299.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +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
119716-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
119716.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
119924-6.rs Migrate tests to use -Znext-solver 2024-06-30 17:08:45 +00:00
120033.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
120241-2.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
120241.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
120254.rs crashes: add a couple more tests 2024-04-18 18:55:20 +02:00
120482.rs crashes: fix ice detection which did not trigger if code compiled without error by accident 2024-04-14 11:21:58 +02:00
120792.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
120793-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
120793.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +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
121052.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121063.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
121097.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121127.rs The ICE in 121127 needs debuginfo 2024-04-18 09:42:26 -07:00
121161.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121263-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121263.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121299.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02: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
121422.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
121444.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
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
121613-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121613.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
121722.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121799.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121816.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
121957-1.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02:00
121957-2.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +02: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
122909.rs add .rs crashes from https://github.com/rust-lang/glacier 2024-04-14 11:18:23 +02:00
122914.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
123134.rs tests/crashes: add ICEs from matthiaskrgr/glacier2 2024-04-14 11:21:51 +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
123690.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
123693.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02:00
123809.rs crashes: add even more tests?!? 2024-04-18 06:13:47 +02: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
123955.rs crashes: add a couple more ICE tests 2024-04-21 21:04:32 +02: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
124092.rs crashes: add a couple more ICE tests 2024-04-21 21:04:32 +02:00
124164.rs add more known-crashes tests 2024-04-19 23:09:37 +02:00
124182.rs crashes: add a couple more ICE tests 2024-04-21 21:04:32 +02:00
124189.rs crashes: add a couple more ICE tests 2024-04-21 21:04:32 +02:00
124207.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 crashes: add more tests 2024-04-26 17:20:16 +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
124894.rs crashes: add more 2024-05-18 23:56:57 +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 remove fixed crashes, add fixed crashes to tests, add new cashed found in the meantime 2024-05-27 20:41:09 +02:00
125512.rs crashes: increment the number of tracked ones 2024-05-27 17:32:56 +02: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
125655.rs tests: add more crashes 2024-06-09 10:16:12 +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
125843.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
125881.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 more ice tests 2024-06-16 20:38:08 +02:00
126269.rs more ice tests 2024-06-16 20:38:08 +02:00
126272.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
126377.rs more ice tests 2024-06-16 20:38:08 +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
126896.rs crashes: add latest 2024-07-04 23:44:10 +02:00
126939.rs crashes: add latest 2024-07-04 23:44:10 +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
126966.rs crashes: add latest 2024-07-04 23:44:10 +02:00
126969.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
127222.rs crashes: add latest 2024-07-04 23:44:10 +02:00
127299.rs crashes: add latest 2024-07-04 23:44:10 +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.