Skip to content

Commit

Permalink
Add broken test for AFIT with RPITIT
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 12, 2022
1 parent 9a5936b commit 0eeeea9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// known-bug: #102688
// edition:2021

#![feature(async_fn_in_trait, return_position_impl_trait_in_trait)]
#![allow(incomplete_features)]

use std::fmt::Debug;

trait Foo {
async fn baz(&self) -> impl Debug {
""
}
}

struct Bar;

impl Foo for Bar {}

fn main() {
let _ = Bar.baz();
}
12 changes: 12 additions & 0 deletions src/test/ui/impl-trait/in-trait/default-body-with-rpit.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0720]: cannot resolve opaque type
--> $DIR/default-body-with-rpit.rs:10:28
|
LL | async fn baz(&self) -> impl Debug {
| ^^^^^^^^^^ cannot resolve opaque type
|
= note: these returned values have a concrete "never" type
= help: this error will resolve once the item's body returns a concrete type

error: aborting due to previous error

For more information about this error, try `rustc --explain E0720`.

0 comments on commit 0eeeea9

Please sign in to comment.