You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #118247 - spastorino:type-equality-subtyping, r=<try>
Fix for TypeId exposes equality-by-subtyping vs normal-form-syntactic-equality unsoundness
Fixes#97156
This PR revives #97427 idea, it sits on top of #118118 because the idea uncovered some problems with IATs.
r? `@lcnr`
This is ICEing yet for `tests/ui/traits/new-solver/escaping-bound-vars-in-writeback-normalization.rs` using the new trait solver.
After #118118 and this ICE is fixed, we would need a rebase and a crater run.
Opening as a WIP for now.
| ------------------------------------- first implementation here
6
6
LL | impl<'a> Trait for fn(fn(&'a ())) {}
7
7
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'r> fn(fn(&'r ()))`
8
8
|
9
+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
10
+
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
9
11
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
12
+
= note: `#[warn(coherence_leak_check)]` on by default
10
13
11
-
error: aborting due to 1 previous error
14
+
warning: 1 warning emitted
12
15
13
-
For more information about this error, try `rustc --explain E0119`.
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
10
+
= note: for more information, see issue #56105 <https://github.com/rust-lang/rust/issues/56105>
9
11
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
12
+
= note: `#[warn(coherence_leak_check)]` on by default
10
13
11
-
error: aborting due to 1 previous error
14
+
warning: 1 warning emitted
12
15
13
-
For more information about this error, try `rustc --explain E0119`.
Copy file name to clipboardexpand all lines: tests/ui/const-generics/generic_const_exprs/typeid-equality-by-subtyping.stderr
+8-1
Original file line number
Diff line number
Diff line change
@@ -7,5 +7,12 @@ LL | WHAT_A_TYPE => 0,
7
7
= note: the traits must be derived, manual `impl`s are not sufficient
8
8
= note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
9
9
10
-
error: aborting due to 1 previous error
10
+
error[E0277]: the trait bound `for<'a, 'b> fn(&'a (), &'b ()): WithAssoc<T>` is not satisfied
11
+
--> $DIR/typeid-equality-by-subtyping.rs:44:51
12
+
|
13
+
LL | fn unsound<T>(x: <One as WithAssoc<T>>::Assoc) -> <Two as WithAssoc<T>>::Assoc
14
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `WithAssoc<T>` is not implemented for `for<'a, 'b> fn(&'a (), &'b ())`
15
+
16
+
error: aborting due to 2 previous errors
11
17
18
+
For more information about this error, try `rustc --explain E0277`.
0 commit comments