Commit 2fd1af3
committed
Auto merge of #55994 - alexreg:fix-trait-alias-1, r=nikomatsakis
Disallow multiple regular traits in trait objects when trait aliases used
This ensures code like the following fails to compile.
```rust
#![feature(trait_alias)]
trait Foo = std::io::Read + std::io::Write;
fn main() {
let foo: Box<dyn Foo>;
}
```
CC @nikomatsakis @scalexmFile tree
15 files changed
+277
-160
lines changed- src
- liballoc
- librustc_save_analysis
- librustc_typeck
- check
- method
- librustc
- hir
- map
- infer/outlives
- traits
- ty
- libsyntax
- test/ui/error-codes
15 files changed
+277
-160
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
| 386 | + | |
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
| 818 | + | |
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
2039 | 2039 | | |
2040 | 2040 | | |
2041 | 2041 | | |
2042 | | - | |
| 2042 | + | |
2043 | 2043 | | |
2044 | | - | |
2045 | | - | |
2046 | | - | |
2047 | | - | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
2048 | 2048 | | |
2049 | 2049 | | |
2050 | 2050 | | |
| |||
2054 | 2054 | | |
2055 | 2055 | | |
2056 | 2056 | | |
2057 | | - | |
| 2057 | + | |
2058 | 2058 | | |
2059 | 2059 | | |
2060 | | - | |
| 2060 | + | |
2061 | 2061 | | |
2062 | 2062 | | |
2063 | 2063 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
1017 | 1018 | | |
1018 | 1019 | | |
1019 | 1020 | | |
1020 | | - | |
| 1021 | + | |
1021 | 1022 | | |
1022 | 1023 | | |
1023 | 1024 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
1759 | 1758 | | |
1760 | 1759 | | |
1761 | 1760 | | |
1762 | | - | |
| 1761 | + | |
| 1762 | + | |
1763 | 1763 | | |
1764 | 1764 | | |
1765 | 1765 | | |
| |||
0 commit comments