]> git.lizzy.rs Git - rust.git/commit - compiler/rustc_codegen_cranelift/build_system/tests.rs
Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errors
authorMatthias Krüger <matthias.krueger@famsik.de>
Thu, 15 Dec 2022 11:46:00 +0000 (12:46 +0100)
committerGitHub <noreply@github.com>
Thu, 15 Dec 2022 11:46:00 +0000 (12:46 +0100)
commitc00eac355845637b604d3b0225e5416430776e21
tree19a257317926672f232115b8d35e2e78ac824694
parentd67000e44e1b9908c81fc4d5de875608f1b80ae9
parentda98ef9a5d0b8a4fb90e1d845506880fae9e7352
Rollup merge of #104592 - ComputerDruid:async_check, r=compiler-errors

Ensure async trait impls are async (or otherwise return an opaque type)

As a workaround for the full `#[refine]` semantics not being implemented
yet, forbit returning a concrete future type like `Box<dyn Future>` or a
manually implemented Future.

`-> impl Future` is still permitted; while that can also cause
accidental refinement, that's behind a different feature gate
(`return_position_impl_trait_in_trait`) and that problem exists
regardless of whether the trait method is async, so will have to be
solved more generally.

Fixes https://github.com/rust-lang/rust/issues/102745
compiler/rustc_hir_analysis/src/check/compare_method.rs