Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #117172

Merged
merged 14 commits into from
Oct 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add test for 113326
clubby789 committed Oct 16, 2023
commit 43a08bd29969be0f8b83a525b46cfa9e4b99e863
17 changes: 17 additions & 0 deletions tests/ui/type-alias-impl-trait/recursive-fn-tait.rs
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() {}
14 changes: 14 additions & 0 deletions tests/ui/type-alias-impl-trait/recursive-fn-tait.stderr
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