diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-11-23 16:01:20 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-11-23 16:50:28 -0800 |
| commit | d92355c1db65035e508020e746c141c79dfdbd99 (patch) | |
| tree | a0cf0d266824c1930c716d1e98d9b1b4a818f571 /src/test | |
| parent | f11759d38c70d3df67135f88a682701c1cf9762a (diff) | |
Highlight parts of fn in type errors
When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each.
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/c-variadic/variadic-ffi-1.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/const-generics/fn-const-param-infer.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/fn/fn-item-type.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/fn/fn-item-type.stderr | 12 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-15094.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-35869.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-37884.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-9575.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/unsafe/unsafe-subtyping.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/unsafe/unsafe-trait-impl.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/unsafe/unsafe-trait-impl.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/wrong-mul-method-signature.stderr | 4 |
13 files changed, 34 insertions, 34 deletions
diff --git a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr index 421c57fc74a..4f86ffb2b79 100644 --- a/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr +++ b/src/test/ui/borrowck/regions-bound-missing-bound-in-impl.stderr @@ -22,8 +22,8 @@ error[E0308]: method not compatible with trait LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch | - = note: expected fn pointer `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'d>)` - found fn pointer `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'d>)` + = note: expected fn pointer `fn(&'a isize, Inv<'c>, Inv<'c>, Inv<'_>)` + found fn pointer `fn(&'a isize, Inv<'_>, Inv<'c>, Inv<'_>)` note: the lifetime `'c` as defined on the method body at 27:24... --> $DIR/regions-bound-missing-bound-in-impl.rs:27:24 | diff --git a/src/test/ui/c-variadic/variadic-ffi-1.stderr b/src/test/ui/c-variadic/variadic-ffi-1.stderr index 3d1710648da..37953d6328f 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-1.stderr @@ -28,8 +28,8 @@ error[E0308]: mismatched types LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; | ^^^ expected non-variadic fn, found variadic function | - = note: expected fn pointer `unsafe extern "C" fn(isize, u8)` - found fn item `unsafe extern "C" fn(isize, u8, ...) {foo}` + = note: expected fn pointer `unsafe extern "C" fn(_, _)` + found fn item `unsafe extern "C" fn(_, _, ...) {foo}` error[E0308]: mismatched types --> $DIR/variadic-ffi-1.rs:20:54 @@ -37,8 +37,8 @@ error[E0308]: mismatched types LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; | ^^^ expected variadic fn, found non-variadic function | - = note: expected fn pointer `extern "C" fn(isize, u8, ...)` - found fn item `extern "C" fn(isize, u8) {bar}` + = note: expected fn pointer `extern "C" fn(_, _, ...)` + found fn item `extern "C" fn(_, _) {bar}` error[E0617]: can't pass `f32` to variadic function --> $DIR/variadic-ffi-1.rs:22:19 diff --git a/src/test/ui/const-generics/fn-const-param-infer.stderr b/src/test/ui/const-generics/fn-const-param-infer.stderr index 8f61e35e492..8d221c7fa9c 100644 --- a/src/test/ui/const-generics/fn-const-param-infer.stderr +++ b/src/test/ui/const-generics/fn-const-param-infer.stderr @@ -21,8 +21,8 @@ error[E0308]: mismatched types LL | let _ = Checked::<{generic_arg::<u32>}>; | ^^^^^^^^^^^^^^^^^^ expected `usize`, found `u32` | - = note: expected fn pointer `fn(usize) -> bool` - found fn item `fn(u32) -> bool {generic_arg::<u32>}` + = note: expected fn pointer `fn(usize) -> _` + found fn item `fn(u32) -> _ {generic_arg::<u32>}` error[E0282]: type annotations needed --> $DIR/fn-const-param-infer.rs:22:23 diff --git a/src/test/ui/fn/fn-item-type.rs b/src/test/ui/fn/fn-item-type.rs index 18146d52551..68b75c18a43 100644 --- a/src/test/ui/fn/fn-item-type.rs +++ b/src/test/ui/fn/fn-item-type.rs @@ -12,8 +12,8 @@ impl<T> Foo for T { /* `foo` is still default here */ } fn main() { eq(foo::<u8>, bar::<u8>); //~^ ERROR mismatched types - //~| expected fn item `fn(isize) -> isize {foo::<u8>}` - //~| found fn item `fn(isize) -> isize {bar::<u8>}` + //~| expected fn item `fn(_) -> _ {foo::<u8>}` + //~| found fn item `fn(_) -> _ {bar::<u8>}` //~| expected fn item, found a different fn item eq(foo::<u8>, foo::<i8>); @@ -22,8 +22,8 @@ fn main() { eq(bar::<String>, bar::<Vec<u8>>); //~^ ERROR mismatched types - //~| expected fn item `fn(isize) -> isize {bar::<std::string::String>}` - //~| found fn item `fn(isize) -> isize {bar::<std::vec::Vec<u8>>}` + //~| expected fn item `fn(_) -> _ {bar::<std::string::String>}` + //~| found fn item `fn(_) -> _ {bar::<std::vec::Vec<u8>>}` //~| expected struct `std::string::String`, found struct `std::vec::Vec` // Make sure we distinguish between trait methods correctly. diff --git a/src/test/ui/fn/fn-item-type.stderr b/src/test/ui/fn/fn-item-type.stderr index e25e9c21c9f..4cce25c43c4 100644 --- a/src/test/ui/fn/fn-item-type.stderr +++ b/src/test/ui/fn/fn-item-type.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | eq(foo::<u8>, bar::<u8>); | ^^^^^^^^^ expected fn item, found a different fn item | - = note: expected fn item `fn(isize) -> isize {foo::<u8>}` - found fn item `fn(isize) -> isize {bar::<u8>}` + = note: expected fn item `fn(_) -> _ {foo::<u8>}` + found fn item `fn(_) -> _ {bar::<u8>}` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:19:19 @@ -13,8 +13,8 @@ error[E0308]: mismatched types LL | eq(foo::<u8>, foo::<i8>); | ^^^^^^^^^ expected `u8`, found `i8` | - = note: expected fn item `fn(isize) -> isize {foo::<u8>}` - found fn item `fn(isize) -> isize {foo::<i8>}` + = note: expected fn item `fn(_) -> _ {foo::<u8>}` + found fn item `fn(_) -> _ {foo::<i8>}` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:23:23 @@ -22,8 +22,8 @@ error[E0308]: mismatched types LL | eq(bar::<String>, bar::<Vec<u8>>); | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `std::vec::Vec` | - = note: expected fn item `fn(isize) -> isize {bar::<std::string::String>}` - found fn item `fn(isize) -> isize {bar::<std::vec::Vec<u8>>}` + = note: expected fn item `fn(_) -> _ {bar::<std::string::String>}` + found fn item `fn(_) -> _ {bar::<std::vec::Vec<u8>>}` error[E0308]: mismatched types --> $DIR/fn-item-type.rs:30:26 diff --git a/src/test/ui/issues/issue-15094.stderr b/src/test/ui/issues/issue-15094.stderr index 7b392fe1ac7..2dcdaba170a 100644 --- a/src/test/ui/issues/issue-15094.stderr +++ b/src/test/ui/issues/issue-15094.stderr @@ -4,8 +4,8 @@ error[E0053]: method `call_once` has an incompatible type for trait LL | fn call_once(self, _args: ()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "rust-call" fn, found "Rust" fn | - = note: expected fn pointer `extern "rust-call" fn(Debuger<T>, ())` - found fn pointer `fn(Debuger<T>, ())` + = note: expected fn pointer `extern "rust-call" fn(Debuger<_>, ())` + found fn pointer `fn(Debuger<_>, ())` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-35869.stderr b/src/test/ui/issues/issue-35869.stderr index be21569315b..66e89998e1d 100644 --- a/src/test/ui/issues/issue-35869.stderr +++ b/src/test/ui/issues/issue-35869.stderr @@ -31,8 +31,8 @@ LL | fn baz(_: (u8, u16)); LL | fn baz(_: (u16, u16)) {} | ^^^^^^^^^^ expected `u8`, found `u16` | - = note: expected fn pointer `fn((u8, u16))` - found fn pointer `fn((u16, u16))` + = note: expected fn pointer `fn((u8, _))` + found fn pointer `fn((u16, _))` error[E0053]: method `qux` has an incompatible type for trait --> $DIR/issue-35869.rs:17:17 diff --git a/src/test/ui/issues/issue-37884.stderr b/src/test/ui/issues/issue-37884.stderr index 61cb3d7c58f..703cdf08548 100644 --- a/src/test/ui/issues/issue-37884.stderr +++ b/src/test/ui/issues/issue-37884.stderr @@ -9,8 +9,8 @@ LL | | Some(&mut self.0) LL | | } | |_____^ lifetime mismatch | - = note: expected fn pointer `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` - found fn pointer `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` + = note: expected fn pointer `fn(&mut RepeatMut<'a, T>) -> std::option::Option<_>` + found fn pointer `fn(&'a mut RepeatMut<'a, T>) -> std::option::Option<_>` note: the anonymous lifetime #1 defined on the method body at 6:5... --> $DIR/issue-37884.rs:6:5 | diff --git a/src/test/ui/issues/issue-9575.stderr b/src/test/ui/issues/issue-9575.stderr index 6203c2fa84e..3e3678a23f7 100644 --- a/src/test/ui/issues/issue-9575.stderr +++ b/src/test/ui/issues/issue-9575.stderr @@ -4,8 +4,8 @@ error[E0308]: start function has wrong type LL | fn start(argc: isize, argv: *const *const u8, crate_map: *const u8) -> isize { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters | - = note: expected fn pointer `fn(isize, *const *const u8) -> isize` - found fn pointer `fn(isize, *const *const u8, *const u8) -> isize` + = note: expected fn pointer `fn(isize, *const *const u8) -> _` + found fn pointer `fn(isize, *const *const u8, *const u8) -> _` error: aborting due to previous error diff --git a/src/test/ui/unsafe/unsafe-subtyping.stderr b/src/test/ui/unsafe/unsafe-subtyping.stderr index b3e789cc0d9..19f5ef463ce 100644 --- a/src/test/ui/unsafe/unsafe-subtyping.stderr +++ b/src/test/ui/unsafe/unsafe-subtyping.stderr @@ -6,8 +6,8 @@ LL | fn foo(x: Option<fn(i32)>) -> Option<unsafe fn(i32)> { LL | x | ^ expected unsafe fn, found normal fn | - = note: expected enum `std::option::Option<unsafe fn(i32)>` - found enum `std::option::Option<fn(i32)>` + = note: expected enum `std::option::Option<unsafe fn(_)>` + found enum `std::option::Option<fn(_)>` error: aborting due to previous error diff --git a/src/test/ui/unsafe/unsafe-trait-impl.rs b/src/test/ui/unsafe/unsafe-trait-impl.rs index 97ee97cb5c0..03a251be1a9 100644 --- a/src/test/ui/unsafe/unsafe-trait-impl.rs +++ b/src/test/ui/unsafe/unsafe-trait-impl.rs @@ -7,8 +7,8 @@ trait Foo { impl Foo for u32 { fn len(&self) -> u32 { *self } //~^ ERROR method `len` has an incompatible type for trait - //~| expected fn pointer `unsafe fn(&u32) -> u32` - //~| found fn pointer `fn(&u32) -> u32` + //~| expected fn pointer `unsafe fn(&u32) -> _` + //~| found fn pointer `fn(&u32) -> _` } fn main() { } diff --git a/src/test/ui/unsafe/unsafe-trait-impl.stderr b/src/test/ui/unsafe/unsafe-trait-impl.stderr index 567be27555c..1c3d057cbc9 100644 --- a/src/test/ui/unsafe/unsafe-trait-impl.stderr +++ b/src/test/ui/unsafe/unsafe-trait-impl.stderr @@ -7,8 +7,8 @@ LL | unsafe fn len(&self) -> u32; LL | fn len(&self) -> u32 { *self } | ^^^^^^^^^^^^^^^^^^^^ expected unsafe fn, found normal fn | - = note: expected fn pointer `unsafe fn(&u32) -> u32` - found fn pointer `fn(&u32) -> u32` + = note: expected fn pointer `unsafe fn(&u32) -> _` + found fn pointer `fn(&u32) -> _` error: aborting due to previous error diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr index c0888b3b9d4..31f5a3f6981 100644 --- a/src/test/ui/wrong-mul-method-signature.stderr +++ b/src/test/ui/wrong-mul-method-signature.stderr @@ -22,8 +22,8 @@ error[E0053]: method `mul` has an incompatible type for trait LL | fn mul(self, s: f64) -> f64 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `f64` | - = note: expected fn pointer `fn(Vec3, f64) -> i32` - found fn pointer `fn(Vec3, f64) -> f64` + = note: expected fn pointer `fn(Vec3, _) -> i32` + found fn pointer `fn(Vec3, _) -> f64` error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:45 |
