Skip to content

Commit 86a360d

Browse files
committed
Add a test for sibling items in trait impls
1 parent 0e5d7b8 commit 86a360d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(type_alias_impl_trait)]
2+
3+
type Foo = impl std::fmt::Debug;
4+
5+
trait Blah {
6+
type Output;
7+
fn method();
8+
}
9+
10+
impl Blah for u32 {
11+
type Output = Foo;
12+
fn method() {
13+
let x: Foo = 22_u32;
14+
//~^ ERROR: opaque type constrained without being represented in the signature
15+
}
16+
}
17+
18+
fn main() {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
error: opaque type constrained without being represented in the signature
2+
--> $DIR/almost_in_scope.rs:13:22
3+
|
4+
LL | fn method() {
5+
| ----------- this item must mention the opaque type in its signature or where bounds
6+
LL | let x: Foo = 22_u32;
7+
| ^^^^^^
8+
9+
error: aborting due to previous error
10+

0 commit comments

Comments
 (0)