Skip to content

Commit a290e45

Browse files
authored
Unrolled build for rust-lang#116801
Rollup merge of rust-lang#116801 - clubby789:issue-113326-test, r=compiler-errors Add test for 113326 Closes rust-lang#113326 Bisecting points to rust-lang#113636 as the fix
2 parents 964ff01 + 43a08bd commit a290e45

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// test for #113326
2+
#![feature(type_alias_impl_trait)]
3+
4+
pub type Diff = impl Fn(usize) -> usize;
5+
6+
pub fn lift() -> Diff {
7+
|_: usize |loop {}
8+
}
9+
10+
pub fn add(
11+
n: Diff,
12+
m: Diff,
13+
) -> Diff {
14+
move |x: usize| m(n(x)) //~ ERROR: concrete type differs
15+
}
16+
17+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: concrete type differs from previous defining opaque type use
2+
--> $DIR/recursive-fn-tait.rs:14:5
3+
|
4+
LL | move |x: usize| m(n(x))
5+
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `{closure@$DIR/recursive-fn-tait.rs:7:5: 7:16}`, got `{closure@$DIR/recursive-fn-tait.rs:14:5: 14:20}`
6+
|
7+
note: previous use here
8+
--> $DIR/recursive-fn-tait.rs:7:5
9+
|
10+
LL | |_: usize |loop {}
11+
| ^^^^^^^^^^^^^^^^^^
12+
13+
error: aborting due to previous error
14+

0 commit comments

Comments
 (0)