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 #120847 - oli-obk:track_errors9, r=compiler-errors
Continue compilation after check_mod_type_wf errors
The ICEs fixed here were probably reachable through const eval gymnastics before, but now they are easily reachable without that, too.
The new errors are often bugfixes, where useful errors were missing, because they were reported after the early abort. In other cases sometimes they are just duplication of already emitted errors, which won't be user-visible due to deduplication.
fixes#120860
Copy file name to clipboardexpand all lines: tests/ui/associated-consts/associated-const-in-trait.stderr
+16-1
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,21 @@ LL | const N: usize;
13
13
| ^ ...because it contains this associated `const`
14
14
= help: consider moving `N` to another trait
15
15
16
-
error: aborting due to 1 previous error
16
+
error[E0038]: the trait `Trait` cannot be made into an object
17
+
--> $DIR/associated-const-in-trait.rs:9:29
18
+
|
19
+
LL | const fn n() -> usize { Self::N }
20
+
| ^^^^ `Trait` cannot be made into an object
21
+
|
22
+
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
23
+
--> $DIR/associated-const-in-trait.rs:4:11
24
+
|
25
+
LL | trait Trait {
26
+
| ----- this trait cannot be made into an object...
27
+
LL | const N: usize;
28
+
| ^ ...because it contains this associated `const`
29
+
= help: consider moving `N` to another trait
30
+
31
+
error: aborting due to 2 previous errors
17
32
18
33
For more information about this error, try `rustc --explain E0038`.
0 commit comments