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 rust-lang#111039 - compiler-errors:foreign-span-rpitit, r=tmiasko
Encode def span for foreign return-position `impl Trait` in trait
Fixesrust-lang#111031, yet another def-span encoding issue :/
Includes a smaller repro than the issue, but I can confirm it ICEs:
```
query stack during panic:
#0 [def_span] looking up span for `rpitit::Foo::bar::{opaque#0}`
#1 [object_safety_violations] determining object safety of trait `rpitit::Foo`
rust-lang#2 [check_is_object_safe] checking if trait `rpitit::Foo` is object safe
rust-lang#3 [typeck] type-checking `main`
rust-lang#4 [used_trait_imports] finding used_trait_imports `main`
rust-lang#5 [analysis] running analysis passes on this crate
```
Luckily since this only affects nightly, this desn't need to be backported.
error[E0038]: the trait `Foo` cannot be made into an object
2
+
--> $DIR/foreign-dyn-error.rs:6:12
3
+
|
4
+
LL | let _: &dyn rpitit::Foo = todo!();
5
+
| ^^^^^^^^^^^^^^^^ `Foo` cannot be made into an object
6
+
|
7
+
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>
0 commit comments