Change rustc_on_unimplemented for Iterator and binops
This commit is contained in:
parent
c1383e4dc4
commit
4c92a02b64
@ -109,7 +109,6 @@
|
||||
all(_Self="f32", RHS="u16"),
|
||||
all(_Self="f32", RHS="u8"),
|
||||
),
|
||||
message="cannot add `{RHS}` to `{Self}`",
|
||||
label="no implementation for `{Self} + {RHS}`, but you can safely cast \
|
||||
`{RHS}` into `{Self}` using `as {Self}`",
|
||||
),
|
||||
@ -146,22 +145,20 @@
|
||||
all(RHS="f32", _Self="u16"),
|
||||
all(RHS="f32", _Self="u8"),
|
||||
),
|
||||
message="cannot add `{RHS}` to `{Self}`",
|
||||
label="no implementation for `{Self} + {RHS}`, but you can safely turn \
|
||||
label="no implementation for `{Self} + {RHS}`, but you can safely cast \
|
||||
`{Self}` into `{RHS}` using `as {RHS}`",
|
||||
),
|
||||
on(
|
||||
all(_Self="{integer}", RHS="{float}"),
|
||||
message="cannot add a float to an integer",
|
||||
label="no implementation for `{Self} + {RHS}`",
|
||||
),
|
||||
on(
|
||||
all(_Self="{float}", RHS="{integer}"),
|
||||
message="cannot add an integer to a float",
|
||||
label="no implementation for `{Self} + {RHS}`",
|
||||
),
|
||||
message="cannot add `{RHS}` to `{Self}`",
|
||||
label="no implementation for `{Self} + {RHS}`")]
|
||||
label="no implementation for `{Self} + {RHS}`",
|
||||
)]
|
||||
pub trait Add<RHS=Self> {
|
||||
/// The resulting type after applying the `+` operator.
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -6,7 +6,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _`
|
||||
|
|
||||
= note: required by `f1`
|
||||
note: required by `f1`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:26:1
|
||||
|
|
||||
26 | fn f1<F>(_: F) where F: Fn(&(), &()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:13:5
|
||||
@ -16,7 +20,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _`
|
||||
|
|
||||
= note: required by `f2`
|
||||
note: required by `f2`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:27:1
|
||||
|
|
||||
27 | fn f2<F>(_: F) where F: for<'a> Fn(&'a (), &()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:14:5
|
||||
@ -26,7 +34,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&(), &'r ()) -> _`
|
||||
|
|
||||
= note: required by `f3`
|
||||
note: required by `f3`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:28:1
|
||||
|
|
||||
28 | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:15:5
|
||||
@ -36,7 +48,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _`
|
||||
|
|
||||
= note: required by `f4`
|
||||
note: required by `f4`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:29:1
|
||||
|
|
||||
29 | fn f4<F>(_: F) where F: for<'r> Fn(&(), &'r ()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:16:5
|
||||
@ -46,7 +62,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&'r (), &'r ()) -> _`
|
||||
|
|
||||
= note: required by `f5`
|
||||
note: required by `f5`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:30:1
|
||||
|
|
||||
30 | fn f5<F>(_: F) where F: for<'r> Fn(&'r (), &'r ()) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:17:5
|
||||
@ -56,7 +76,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&'r (), std::boxed::Box<for<'s> std::ops::Fn(&'s ()) + 'static>) -> _`
|
||||
|
|
||||
= note: required by `g1`
|
||||
note: required by `g1`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:33:1
|
||||
|
|
||||
33 | fn g1<F>(_: F) where F: Fn(&(), Box<Fn(&())>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:18:5
|
||||
@ -66,7 +90,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _`
|
||||
|
|
||||
= note: required by `g2`
|
||||
note: required by `g2`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:34:1
|
||||
|
|
||||
34 | fn g2<F>(_: F) where F: Fn(&(), fn(&())) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:19:5
|
||||
@ -76,7 +104,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'s> fn(&'s (), std::boxed::Box<for<'r> std::ops::Fn(&'r ()) + 'static>) -> _`
|
||||
|
|
||||
= note: required by `g3`
|
||||
note: required by `g3`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:35:1
|
||||
|
|
||||
35 | fn g3<F>(_: F) where F: for<'s> Fn(&'s (), Box<Fn(&())>) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:20:5
|
||||
@ -86,7 +118,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _`
|
||||
|
|
||||
= note: required by `g4`
|
||||
note: required by `g4`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:36:1
|
||||
|
|
||||
36 | fn g4<F>(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:21:5
|
||||
@ -96,7 +132,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<for<'t0> std::ops::Fn(&'t0 ()) + 'static>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _`
|
||||
|
|
||||
= note: required by `h1`
|
||||
note: required by `h1`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:39:1
|
||||
|
|
||||
39 | fn h1<F>(_: F) where F: Fn(&(), Box<Fn(&())>, &(), fn(&(), &())) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:22:5
|
||||
@ -106,7 +146,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<for<'s> std::ops::Fn(&'s ()) + 'static>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _`
|
||||
|
|
||||
= note: required by `h2`
|
||||
note: required by `h2`
|
||||
--> $DIR/anonymous-higher-ranked-lifetime.rs:40:1
|
||||
|
|
||||
40 | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<Fn(&())>, &'t0 (), fn(&(), &())) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 11 previous errors
|
||||
|
||||
|
@ -10,7 +10,11 @@ error[E0277]: the trait bound `i8: Foo<i32>` is not satisfied
|
||||
<i8 as Foo<u32>>
|
||||
<i8 as Foo<u64>>
|
||||
<i8 as Foo<bool>>
|
||||
= note: required by `Foo::bar`
|
||||
note: required by `Foo::bar`
|
||||
--> $DIR/issue-39802-show-5-trait-impls.rs:12:5
|
||||
|
|
||||
12 | fn bar(&self){}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
|
||||
--> $DIR/issue-39802-show-5-trait-impls.rs:35:5
|
||||
@ -23,7 +27,11 @@ error[E0277]: the trait bound `u8: Foo<i32>` is not satisfied
|
||||
<u8 as Foo<u32>>
|
||||
<u8 as Foo<u64>>
|
||||
<u8 as Foo<bool>>
|
||||
= note: required by `Foo::bar`
|
||||
note: required by `Foo::bar`
|
||||
--> $DIR/issue-39802-show-5-trait-impls.rs:12:5
|
||||
|
|
||||
12 | fn bar(&self){}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
|
||||
--> $DIR/issue-39802-show-5-trait-impls.rs:36:5
|
||||
@ -37,7 +45,11 @@ error[E0277]: the trait bound `bool: Foo<i32>` is not satisfied
|
||||
<bool as Foo<u32>>
|
||||
<bool as Foo<u64>>
|
||||
and 2 others
|
||||
= note: required by `Foo::bar`
|
||||
note: required by `Foo::bar`
|
||||
--> $DIR/issue-39802-show-5-trait-impls.rs:12:5
|
||||
|
|
||||
12 | fn bar(&self){}
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -15,7 +15,11 @@ error[E0275]: overflow evaluating the requirement `K: std::marker::Send`
|
||||
= note: required because it appears within the type `C`
|
||||
= note: required because it appears within the type `B`
|
||||
= note: required because it appears within the type `A`
|
||||
= note: required by `is_send`
|
||||
note: required by `is_send`
|
||||
--> $DIR/recursion_limit.rs:41:1
|
||||
|
|
||||
41 | fn is_send<T:Send>() { }
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unadjusted ABI is an implementation detail and perma-unstable
|
||||
error[E0658]: unadjusted ABI is an implementation detail and perma-unstable
|
||||
--> $DIR/feature-gate-abi_unadjusted.rs:11:1
|
||||
|
|
||||
11 | / extern "unadjusted" fn foo() {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: `catch` expression is experimental (see issue #31436)
|
||||
error[E0658]: `catch` expression is experimental (see issue #31436)
|
||||
--> $DIR/feature-gate-catch_expr.rs:12:24
|
||||
|
|
||||
12 | let catch_result = do catch { //~ ERROR `catch` expression is experimental
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: 128-bit type is unstable (see issue #35118)
|
||||
error[E0658]: 128-bit type is unstable (see issue #35118)
|
||||
--> $DIR/feature-gate-i128_type2.rs:13:15
|
||||
|
|
||||
13 | fn test1() -> i128 { //~ ERROR 128-bit type is unstable
|
||||
@ -6,7 +6,7 @@ error: 128-bit type is unstable (see issue #35118)
|
||||
|
|
||||
= help: add #![feature(i128_type)] to the crate attributes to enable
|
||||
|
||||
error: 128-bit type is unstable (see issue #35118)
|
||||
error[E0658]: 128-bit type is unstable (see issue #35118)
|
||||
--> $DIR/feature-gate-i128_type2.rs:17:17
|
||||
|
|
||||
17 | fn test1_2() -> u128 { //~ ERROR 128-bit type is unstable
|
||||
@ -14,7 +14,7 @@ error: 128-bit type is unstable (see issue #35118)
|
||||
|
|
||||
= help: add #![feature(i128_type)] to the crate attributes to enable
|
||||
|
||||
error: 128-bit type is unstable (see issue #35118)
|
||||
error[E0658]: 128-bit type is unstable (see issue #35118)
|
||||
--> $DIR/feature-gate-i128_type2.rs:22:12
|
||||
|
|
||||
22 | let x: i128 = 0; //~ ERROR 128-bit type is unstable
|
||||
@ -22,7 +22,7 @@ error: 128-bit type is unstable (see issue #35118)
|
||||
|
|
||||
= help: add #![feature(i128_type)] to the crate attributes to enable
|
||||
|
||||
error: 128-bit type is unstable (see issue #35118)
|
||||
error[E0658]: 128-bit type is unstable (see issue #35118)
|
||||
--> $DIR/feature-gate-i128_type2.rs:26:12
|
||||
|
|
||||
26 | let x: u128 = 0; //~ ERROR 128-bit type is unstable
|
||||
@ -32,7 +32,7 @@ error: 128-bit type is unstable (see issue #35118)
|
||||
|
||||
error[E0601]: main function not found
|
||||
|
||||
error: repr with 128-bit type is unstable (see issue #35118)
|
||||
error[E0658]: repr with 128-bit type is unstable (see issue #35118)
|
||||
--> $DIR/feature-gate-i128_type2.rs:30:1
|
||||
|
|
||||
30 | / enum A { //~ ERROR 128-bit type is unstable
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: intrinsics are subject to change
|
||||
error[E0658]: intrinsics are subject to change
|
||||
--> $DIR/feature-gate-intrinsics.rs:11:1
|
||||
|
|
||||
11 | / extern "rust-intrinsic" { //~ ERROR intrinsics are subject to change
|
||||
@ -8,7 +8,7 @@ error: intrinsics are subject to change
|
||||
|
|
||||
= help: add #![feature(intrinsics)] to the crate attributes to enable
|
||||
|
||||
error: intrinsics are subject to change
|
||||
error[E0658]: intrinsics are subject to change
|
||||
--> $DIR/feature-gate-intrinsics.rs:15:1
|
||||
|
|
||||
15 | / extern "rust-intrinsic" fn baz() { //~ ERROR intrinsics are subject to change
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:11:1
|
||||
|
|
||||
11 | extern crate core as bäz; //~ ERROR non-ascii idents
|
||||
@ -6,7 +6,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:13:5
|
||||
|
|
||||
13 | use föö::bar; //~ ERROR non-ascii idents
|
||||
@ -14,7 +14,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:15:1
|
||||
|
|
||||
15 | mod föö { //~ ERROR non-ascii idents
|
||||
@ -22,7 +22,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:19:1
|
||||
|
|
||||
19 | / fn bär( //~ ERROR non-ascii idents
|
||||
@ -36,7 +36,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:20:5
|
||||
|
|
||||
20 | bäz: isize //~ ERROR non-ascii idents
|
||||
@ -44,7 +44,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:22:9
|
||||
|
|
||||
22 | let _ö: isize; //~ ERROR non-ascii idents
|
||||
@ -52,7 +52,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:25:10
|
||||
|
|
||||
25 | (_ä, _) => {} //~ ERROR non-ascii idents
|
||||
@ -60,7 +60,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:29:1
|
||||
|
|
||||
29 | struct Föö { //~ ERROR non-ascii idents
|
||||
@ -68,7 +68,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:30:5
|
||||
|
|
||||
30 | föö: isize //~ ERROR non-ascii idents
|
||||
@ -76,7 +76,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:33:1
|
||||
|
|
||||
33 | enum Bär { //~ ERROR non-ascii idents
|
||||
@ -84,7 +84,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:34:5
|
||||
|
|
||||
34 | Bäz { //~ ERROR non-ascii idents
|
||||
@ -92,7 +92,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:35:9
|
||||
|
|
||||
35 | qüx: isize //~ ERROR non-ascii idents
|
||||
@ -100,7 +100,7 @@ error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
|
|
||||
= help: add #![feature(non_ascii_idents)] to the crate attributes to enable
|
||||
|
||||
error: non-ascii idents are not fully supported. (see issue #28979)
|
||||
error[E0658]: non-ascii idents are not fully supported. (see issue #28979)
|
||||
--> $DIR/feature-gate-non_ascii_idents.rs:40:5
|
||||
|
|
||||
40 | fn qüx(); //~ ERROR non-ascii idents
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: repr with 128-bit type is unstable (see issue #35118)
|
||||
error[E0658]: repr with 128-bit type is unstable (see issue #35118)
|
||||
--> $DIR/feature-gate-repr128.rs:12:1
|
||||
|
|
||||
12 | / enum A { //~ ERROR repr with 128-bit type is unstable
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: rust-call ABI is subject to change (see issue #29625)
|
||||
error[E0658]: rust-call ABI is subject to change (see issue #29625)
|
||||
--> $DIR/feature-gate-unboxed-closures.rs:16:5
|
||||
|
|
||||
16 | / extern "rust-call" fn call_once(self, (a, b): (u32, u32)) -> u32 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
error: unions with non-`Copy` fields are unstable (see issue #32836)
|
||||
error[E0658]: unions with non-`Copy` fields are unstable (see issue #32836)
|
||||
--> $DIR/feature-gate-untagged_unions.rs:19:1
|
||||
|
|
||||
19 | / union U3 { //~ ERROR unions with non-`Copy` fields are unstable
|
||||
@ -8,7 +8,7 @@ error: unions with non-`Copy` fields are unstable (see issue #32836)
|
||||
|
|
||||
= help: add #![feature(untagged_unions)] to the crate attributes to enable
|
||||
|
||||
error: unions with non-`Copy` fields are unstable (see issue #32836)
|
||||
error[E0658]: unions with non-`Copy` fields are unstable (see issue #32836)
|
||||
--> $DIR/feature-gate-untagged_unions.rs:23:1
|
||||
|
|
||||
23 | / union U4<T> { //~ ERROR unions with non-`Copy` fields are unstable
|
||||
@ -18,7 +18,7 @@ error: unions with non-`Copy` fields are unstable (see issue #32836)
|
||||
|
|
||||
= help: add #![feature(untagged_unions)] to the crate attributes to enable
|
||||
|
||||
error: unions with `Drop` implementations are unstable (see issue #32836)
|
||||
error[E0658]: unions with `Drop` implementations are unstable (see issue #32836)
|
||||
--> $DIR/feature-gate-untagged_unions.rs:27:1
|
||||
|
|
||||
27 | / union U5 { //~ ERROR unions with `Drop` implementations are unstable
|
||||
|
@ -12,7 +12,11 @@ error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync`
|
||||
= note: required because it appears within the type `[std::fmt::ArgumentV1<'_>]`
|
||||
= note: required because of the requirements on the impl of `std::marker::Send` for `&[std::fmt::ArgumentV1<'_>]`
|
||||
= note: required because it appears within the type `std::fmt::Arguments<'_>`
|
||||
= note: required by `send`
|
||||
note: required by `send`
|
||||
--> $DIR/send-sync.rs:11:1
|
||||
|
|
||||
11 | fn send<T: Send>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync` is not satisfied in `std::fmt::Arguments<'_>`
|
||||
--> $DIR/send-sync.rs:19:5
|
||||
@ -28,7 +32,11 @@ error[E0277]: the trait bound `*mut std::ops::Fn() + 'static: std::marker::Sync`
|
||||
= note: required because it appears within the type `[std::fmt::ArgumentV1<'_>]`
|
||||
= note: required because it appears within the type `&[std::fmt::ArgumentV1<'_>]`
|
||||
= note: required because it appears within the type `std::fmt::Arguments<'_>`
|
||||
= note: required by `sync`
|
||||
note: required by `sync`
|
||||
--> $DIR/send-sync.rs:12:1
|
||||
|
|
||||
12 | fn sync<T: Sync>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -7,7 +7,11 @@ error[E0277]: the trait bound `std::cell::Cell<i32>: std::marker::Sync` is not s
|
||||
= help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
|
||||
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::cell::Cell<i32>`
|
||||
= note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:26:17: 30:6 a:&std::cell::Cell<i32> _]`
|
||||
= note: required by `main::assert_send`
|
||||
note: required by `main::assert_send`
|
||||
--> $DIR/not-send-sync.rs:17:5
|
||||
|
|
||||
17 | fn assert_send<T: Send>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `std::cell::Cell<i32>: std::marker::Sync` is not satisfied in `[generator@$DIR/not-send-sync.rs:19:17: 23:6 {std::cell::Cell<i32>, ()}]`
|
||||
--> $DIR/not-send-sync.rs:19:5
|
||||
|
@ -7,7 +7,11 @@ error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::S
|
||||
= help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<i32>>`
|
||||
= note: required because it appears within the type `[closure@$DIR/auto-trait-leak.rs:21:5: 21:22 p:std::rc::Rc<std::cell::Cell<i32>>]`
|
||||
= note: required because it appears within the type `impl std::ops::Fn<(i32,)>`
|
||||
= note: required by `send`
|
||||
note: required by `send`
|
||||
--> $DIR/auto-trait-leak.rs:24:1
|
||||
|
|
||||
24 | fn send<T: Send>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::Send` is not satisfied in `impl std::ops::Fn<(i32,)>`
|
||||
--> $DIR/auto-trait-leak.rs:30:5
|
||||
@ -18,7 +22,11 @@ error[E0277]: the trait bound `std::rc::Rc<std::cell::Cell<i32>>: std::marker::S
|
||||
= help: within `impl std::ops::Fn<(i32,)>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::Cell<i32>>`
|
||||
= note: required because it appears within the type `[closure@$DIR/auto-trait-leak.rs:38:5: 38:22 p:std::rc::Rc<std::cell::Cell<i32>>]`
|
||||
= note: required because it appears within the type `impl std::ops::Fn<(i32,)>`
|
||||
= note: required by `send`
|
||||
note: required by `send`
|
||||
--> $DIR/auto-trait-leak.rs:24:1
|
||||
|
|
||||
24 | fn send<T: Send>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0391]: unsupported cyclic reference between types/traits detected
|
||||
--> $DIR/auto-trait-leak.rs:44:1
|
||||
|
@ -4,7 +4,11 @@ error[E0283]: type annotations required: cannot resolve `T0: Trait0<'l0>`
|
||||
14 | impl <'l0, 'l1, T0> Trait1<'l0, T0> for bool where T0 : Trait0<'l0>, T0 : Trait0<'l1> {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: required by `Trait0`
|
||||
note: required by `Trait0`
|
||||
--> $DIR/issue-24424.rs:12:1
|
||||
|
|
||||
12 | trait Trait0<'l0> {}
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
warning: unnecessary parentheses around assigned value
|
||||
--> $DIR/suggestions.rs:36:21
|
||||
--> $DIR/suggestions.rs:46:21
|
||||
|
|
||||
36 | let mut a = (1); // should suggest no `mut`, no parens
|
||||
46 | let mut a = (1); // should suggest no `mut`, no parens
|
||||
| ^^^ help: remove these parentheses
|
||||
|
|
||||
note: lint level defined here
|
||||
@ -11,17 +11,17 @@ note: lint level defined here
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
warning: use of deprecated attribute `no_debug`: the `#[no_debug]` attribute was an experimental feature that has been deprecated due to lack of demand. See https://github.com/rust-lang/rust/issues/29721
|
||||
--> $DIR/suggestions.rs:31:1
|
||||
--> $DIR/suggestions.rs:41:1
|
||||
|
|
||||
31 | #[no_debug] // should suggest removal of deprecated attribute
|
||||
41 | #[no_debug] // should suggest removal of deprecated attribute
|
||||
| ^^^^^^^^^^^ help: remove this attribute
|
||||
|
|
||||
= note: #[warn(deprecated)] on by default
|
||||
|
||||
warning: variable does not need to be mutable
|
||||
--> $DIR/suggestions.rs:36:13
|
||||
--> $DIR/suggestions.rs:46:13
|
||||
|
|
||||
36 | let mut a = (1); // should suggest no `mut`, no parens
|
||||
46 | let mut a = (1); // should suggest no `mut`, no parens
|
||||
| ---^^
|
||||
| |
|
||||
| help: remove this `mut`
|
||||
@ -72,18 +72,30 @@ warning: function is marked #[no_mangle], but not exported
|
||||
|
|
||||
= note: #[warn(private_no_mangle_fns)] on by default
|
||||
|
||||
warning: denote infinite loops with `loop { ... }`
|
||||
--> $DIR/suggestions.rs:34:5
|
||||
warning: static is marked #[no_mangle], but not exported
|
||||
--> $DIR/suggestions.rs:31:18
|
||||
|
|
||||
34 | while true { // should suggest `loop`
|
||||
31 | #[no_mangle] pub static DAUNTLESS: bool = true;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: function is marked #[no_mangle], but not exported
|
||||
--> $DIR/suggestions.rs:33:18
|
||||
|
|
||||
33 | #[no_mangle] pub fn val_jean() {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: denote infinite loops with `loop { ... }`
|
||||
--> $DIR/suggestions.rs:44:5
|
||||
|
|
||||
44 | while true { // should suggest `loop`
|
||||
| ^^^^^^^^^^ help: use `loop`
|
||||
|
|
||||
= note: #[warn(while_true)] on by default
|
||||
|
||||
warning: the `warp_factor:` in this pattern is redundant
|
||||
--> $DIR/suggestions.rs:41:23
|
||||
--> $DIR/suggestions.rs:51:23
|
||||
|
|
||||
41 | Equinox { warp_factor: warp_factor } => {} // should suggest shorthand
|
||||
51 | Equinox { warp_factor: warp_factor } => {} // should suggest shorthand
|
||||
| ------------^^^^^^^^^^^^
|
||||
| |
|
||||
| help: remove this
|
||||
|
@ -1,12 +1,8 @@
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-foreign.rs:12:5
|
||||
--> $DIR/format-foreign.rs:12:30
|
||||
|
|
||||
12 | println!("%.*3$s %s!/n", "Hello,", "World", 4);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^--------^^-------^^-^^
|
||||
| | | |
|
||||
| | | unused
|
||||
| | unused
|
||||
| unused
|
||||
12 | println!("%.*3$s %s!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments
|
||||
| -------------------------^^^^^^^^--^^^^^^^--^-- multiple unused arguments in this statement
|
||||
|
|
||||
= help: `%.*3$s` should be written as `{:.2$}`
|
||||
= help: `%s` should be written as `{}`
|
||||
|
@ -1,49 +1,43 @@
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-unused-lables.rs:12:5
|
||||
--> $DIR/format-unused-lables.rs:12:22
|
||||
|
|
||||
12 | println!("Test", 123, 456, 789);
|
||||
| ^^^^^^^^^^^^^^^^^---^^---^^---^^
|
||||
| | | |
|
||||
| | | unused
|
||||
| | unused
|
||||
| unused
|
||||
| -----------------^^^--^^^--^^^-- multiple unused arguments in this statement
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-unused-lables.rs:14:5
|
||||
--> $DIR/format-unused-lables.rs:16:9
|
||||
|
|
||||
14 | / println!("Test2",
|
||||
15 | | 123,
|
||||
| | --- unused
|
||||
16 | | 456,
|
||||
| | --- unused
|
||||
17 | | 789
|
||||
| | --- unused
|
||||
18 | | );
|
||||
| |______^
|
||||
15 | / println!("Test2",
|
||||
16 | | 123, //~ ERROR multiple unused formatting arguments
|
||||
| | ^^^
|
||||
17 | | 456,
|
||||
| | ^^^
|
||||
18 | | 789
|
||||
| | ^^^
|
||||
19 | | );
|
||||
| |______- multiple unused arguments in this statement
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
||||
|
||||
error: named argument never used
|
||||
--> $DIR/format-unused-lables.rs:20:35
|
||||
--> $DIR/format-unused-lables.rs:21:35
|
||||
|
|
||||
20 | println!("Some stuff", UNUSED="args"); //~ ERROR named argument never used
|
||||
21 | println!("Some stuff", UNUSED="args"); //~ ERROR named argument never used
|
||||
| ^^^^^^
|
||||
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-unused-lables.rs:22:5
|
||||
--> $DIR/format-unused-lables.rs:24:9
|
||||
|
|
||||
22 | / println!("Some more $STUFF",
|
||||
23 | | "woo!",
|
||||
| | ------ unused
|
||||
24 | | STUFF=
|
||||
25 | | "things"
|
||||
| | -------- unused
|
||||
26 | | , UNUSED="args");
|
||||
| |_______________________------_^
|
||||
| |
|
||||
| unused
|
||||
23 | / println!("Some more $STUFF",
|
||||
24 | | "woo!", //~ ERROR multiple unused formatting arguments
|
||||
| | ^^^^^^
|
||||
25 | | STUFF=
|
||||
26 | | "things"
|
||||
| | ^^^^^^^^
|
||||
27 | | , UNUSED="args");
|
||||
| |_______________________^^^^^^_- multiple unused arguments in this statement
|
||||
|
|
||||
= help: `$STUFF` should be written as `{STUFF}`
|
||||
= note: shell formatting not supported; see the documentation for `std::fmt`
|
||||
|
@ -6,7 +6,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `fn(usize) -> _`
|
||||
|
|
||||
= note: required by `foo`
|
||||
note: required by `foo`
|
||||
--> $DIR/E0631.rs:13:1
|
||||
|
|
||||
13 | fn foo<F: Fn(usize)>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/E0631.rs:18:5
|
||||
@ -16,7 +20,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| |
|
||||
| expected signature of `fn(usize) -> _`
|
||||
|
|
||||
= note: required by `bar`
|
||||
note: required by `bar`
|
||||
--> $DIR/E0631.rs:14:1
|
||||
|
|
||||
14 | fn bar<F: Fn<usize>>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in function arguments
|
||||
--> $DIR/E0631.rs:19:5
|
||||
@ -27,7 +35,11 @@ error[E0631]: type mismatch in function arguments
|
||||
19 | foo(f); //~ ERROR type mismatch
|
||||
| ^^^ expected signature of `fn(usize) -> _`
|
||||
|
|
||||
= note: required by `foo`
|
||||
note: required by `foo`
|
||||
--> $DIR/E0631.rs:13:1
|
||||
|
|
||||
13 | fn foo<F: Fn(usize)>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in function arguments
|
||||
--> $DIR/E0631.rs:20:5
|
||||
@ -38,7 +50,11 @@ error[E0631]: type mismatch in function arguments
|
||||
20 | bar(f); //~ ERROR type mismatch
|
||||
| ^^^ expected signature of `fn(usize) -> _`
|
||||
|
|
||||
= note: required by `bar`
|
||||
note: required by `bar`
|
||||
--> $DIR/E0631.rs:14:1
|
||||
|
|
||||
14 | fn bar<F: Fn<usize>>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -14,7 +14,7 @@ error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
|
||||
| |
|
||||
| expected closure that takes 2 arguments
|
||||
|
||||
error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
|
||||
error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
|
||||
--> $DIR/closure-arg-count.rs:19:15
|
||||
|
|
||||
19 | [1, 2, 3].sort_by(|(tuple, tuple2)| panic!());
|
||||
@ -39,62 +39,58 @@ help: change the closure to take multiple arguments instead of a single tuple
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
|
||||
--> $DIR/closure-arg-count.rs:23:5
|
||||
--> $DIR/closure-arg-count.rs:21:5
|
||||
|
|
||||
23 | f(|| panic!());
|
||||
21 | f(|| panic!());
|
||||
| ^ -- takes 0 arguments
|
||||
| |
|
||||
| expected closure that takes 1 argument
|
||||
|
|
||||
= note: required by `f`
|
||||
note: required by `f`
|
||||
--> $DIR/closure-arg-count.rs:13:1
|
||||
|
|
||||
13 | fn f<F: Fn<usize>>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
|
||||
error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
|
||||
--> $DIR/closure-arg-count.rs:24:53
|
||||
|
|
||||
24 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
|
||||
| ^^^ ------ help: consider changing the closure to accept a tuple: `|(i, x)|`
|
||||
| |
|
||||
| expected closure that takes a single tuple as argument
|
||||
|
||||
error[E0593]: closure is expected to take a single tuple as argument, but it takes 2 distinct arguments
|
||||
--> $DIR/closure-arg-count.rs:26:53
|
||||
|
|
||||
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x| i);
|
||||
| ^^^ ------ takes 2 distinct arguments
|
||||
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
|
||||
| ^^^ ------------- help: consider changing the closure to accept a tuple: `|(i, x): (usize, _)|`
|
||||
| |
|
||||
| expected closure that takes a single 2-tuple as argument
|
||||
help: change the closure to accept a tuple instead of individual arguments
|
||||
|
|
||||
26 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
|
||||
--> $DIR/closure-arg-count.rs:28:53
|
||||
|
|
||||
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i: usize, x| i);
|
||||
| ^^^ ------------- takes 2 distinct arguments
|
||||
| |
|
||||
| expected closure that takes a single 2-tuple as argument
|
||||
help: change the closure to accept a tuple instead of individual arguments
|
||||
|
|
||||
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
|
||||
| ^^^^^^^^
|
||||
| expected closure that takes a single tuple as argument
|
||||
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
|
||||
--> $DIR/closure-arg-count.rs:30:53
|
||||
--> $DIR/closure-arg-count.rs:28:53
|
||||
|
|
||||
30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
|
||||
28 | let _it = vec![1, 2, 3].into_iter().enumerate().map(|i, x, y| i);
|
||||
| ^^^ --------- takes 3 distinct arguments
|
||||
| |
|
||||
| expected closure that takes a single 2-tuple as argument
|
||||
|
||||
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 0 arguments
|
||||
--> $DIR/closure-arg-count.rs:32:53
|
||||
--> $DIR/closure-arg-count.rs:30:53
|
||||
|
|
||||
32 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
|
||||
30 | let _it = vec![1, 2, 3].into_iter().enumerate().map(foo);
|
||||
| ^^^ expected function that takes a single 2-tuple as argument
|
||||
...
|
||||
41 | fn foo() {}
|
||||
37 | fn foo() {}
|
||||
| -------- takes 0 arguments
|
||||
|
||||
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
|
||||
--> $DIR/closure-arg-count.rs:35:53
|
||||
--> $DIR/closure-arg-count.rs:33:53
|
||||
|
|
||||
34 | let bar = |i, x, y| i;
|
||||
32 | let bar = |i, x, y| i;
|
||||
| --------- takes 3 distinct arguments
|
||||
35 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
|
||||
33 | let _it = vec![1, 2, 3].into_iter().enumerate().map(bar);
|
||||
| ^^^ expected closure that takes a single 2-tuple as argument
|
||||
|
||||
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
|
||||
|
@ -31,7 +31,11 @@ error[E0631]: type mismatch in function arguments
|
||||
| expected signature of `for<'r> fn(*mut &'r u32) -> _`
|
||||
| found signature of `fn(*mut &'a u32) -> _`
|
||||
|
|
||||
= note: required by `baz`
|
||||
note: required by `baz`
|
||||
--> $DIR/closure-arg-type-mismatch.rs:18:1
|
||||
|
|
||||
18 | fn baz<F: Fn(*mut &u32)>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::FnOnce<(*mut &'r u32,)>>::Output == ()`
|
||||
--> $DIR/closure-arg-type-mismatch.rs:20:5
|
||||
@ -39,7 +43,11 @@ error[E0271]: type mismatch resolving `for<'r> <fn(*mut &'a u32) as std::ops::Fn
|
||||
20 | baz(f); //~ ERROR type mismatch
|
||||
| ^^^ expected bound lifetime parameter, found concrete lifetime
|
||||
|
|
||||
= note: required by `baz`
|
||||
note: required by `baz`
|
||||
--> $DIR/closure-arg-type-mismatch.rs:18:1
|
||||
|
|
||||
18 | fn baz<F: Fn(*mut &u32)>(_: F) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -5,7 +5,11 @@ error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.r
|
||||
| ^^^ expected bound lifetime parameter, found concrete lifetime
|
||||
|
|
||||
= note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
|
||||
= note: required by `baz`
|
||||
note: required by `baz`
|
||||
--> $DIR/closure-mismatch.rs:15:1
|
||||
|
|
||||
15 | fn baz<T: Foo>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/closure-mismatch.rs:18:5
|
||||
@ -16,7 +20,11 @@ error[E0631]: type mismatch in closure arguments
|
||||
| expected signature of `for<'r> fn(&'r ()) -> _`
|
||||
|
|
||||
= note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
|
||||
= note: required by `baz`
|
||||
note: required by `baz`
|
||||
--> $DIR/closure-mismatch.rs:15:1
|
||||
|
|
||||
15 | fn baz<T: Foo>(_: T) {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -7,7 +7,11 @@ error[E0631]: type mismatch in function arguments
|
||||
21 | apply(&3, takes_mut);
|
||||
| ^^^^^ expected signature of `fn(&{integer}) -> _`
|
||||
|
|
||||
= note: required by `apply`
|
||||
note: required by `apply`
|
||||
--> $DIR/fn-variance-1.rs:15:1
|
||||
|
|
||||
15 | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0631]: type mismatch in function arguments
|
||||
--> $DIR/fn-variance-1.rs:25:5
|
||||
@ -18,7 +22,11 @@ error[E0631]: type mismatch in function arguments
|
||||
25 | apply(&mut 3, takes_imm);
|
||||
| ^^^^^ expected signature of `fn(&mut {integer}) -> _`
|
||||
|
|
||||
= note: required by `apply`
|
||||
note: required by `apply`
|
||||
--> $DIR/fn-variance-1.rs:15:1
|
||||
|
|
||||
15 | fn apply<T, F>(t: T, f: F) where F: FnOnce(T) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -1,12 +1,17 @@
|
||||
error[E0631]: type mismatch in closure arguments
|
||||
--> $DIR/unboxed-closures-vtable-mismatch.rs:23:13
|
||||
--> $DIR/unboxed-closures-vtable-mismatch.rs:25:13
|
||||
|
|
||||
22 | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
|
||||
23 | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y });
|
||||
| ----------------------------- found signature of `fn(usize, isize) -> _`
|
||||
23 | let z = call_it(3, f);
|
||||
24 | //~^ NOTE found signature of `fn(usize, isize) -> _`
|
||||
25 | let z = call_it(3, f);
|
||||
| ^^^^^^^ expected signature of `fn(isize, isize) -> _`
|
||||
|
|
||||
= note: required by `call_it`
|
||||
note: required by `call_it`
|
||||
--> $DIR/unboxed-closures-vtable-mismatch.rs:17:1
|
||||
|
|
||||
17 | fn call_it<F:FnMut(isize,isize)->isize>(y: isize, mut f: F) -> isize {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -0,0 +1,61 @@
|
||||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test if the on_unimplemented message override works
|
||||
|
||||
#![feature(on_unimplemented)]
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
struct Foo<T>(T);
|
||||
struct Bar<T>(T);
|
||||
|
||||
#[rustc_on_unimplemented(
|
||||
on(_Self="[i32]", label="trait label if i32"),
|
||||
label="trait label",
|
||||
message="trait message",
|
||||
)]
|
||||
trait Index<Idx: ?Sized> {
|
||||
type Output: ?Sized;
|
||||
fn index(&self, index: Idx) -> &Self::Output;
|
||||
}
|
||||
|
||||
#[rustc_on_unimplemented(
|
||||
label="impl foo {Self} {Idx} {Index}",
|
||||
)]
|
||||
impl Index<Foo<usize>> for [i32] {
|
||||
type Output = i32;
|
||||
fn index(&self, _index: Foo<usize>) -> &i32 {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
#[rustc_on_unimplemented = "on impl for Bar"]
|
||||
impl Index<Bar<usize>> for [i32] {
|
||||
type Output = i32;
|
||||
fn index(&self, _index: Bar<usize>) -> &i32 {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
|
||||
#[rustc_error]
|
||||
fn main() {
|
||||
Index::index(&[] as &[i32], 2usize);
|
||||
Index::index(&[] as &[i32], 2u32);
|
||||
Index::index(&[] as &[u32], 2u32);
|
||||
//~^ ERROR E0277
|
||||
//~| ERROR E0277
|
||||
Index::index(&[] as &[i32], Foo(2usize));
|
||||
Index::index(&[] as &[i32], Foo(2u32));
|
||||
//~^ ERROR E0277
|
||||
//~| ERROR E0277
|
||||
Index::index(&[] as &[i32], Bar(2u32));
|
||||
//~^ ERROR E0277
|
||||
//~| ERROR E0277
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
error[E0277]: trait message `[i32]`
|
||||
--> $DIR/multiple-impls-complex-filtering.rs:46:5
|
||||
|
|
||||
46 | Index::index(&[] as &[i32], 2usize);
|
||||
| ^^^^^^^^^^^^ u32 message
|
||||
|
|
||||
= help: the trait `Index<_>` is not implemented for `[i32]`
|
||||
note: required by `Index::index`
|
||||
--> $DIR/multiple-impls-complex-filtering.rs:25:5
|
||||
|
|
||||
25 | fn index(&self, index: Idx) -> &Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: trait message `[i32]`
|
||||
--> $DIR/multiple-impls-complex-filtering.rs:46:5
|
||||
|
|
||||
46 | Index::index(&[] as &[i32], 2usize);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u32 message
|
||||
|
|
||||
= help: the trait `Index<_>` is not implemented for `[i32]`
|
||||
|
||||
error[E0277]: trait message `[i32]`
|
||||
--> $DIR/multiple-impls-complex-filtering.rs:47:5
|
||||
|
|
||||
47 | Index::index(&[] as &[i32], 2u32);
|
||||
| ^^^^^^^^^^^^ u32 message
|
||||
|
|
||||
= help: the trait `Index<_>` is not implemented for `[i32]`
|
||||
note: required by `Index::index`
|
||||
--> $DIR/multiple-impls-complex-filtering.rs:25:5
|
||||
|
|
||||
25 | fn index(&self, index: Idx) -> &Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: trait message `[i32]`
|
||||
--> $DIR/multiple-impls-complex-filtering.rs:47:5
|
||||
|
|
||||
47 | Index::index(&[] as &[i32], 2u32);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ u32 message
|
||||
|
|
||||
= help: the trait `Index<_>` is not implemented for `[i32]`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
@ -5,7 +5,11 @@ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
|
||||
| ^^^^^^^^^^^^ trait message
|
||||
|
|
||||
= help: the trait `Index<u32>` is not implemented for `[i32]`
|
||||
= note: required by `Index::index`
|
||||
note: required by `Index::index`
|
||||
--> $DIR/multiple-impls.rs:22:5
|
||||
|
|
||||
22 | fn index(&self, index: Idx) -> &Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
|
||||
--> $DIR/multiple-impls.rs:43:5
|
||||
@ -22,7 +26,11 @@ error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
|
||||
| ^^^^^^^^^^^^ on impl for Foo
|
||||
|
|
||||
= help: the trait `Index<Foo<u32>>` is not implemented for `[i32]`
|
||||
= note: required by `Index::index`
|
||||
note: required by `Index::index`
|
||||
--> $DIR/multiple-impls.rs:22:5
|
||||
|
|
||||
22 | fn index(&self, index: Idx) -> &Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `[i32]: Index<Foo<u32>>` is not satisfied
|
||||
--> $DIR/multiple-impls.rs:46:5
|
||||
@ -39,7 +47,11 @@ error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
|
||||
| ^^^^^^^^^^^^ on impl for Bar
|
||||
|
|
||||
= help: the trait `Index<Bar<u32>>` is not implemented for `[i32]`
|
||||
= note: required by `Index::index`
|
||||
note: required by `Index::index`
|
||||
--> $DIR/multiple-impls.rs:22:5
|
||||
|
|
||||
22 | fn index(&self, index: Idx) -> &Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `[i32]: Index<Bar<u32>>` is not satisfied
|
||||
--> $DIR/multiple-impls.rs:49:5
|
||||
|
@ -5,7 +5,11 @@ error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
|
||||
| ^^^^^^^^^^^^^^^^^^^ a usize is required to index into a slice
|
||||
|
|
||||
= help: the trait `Index<u32>` is not implemented for `[i32]`
|
||||
= note: required by `Index::index`
|
||||
note: required by `Index::index`
|
||||
--> $DIR/on-impl.rs:19:5
|
||||
|
|
||||
19 | fn index(&self, index: Idx) -> &Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `[i32]: Index<u32>` is not satisfied
|
||||
--> $DIR/on-impl.rs:32:5
|
||||
|
@ -5,7 +5,11 @@ error[E0277]: the trait bound `std::option::Option<std::vec::Vec<u8>>: MyFromIte
|
||||
| ^^^^^^^ a collection of type `std::option::Option<std::vec::Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
|
||||
|
|
||||
= help: the trait `MyFromIterator<&u8>` is not implemented for `std::option::Option<std::vec::Vec<u8>>`
|
||||
= note: required by `collect`
|
||||
note: required by `collect`
|
||||
--> $DIR/on-trait.rs:31:1
|
||||
|
|
||||
31 | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the trait bound `std::string::String: Bar::Foo<u8, _, u32>` is not satisfied
|
||||
--> $DIR/on-trait.rs:40:21
|
||||
@ -14,7 +18,11 @@ error[E0277]: the trait bound `std::string::String: Bar::Foo<u8, _, u32>` is not
|
||||
| ^^^^^^ test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
|
||||
|
|
||||
= help: the trait `Bar::Foo<u8, _, u32>` is not implemented for `std::string::String`
|
||||
= note: required by `foobar`
|
||||
note: required by `foobar`
|
||||
--> $DIR/on-trait.rs:21:1
|
||||
|
|
||||
21 | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -4,7 +4,11 @@ error[E0277]: the trait bound `u8: Tr` is not satisfied
|
||||
17 | let a: u8 = Tr::C; //~ ERROR the trait bound `u8: Tr` is not satisfied
|
||||
| ^^^^^ the trait `Tr` is not implemented for `u8`
|
||||
|
|
||||
= note: required by `Tr::C`
|
||||
note: required by `Tr::C`
|
||||
--> $DIR/issue-29595.rs:13:5
|
||||
|
|
||||
13 | const C: Self;
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -22,7 +22,11 @@ error[E0277]: the trait bound `(): std::ops::Try` is not satisfied
|
||||
25 | try_trait_generic::<()>(); //~ ERROR the trait bound
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()`
|
||||
|
|
||||
= note: required by `try_trait_generic`
|
||||
note: required by `try_trait_generic`
|
||||
--> $DIR/try-operator-on-main.rs:30:1
|
||||
|
|
||||
30 | fn try_trait_generic<T: Try>() -> T {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
|
||||
--> $DIR/try-operator-on-main.rs:32:5
|
||||
|
@ -10,7 +10,11 @@ error[E0283]: type annotations required: cannot resolve `&'a T: Foo`
|
||||
21 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: required by `Foo`
|
||||
note: required by `Foo`
|
||||
--> $DIR/issue-40294.rs:11:1
|
||||
|
|
||||
11 | trait Foo: Sized {
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user