mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 14:02:57 +00:00
Rollup merge of #116801 - clubby789:issue-113326-test, r=compiler-errors
Add test for 113326 Closes #113326 Bisecting points to #113636 as the fix
This commit is contained in:
commit
75efc4fd9e
17
tests/ui/type-alias-impl-trait/recursive-fn-tait.rs
Normal file
17
tests/ui/type-alias-impl-trait/recursive-fn-tait.rs
Normal file
@ -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
tests/ui/type-alias-impl-trait/recursive-fn-tait.stderr
Normal file
14
tests/ui/type-alias-impl-trait/recursive-fn-tait.stderr
Normal file
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user