forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// test for #113326 | ||
#![feature(type_alias_impl_trait)] | ||
|
||
pub type Diff = impl Fn(usize) -> usize; | ||
|
||
pub fn lift() -> Diff { | ||
|_: usize |loop {} | ||
} | ||
|
||
pub fn add( | ||
n: Diff, | ||
m: Diff, | ||
) -> Diff { | ||
move |x: usize| m(n(x)) //~ ERROR: concrete type differs | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: concrete type differs from previous defining opaque type use | ||
--> $DIR/recursive-fn-tait.rs:14:5 | ||
| | ||
LL | move |x: usize| m(n(x)) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `{closure@$DIR/recursive-fn-tait.rs:7:5: 7:16}`, got `{closure@$DIR/recursive-fn-tait.rs:14:5: 14:20}` | ||
| | ||
note: previous use here | ||
--> $DIR/recursive-fn-tait.rs:7:5 | ||
| | ||
LL | |_: usize |loop {} | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|