Skip to content

Commit 40d3819

Browse files
authored
Rollup merge of #90303 - WaffleLapkin:regression_test_90164, r=JohnTitor
Add regression test for issue 90164 Closes #90164 (previously fixed by #90181)
2 parents 76392fb + 60ffac0 commit 40d3819

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/test/ui/typeck/issue-90164.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn copy<R: Unpin, W>(_: R, _: W) {}
2+
3+
fn f<T>(r: T) {
4+
let w = ();
5+
copy(r, w);
6+
//~^ ERROR [E0277]
7+
}
8+
9+
fn main() {}

src/test/ui/typeck/issue-90164.stderr

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0277]: `T` cannot be unpinned
2+
--> $DIR/issue-90164.rs:5:10
3+
|
4+
LL | copy(r, w);
5+
| ---- ^ the trait `Unpin` is not implemented for `T`
6+
| |
7+
| required by a bound introduced by this call
8+
|
9+
= note: consider using `Box::pin`
10+
note: required by a bound in `copy`
11+
--> $DIR/issue-90164.rs:1:12
12+
|
13+
LL | fn copy<R: Unpin, W>(_: R, _: W) {}
14+
| ^^^^^ required by this bound in `copy`
15+
help: consider restricting type parameter `T`
16+
|
17+
LL | fn f<T: std::marker::Unpin>(r: T) {
18+
| ++++++++++++++++++++
19+
20+
error: aborting due to previous error
21+
22+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)