]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/higher-rank-trait-bounds/normalize-under-binder/issue-71955.rs
2 #![feature(rustc_attrs)]
7 fn call(&self, input
: &'s
str) -> (&'s
str, Self::Output
);
10 impl<'s
, F
, T
> Parser
<'s
> for F
11 where F
: Fn(&'s
str) -> (&'s
str, T
) {
13 fn call(&self, input
: &'s
str) -> (&'s
str, T
) {
24 F1
: for<'a
> Parser
<'a
>,
25 F2
: FnOnce(&<F1
as Parser
>::Output
) -> bool
27 let s
: String
= base
.to_owned();
28 let str_ref
= s
.as_ref();
29 let (remaining
, produced
) = f1
.call(str_ref
);
30 assert
!(f2(&produced
));
31 assert_eq
!(remaining
.len(), 0);
34 struct Wrapper
<'a
>(&'a
str);
37 fn bar
<'a
>(s
: &'a
str) -> (&'a
str, &'a
str) {
41 fn baz
<'a
>(s
: &'a
str) -> (&'a
str, Wrapper
<'a
>) {
42 (&s
[..1], Wrapper(&s
[..]))
45 foo(bar
, "string", |s
| s
.len() == 5);
46 //~^ ERROR mismatched types
47 //~| ERROR mismatched types
48 foo(baz
, "string", |s
| s
.0.len() == 5);
49 //~^ ERROR mismatched types
50 //~| ERROR mismatched types