Skip to content

Commit 15aa2d6

Browse files
authored
Rollup merge of #96329 - aliemjay:fixed-by-90887, r=jackh726
Add a couple tests for #90887 fixes closes #56556 closes #90875 These are confirmed fixes by #90887, so r? ``@jackh726``
2 parents 7355d97 + a0b464a commit 15aa2d6

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-56556.rs

+17
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,20 @@ where
1111
fn main() {
1212
foo::<Vec<u32>>(vec![]);
1313
}
14+
15+
mod another {
16+
use std::ops::Deref;
17+
18+
fn test<T, TDeref>()
19+
where
20+
T: Deref<Target = TDeref>,
21+
TDeref: ?Sized,
22+
for<'a> &'a TDeref: IntoIterator,
23+
for<'a> <&'a TDeref as IntoIterator>::IntoIter: Clone,
24+
{
25+
}
26+
27+
fn main() {
28+
test::<Vec<u8>, _>();
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// check-pass
2+
3+
trait Variable<'a> {
4+
type Type;
5+
}
6+
7+
impl Variable<'_> for () {
8+
type Type = ();
9+
}
10+
11+
fn check<F, T>(_: F)
12+
where
13+
F: Fn(T), // <- if removed, all fn_* then require type annotations
14+
F: for<'a> Fn(<T as Variable<'a>>::Type),
15+
T: for<'a> Variable<'a>,
16+
{
17+
}
18+
19+
fn test(arg: impl Fn(())) {
20+
fn fn_1(_: ()) {}
21+
let fn_2 = |_: ()| ();
22+
let fn_3 = |a| fn_1(a);
23+
let fn_4 = arg;
24+
25+
check(fn_1); // Error
26+
check(fn_2); // Ok
27+
check(fn_3); // Ok
28+
check(fn_4); // Error
29+
}
30+
31+
fn main() {}

0 commit comments

Comments
 (0)