Don't ice on bad transmute in typeck in new solver · rust-lang/rust@96285bd (original) (raw)
``
1
`` +
error[E0277]: the trait bound for<'a> (): Trait<'a>
is not satisfied
``
``
2
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:7:11
`
``
3
`+
|
`
``
4
`+
LL | fn foo(x: for<'a> fn(<() as Trait<'a>>::Assoc)) {
`
``
5
`` +
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait for<'a> Trait<'a>
is not implemented for ()
``
``
6
`+
|
`
``
7
`+
help: this trait has no implementations, consider adding one
`
``
8
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:3:1
`
``
9
`+
|
`
``
10
`+
LL | trait Trait<'a> {
`
``
11
`+
| ^^^^^^^^^^^^^^^
`
``
12
+
``
13
`` +
error[E0277]: the trait bound for<'a> (): Trait<'a>
is not satisfied
``
``
14
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:7:8
`
``
15
`+
|
`
``
16
`+
LL | fn foo(x: for<'a> fn(<() as Trait<'a>>::Assoc)) {
`
``
17
`` +
| ^ the trait for<'a> Trait<'a>
is not implemented for ()
``
``
18
`+
|
`
``
19
`+
help: this trait has no implementations, consider adding one
`
``
20
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:3:1
`
``
21
`+
|
`
``
22
`+
LL | trait Trait<'a> {
`
``
23
`+
| ^^^^^^^^^^^^^^^
`
``
24
+
``
25
`` +
error[E0277]: the trait bound for<'a> (): Trait<'a>
is not satisfied
``
``
26
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:11:14
`
``
27
`+
|
`
``
28
`+
LL | unsafe { std::mem::transmute::<_, ()>(x); }
`
``
29
`` +
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait for<'a> Trait<'a>
is not implemented for ()
``
``
30
`+
|
`
``
31
`+
help: this trait has no implementations, consider adding one
`
``
32
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:3:1
`
``
33
`+
|
`
``
34
`+
LL | trait Trait<'a> {
`
``
35
`+
| ^^^^^^^^^^^^^^^
`
``
36
+
``
37
`` +
error[E0277]: the trait bound for<'a> (): Trait<'a>
is not satisfied
``
``
38
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:11:36
`
``
39
`+
|
`
``
40
`+
LL | unsafe { std::mem::transmute::<_, ()>(x); }
`
``
41
`` +
| ^ the trait for<'a> Trait<'a>
is not implemented for ()
``
``
42
`+
|
`
``
43
`+
help: this trait has no implementations, consider adding one
`
``
44
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:3:1
`
``
45
`+
|
`
``
46
`+
LL | trait Trait<'a> {
`
``
47
`+
| ^^^^^^^^^^^^^^^
`
``
48
+
``
49
`` +
error[E0277]: the trait bound for<'a> (): Trait<'a>
is not satisfied
``
``
50
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:11:43
`
``
51
`+
|
`
``
52
`+
LL | unsafe { std::mem::transmute::<_, ()>(x); }
`
``
53
`` +
| ^ the trait for<'a> Trait<'a>
is not implemented for ()
``
``
54
`+
|
`
``
55
`+
help: this trait has no implementations, consider adding one
`
``
56
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:3:1
`
``
57
`+
|
`
``
58
`+
LL | trait Trait<'a> {
`
``
59
`+
| ^^^^^^^^^^^^^^^
`
``
60
+
``
61
`` +
error[E0277]: the trait bound for<'a> (): Trait<'a>
is not satisfied
``
``
62
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:7:1
`
``
63
`+
|
`
``
64
`+
LL | fn foo(x: for<'a> fn(<() as Trait<'a>>::Assoc)) {
`
``
65
`` +
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait for<'a> Trait<'a>
is not implemented for ()
``
``
66
`+
|
`
``
67
`+
help: this trait has no implementations, consider adding one
`
``
68
`+
--> $DIR/dont-ice-on-bad-transmute-in-typeck.rs:3:1
`
``
69
`+
|
`
``
70
`+
LL | trait Trait<'a> {
`
``
71
`+
| ^^^^^^^^^^^^^^^
`
``
72
+
``
73
`+
error: aborting due to 6 previous errors
`
``
74
+
``
75
`` +
For more information about this error, try rustc --explain E0277
.
``