-error[E0658]: `async` blocks are not allowed in constants
+error[E0308]: mismatched types
--> $DIR/issue-78722.rs:12:20
|
+LL | type F = impl core::future::Future<Output = u8>;
+ | -------------------------------------- the expected opaque type
+...
LL | let f: F = async { 1 };
- | ^^^^^^^^^^^
+ | - ^^^^^^^^^^^ expected opaque type, found a different opaque type
+ | |
+ | expected due to this
|
- = note: see issue #85368 <https://github.com/rust-lang/rust/issues/85368> for more information
- = help: add `#![feature(const_async_blocks)]` to the crate attributes to enable
-
-error[E0493]: destructors cannot be evaluated at compile-time
- --> $DIR/issue-78722.rs:12:13
+ ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
|
-LL | let f: F = async { 1 };
- | ^ constants cannot evaluate destructors
-...
-LL | }],
- | - value is dropped here
+LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
+ | ------------------------------- the found opaque type
+ |
+ = note: expected opaque type `impl Future<Output = u8>`
+ found opaque type `impl Future`
+ = note: distinct uses of `impl Trait` result in different opaque types
-error: aborting due to 2 previous errors
+error: aborting due to previous error
-Some errors have detailed explanations: E0493, E0658.
-For more information about an error, try `rustc --explain E0493`.
+For more information about this error, try `rustc --explain E0308`.