Skip to content

Commit

Permalink
--bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Jul 28, 2022
1 parent 620b0f1 commit 7da578b
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 63 deletions.
66 changes: 44 additions & 22 deletions src/test/ui/anonymous-higher-ranked-lifetime.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:2:5
|
LL | f1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
| expected due to this
|
= note: expected closure signature `for<'r, 's> fn(&'r (), &'s ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f1`
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:25
|
Expand All @@ -16,10 +18,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:3:5
|
LL | f2(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
| expected due to this
|
= note: expected closure signature `for<'a, 'r> fn(&'a (), &'r ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f2`
--> $DIR/anonymous-higher-ranked-lifetime.rs:17:25
|
Expand All @@ -30,10 +34,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:4:5
|
LL | f3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'r> fn(&(), &'r ()) -> _`
| expected due to this
|
= note: expected closure signature `for<'r> fn(&(), &'r ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f3`
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:29
|
Expand All @@ -44,10 +50,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:5:5
|
LL | f4(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
| expected due to this
|
= note: expected closure signature `for<'r, 's> fn(&'s (), &'r ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f4`
--> $DIR/anonymous-higher-ranked-lifetime.rs:19:25
|
Expand All @@ -58,10 +66,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:6:5
|
LL | f5(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
| expected due to this
|
= note: expected closure signature `for<'r> fn(&'r (), &'r ()) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `f5`
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:25
|
Expand All @@ -72,10 +82,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:7:5
|
LL | g1(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'r> fn(&'r (), Box<(dyn for<'s> Fn(&'s ()) + 'static)>) -> _`
| expected due to this
|
= note: expected closure signature `for<'r> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g1`
--> $DIR/anonymous-higher-ranked-lifetime.rs:23:25
|
Expand All @@ -86,10 +98,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:8:5
|
LL | g2(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
| expected due to this
|
= note: expected closure signature `for<'r> fn(&'r (), for<'r> fn(&'r ())) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g2`
--> $DIR/anonymous-higher-ranked-lifetime.rs:24:25
|
Expand All @@ -100,10 +114,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:9:5
|
LL | g3(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'s> fn(&'s (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
| expected due to this
|
= note: expected closure signature `for<'s> fn(&'s (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g3`
--> $DIR/anonymous-higher-ranked-lifetime.rs:25:25
|
Expand All @@ -114,10 +130,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:10:5
|
LL | g4(|_: (), _: ()| {});
| ^^ -------------- found signature of `fn((), ()) -> _`
| ^^ -------------- found signature defined here
| |
| expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
| expected due to this
|
= note: expected closure signature `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
found closure signature `fn((), ()) -> _`
note: required by a bound in `g4`
--> $DIR/anonymous-higher-ranked-lifetime.rs:26:25
|
Expand All @@ -128,10 +146,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:11:5
|
LL | h1(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| ^^ ---------------------------- found signature defined here
| |
| expected signature of `for<'r, 's> fn(&'r (), Box<(dyn for<'t0> Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
| expected due to this
|
= note: expected closure signature `for<'r, 's> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>, &'s (), for<'r, 's> fn(&'r (), &'s ())) -> _`
found closure signature `fn((), (), (), ()) -> _`
note: required by a bound in `h1`
--> $DIR/anonymous-higher-ranked-lifetime.rs:29:25
|
Expand All @@ -142,10 +162,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/anonymous-higher-ranked-lifetime.rs:12:5
|
LL | h2(|_: (), _: (), _: (), _: ()| {});
| ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _`
| ^^ ---------------------------- found signature defined here
| |
| expected signature of `for<'r, 't0> fn(&'r (), Box<(dyn for<'s> Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
| expected due to this
|
= note: expected closure signature `for<'t0, 'r> fn(&'r (), Box<(dyn for<'r> Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _`
found closure signature `fn((), (), (), ()) -> _`
note: required by a bound in `h2`
--> $DIR/anonymous-higher-ranked-lifetime.rs:30:25
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/expect-infer-var-appearing-twice.rs:14:5
|
LL | with_closure(|x: u32, y: i32| {
| ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _`
| ^^^^^^^^^^^^ ---------------- found signature defined here
| |
| expected signature of `fn(_, _) -> _`
| expected due to this
|
= note: expected closure signature `fn(_, _) -> _`
found closure signature `fn(u32, i32) -> _`
note: required by a bound in `with_closure`
--> $DIR/expect-infer-var-appearing-twice.rs:2:14
|
Expand Down
6 changes: 4 additions & 2 deletions src/test/ui/generator/issue-88653.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ use std::ops::Generator;

fn foo(bar: bool) -> impl Generator<(bool,)> {
//~^ ERROR: type mismatch in generator arguments [E0631]
//~| NOTE: expected signature of `fn((bool,)) -> _`
//~| NOTE: expected due to this
//~| NOTE: expected generator signature `fn((bool,)) -> _`
//~| NOTE: in this expansion of desugaring of `impl Trait`
//~| NOTE: in this expansion of desugaring of `impl Trait`
|bar| {
//~^ NOTE: found signature of `fn(bool) -> _`
//~^ NOTE: found signature defined here
if bar {
yield bar;
}
Expand Down
7 changes: 5 additions & 2 deletions src/test/ui/generator/issue-88653.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ error[E0631]: type mismatch in generator arguments
--> $DIR/issue-88653.rs:8:22
|
LL | fn foo(bar: bool) -> impl Generator<(bool,)> {
| ^^^^^^^^^^^^^^^^^^^^^^^ expected signature of `fn((bool,)) -> _`
| ^^^^^^^^^^^^^^^^^^^^^^^ expected due to this
...
LL | |bar| {
| ----- found signature of `fn(bool) -> _`
| ----- found signature defined here
|
= note: expected generator signature `fn((bool,)) -> _`
found generator signature `fn(bool) -> _`

error: aborting due to previous error

Expand Down
6 changes: 4 additions & 2 deletions src/test/ui/generic-associated-types/bugs/issue-88382.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ error[E0631]: type mismatch in function arguments
--> $DIR/issue-88382.rs:28:40
|
LL | do_something(SomeImplementation(), test);
| ------------ ^^^^ expected signature of `for<'r> fn(&'r mut std::iter::Empty<usize>) -> _`
| ------------ ^^^^ expected due to this
| |
| required by a bound introduced by this call
...
LL | fn test<'a, I: Iterable>(_: &mut I::Iterator<'a>) {}
| ------------------------------------------------- found signature of `for<'r, 'a> fn(&'r mut <_ as Iterable>::Iterator<'a>) -> _`
| ------------------------------------------------- found signature defined here
|
= note: expected function signature `for<'r> fn(&'r mut std::iter::Empty<usize>) -> _`
found function signature `for<'a, 'r> fn(&'r mut <_ as Iterable>::Iterator<'a>) -> _`
note: required by a bound in `do_something`
--> $DIR/issue-88382.rs:22:48
|
Expand Down
6 changes: 4 additions & 2 deletions src/test/ui/intrinsics/const-eval-select-bad.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@ error[E0631]: type mismatch in function arguments
--> $DIR/const-eval-select-bad.rs:34:32
|
LL | const fn foo(n: i32) -> i32 {
| --------------------------- found signature of `fn(i32) -> _`
| --------------------------- found signature defined here
...
LL | const_eval_select((true,), foo, baz);
| ----------------- ^^^ expected signature of `fn(bool) -> _`
| ----------------- ^^^ expected due to this
| |
| required by a bound introduced by this call
|
= note: expected function signature `fn(bool) -> _`
found function signature `fn(i32) -> _`
note: required by a bound in `const_eval_select`
--> $SRC_DIR/core/src/intrinsics.rs:LL:COL
|
Expand Down
24 changes: 16 additions & 8 deletions src/test/ui/mismatched_types/E0631.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/E0631.rs:7:5
|
LL | foo(|_: isize| {});
| ^^^ ---------- found signature of `fn(isize) -> _`
| ^^^ ---------- found signature defined here
| |
| expected signature of `fn(usize) -> _`
| expected due to this
|
= note: expected closure signature `fn(usize) -> _`
found closure signature `fn(isize) -> _`
note: required by a bound in `foo`
--> $DIR/E0631.rs:3:11
|
Expand All @@ -16,10 +18,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/E0631.rs:8:5
|
LL | bar(|_: isize| {});
| ^^^ ---------- found signature of `fn(isize) -> _`
| ^^^ ---------- found signature defined here
| |
| expected signature of `fn(usize) -> _`
| expected due to this
|
= note: expected closure signature `fn(usize) -> _`
found closure signature `fn(isize) -> _`
note: required by a bound in `bar`
--> $DIR/E0631.rs:4:11
|
Expand All @@ -30,13 +34,15 @@ error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:9:9
|
LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
| ------------ found signature defined here
...
LL | foo(f);
| --- ^ expected signature of `fn(usize) -> _`
| --- ^ expected due to this
| |
| required by a bound introduced by this call
|
= note: expected function signature `fn(usize) -> _`
found function signature `fn(u64) -> _`
note: required by a bound in `foo`
--> $DIR/E0631.rs:3:11
|
Expand All @@ -47,13 +53,15 @@ error[E0631]: type mismatch in function arguments
--> $DIR/E0631.rs:10:9
|
LL | fn f(_: u64) {}
| ------------ found signature of `fn(u64) -> _`
| ------------ found signature defined here
...
LL | bar(f);
| --- ^ expected signature of `fn(usize) -> _`
| --- ^ expected due to this
| |
| required by a bound introduced by this call
|
= note: expected function signature `fn(usize) -> _`
found function signature `fn(u64) -> _`
note: required by a bound in `bar`
--> $DIR/E0631.rs:4:11
|
Expand Down
18 changes: 12 additions & 6 deletions src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:3:14
|
LL | a.iter().map(|_: (u32, u32)| 45);
| ^^^ --------------- found signature of `fn((u32, u32)) -> _`
| ^^^ --------------- found signature defined here
| |
| expected signature of `fn(&(u32, u32)) -> _`
| expected due to this
|
= note: expected closure signature `fn(&(u32, u32)) -> _`
found closure signature `fn((u32, u32)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
Expand All @@ -16,10 +18,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:4:14
|
LL | a.iter().map(|_: &(u16, u16)| 45);
| ^^^ ---------------- found signature of `for<'r> fn(&'r (u16, u16)) -> _`
| ^^^ ---------------- found signature defined here
| |
| expected signature of `fn(&(u32, u32)) -> _`
| expected due to this
|
= note: expected closure signature `fn(&(u32, u32)) -> _`
found closure signature `for<'r> fn(&'r (u16, u16)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
Expand All @@ -30,10 +34,12 @@ error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:5:14
|
LL | a.iter().map(|_: (u16, u16)| 45);
| ^^^ --------------- found signature of `fn((u16, u16)) -> _`
| ^^^ --------------- found signature defined here
| |
| expected signature of `fn(&(u32, u32)) -> _`
| expected due to this
|
= note: expected closure signature `fn(&(u32, u32)) -> _`
found closure signature `fn((u16, u16)) -> _`
note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
Expand Down
12 changes: 8 additions & 4 deletions src/test/ui/mismatched_types/fn-variance-1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:11:15
|
LL | fn takes_mut(x: &mut isize) { }
| --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _`
| --------------------------- found signature defined here
...
LL | apply(&3, takes_mut);
| ----- ^^^^^^^^^ expected signature of `fn(&{integer}) -> _`
| ----- ^^^^^^^^^ expected due to this
| |
| required by a bound introduced by this call
|
= note: expected function signature `fn(&{integer}) -> _`
found function signature `for<'r> fn(&'r mut isize) -> _`
note: required by a bound in `apply`
--> $DIR/fn-variance-1.rs:5:37
|
Expand All @@ -19,13 +21,15 @@ error[E0631]: type mismatch in function arguments
--> $DIR/fn-variance-1.rs:15:19
|
LL | fn takes_imm(x: &isize) { }
| ----------------------- found signature of `for<'r> fn(&'r isize) -> _`
| ----------------------- found signature defined here
...
LL | apply(&mut 3, takes_imm);
| ----- ^^^^^^^^^ expected signature of `fn(&mut {integer}) -> _`
| ----- ^^^^^^^^^ expected due to this
| |
| required by a bound introduced by this call
|
= note: expected function signature `fn(&mut {integer}) -> _`
found function signature `for<'r> fn(&'r isize) -> _`
note: required by a bound in `apply`
--> $DIR/fn-variance-1.rs:5:37
|
Expand Down
Loading

0 comments on commit 7da578b

Please sign in to comment.