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
Rollup merge of #132243 - compiler-errors:no-span, r=jieyouxu
Remove `ObligationCause::span()` method
I think it's an incredibly confusing footgun to expose both `obligation_cause.span` and `obligation_cause.span()`. Especially because `ObligationCause::span()` (the method) seems to just be hacking around a single quirk in the way we set up obligation causes for match arms.
First commit removes the need for that hack, with only one diagnostic span changing (but IMO not really getting worse -- I'd argue that it was already confusing).
Copy file name to clipboardexpand all lines: tests/ui/wf/wf-dyn-incompat-trait-obj-match.stderr
+3-7
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,10 @@ LL | trait Trait: Sized {}
31
31
= note: required for the cast from `&S` to `&dyn Trait`
32
32
33
33
error[E0038]: the trait `Trait` cannot be made into an object
34
-
--> $DIR/wf-dyn-incompat-trait-obj-match.rs:25:25
34
+
--> $DIR/wf-dyn-incompat-trait-obj-match.rs:27:17
35
35
|
36
-
LL | let t: &dyn Trait = match opt() {
37
-
| _________________________^
38
-
LL | | Some(()) => &S,
39
-
LL | | None => &R,
40
-
LL | | };
41
-
| |_____^ `Trait` cannot be made into an object
36
+
LL | None => &R,
37
+
| ^^ `Trait` cannot be made into an object
42
38
|
43
39
note: for a trait to be "dyn-compatible" 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>
0 commit comments