Commit 903823c
authored
Rollup merge of rust-lang#72493 - nikomatsakis:move-leak-check, r=matthewjasper
move leak-check to during coherence, candidate eval
Implementation of MCP rust-lang/compiler-team#295.
I'd like to do a crater run on this.
Note to @rust-lang/lang: This PR is a breaking change (bugfix). It causes tests like the following to go from a future-compatibility warning rust-lang#56105 to a hard error:
```rust
trait Trait {}
impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {}
impl Trait for for<'c> fn(&'c u32, &'c u32) {} // now rejected, used to warn
```
I am not aware of any instances of this code in the wild, but that is why we are doing a crater run. The reason for this change is that those two types are, in fact, the same type, and hence the two impls are overlapping.
There will still be impls that trigger rust-lang#56105 after this lands, however -- I hope that we will eventually just accept those impls without warning, for the most part. One example of such an impl is this pattern, which is used by wasm-bindgen and other crates as well:
```rust
trait Trait {}
impl<T> Trait for fn(&T) { }
impl<T> Trait for fn(T) { } // still accepted, but warns
```File tree
135 files changed
+2143
-1250
lines changed- src
- librustc_infer
- infer
- higher_ranked
- nll_relate
- region_constraints
- librustc_mir/borrow_check/type_check
- librustc_trait_selection/traits
- select
- librustc_typeck/check
- test
- mir-opt/address-of
- ui
- associated-types
- cache
- closure-expected-type
- closures
- coherence
- generator
- hr-subtype
- hrtb
- issues
- lub-glb
- mismatched_types
- regions
- type-alias-impl-trait
- unboxed-closures
- where-clauses
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
135 files changed
+2143
-1250
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | 51 | | |
54 | 52 | | |
55 | 53 | | |
| |||
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
106 | 116 | | |
107 | 117 | | |
108 | 118 | | |
| |||
119 | 129 | | |
120 | 130 | | |
121 | 131 | | |
122 | | - | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
135 | 144 | | |
136 | 145 | | |
137 | 146 | | |
138 | | - | |
| 147 | + | |
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
994 | | - | |
995 | | - | |
| 994 | + | |
| 995 | + | |
996 | 996 | | |
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
1000 | | - | |
1001 | | - | |
1002 | 1000 | | |
1003 | 1001 | | |
1004 | 1002 | | |
| |||
1008 | 1006 | | |
1009 | 1007 | | |
1010 | 1008 | | |
1011 | | - | |
1012 | | - | |
| 1009 | + | |
| 1010 | + | |
1013 | 1011 | | |
1014 | 1012 | | |
1015 | 1013 | | |
1016 | 1014 | | |
1017 | 1015 | | |
1018 | | - | |
1019 | 1016 | | |
1020 | 1017 | | |
1021 | 1018 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
526 | 532 | | |
527 | 533 | | |
528 | 534 | | |
| |||
0 commit comments