mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-28 19:27:30 +03:00
Point at async fn return type instead of body in E0746
This commit is contained in:
@@ -1918,6 +1918,7 @@ pub(super) fn suggest_impl_trait(
|
||||
// and
|
||||
// async fn foo() -> dyn Display Box<dyn { .. }>
|
||||
span = fn_sig.decl.output.span();
|
||||
err.span(span);
|
||||
}
|
||||
let body = self.tcx.hir_body_owned_by(obligation.cause.body_id);
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
error[E0746]: return type cannot be a trait object without pointer indirection
|
||||
--> $DIR/dyn-in-return-type.rs:3:38
|
||||
--> $DIR/dyn-in-return-type.rs:3:17
|
||||
|
|
||||
LL | async fn f() -> dyn core::fmt::Debug {
|
||||
| ______________________________________^
|
||||
... |
|
||||
LL | | }
|
||||
| |_^ doesn't have a size known at compile-time
|
||||
LL | async fn f() -> dyn core::fmt::Debug {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
help: consider returning an `impl Trait` instead of a `dyn Trait`
|
||||
|
|
||||
|
||||
Reference in New Issue
Block a user