Update tests

This commit is contained in:
Vadim Petrochenkov 2020-01-08 20:02:10 +03:00
parent 41318e9a26
commit 642669c74d
204 changed files with 2843 additions and 357 deletions

View File

@ -6,6 +6,7 @@ const fn f(x: usize) -> usize {
let mut sum = 0;
for i in 0..x {
//~^ ERROR E0015
//~| ERROR E0015
//~| ERROR E0658
//~| ERROR E0080
//~| ERROR E0744

View File

@ -8,6 +8,7 @@ fn main() {
//~| WARN denote infinite loops with
[(); { for _ in 0usize.. {}; 0}];
//~^ ERROR calls in constants are limited to constant functions
//~| ERROR calls in constants are limited to constant functions
//~| ERROR `for` is not allowed in a `const`
//~| ERROR references in constants may only refer to immutable values
//~| ERROR evaluation of constant value failed

View File

@ -10,6 +10,8 @@ fn lintme() { } //~ ERROR item is named 'lintme'
#[allow(test_lint)]
//~^ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
pub fn main() {
lintme();
}

View File

@ -7,6 +7,15 @@ LL | #![forbid(test_lint)]
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
...
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-plugin-forbid-attrs.rs:5:1
|
@ -27,6 +36,15 @@ note: lint level defined here
LL | #![forbid(test_lint)]
| ^^^^^^^^^
error: aborting due to 2 previous errors
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-attrs.rs:11:9
|
LL | #![forbid(test_lint)]
| --------- `forbid` level set here
...
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0453`.

View File

@ -8,6 +8,8 @@
fn lintme() { } //~ ERROR item is named 'lintme'
#[allow(test_lint)] //~ ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
//~| ERROR allow(test_lint) overruled by outer forbid(test_lint)
pub fn main() {
lintme();
}

View File

@ -6,6 +6,14 @@ LL | #[allow(test_lint)]
|
= note: `forbid` lint level was set on command line
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-plugin-forbid-cmdline.rs:6:1
|
@ -22,6 +30,14 @@ LL | fn lintme() { }
|
= note: requested on the command line with `-F test-lint`
error: aborting due to 2 previous errors
error[E0453]: allow(test_lint) overruled by outer forbid(test_lint)
--> $DIR/lint-plugin-forbid-cmdline.rs:10:9
|
LL | #[allow(test_lint)]
| ^^^^^^^^^ overruled by previous forbid
|
= note: `forbid` lint level was set on command line
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0453`.

View File

@ -2,6 +2,10 @@ warning: lint name `test_lint` is deprecated and does not have an effect anymore
|
= note: requested on the command line with `-A test_lint`
warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-cmdline-allow.rs:7:1
|
@ -10,6 +14,10 @@ LL | #![plugin(lint_tool_test)]
|
= note: `#[warn(deprecated)]` on by default
warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`
warning: item is named 'lintme'
--> $DIR/lint-tool-cmdline-allow.rs:9:1
|
@ -18,3 +26,7 @@ LL | fn lintme() {}
|
= note: `#[warn(clippy::test_lint)]` on by default
warning: lint name `test_lint` is deprecated and does not have an effect anymore. Use: clippy::test_lint
|
= note: requested on the command line with `-A test_lint`

View File

@ -8,9 +8,12 @@
#![allow(dead_code)]
#![cfg_attr(foo, warn(test_lint))]
//~^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~^^ WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_lint` is deprecated and may not have an effect in the future
#![deny(clippy_group)]
//~^ WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `clippy_group` is deprecated and may not have an effect in the future
fn lintme() { } //~ ERROR item is named 'lintme'
@ -25,6 +28,8 @@ pub fn main() {
#[allow(test_group)]
//~^ WARNING lint name `test_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
//~| WARNING lint name `test_group` is deprecated and may not have an effect in the future
#[deny(this_lint_does_not_exist)] //~ WARNING unknown lint: `this_lint_does_not_exist`
fn hello() {
fn lintmetoo() { }

View File

@ -7,19 +7,19 @@ LL | #![cfg_attr(foo, warn(test_lint))]
= note: `#[warn(renamed_and_removed_lints)]` on by default
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:26:9
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
warning: unknown lint: `this_lint_does_not_exist`
--> $DIR/lint-tool-test.rs:28:8
--> $DIR/lint-tool-test.rs:33:8
|
LL | #[deny(this_lint_does_not_exist)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -32,6 +32,18 @@ warning: lint name `test_lint` is deprecated and may not have an effect in the f
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
--> $DIR/lint-tool-test.rs:6:1
|
@ -40,31 +52,49 @@ LL | #![plugin(lint_tool_test)]
|
= note: `#[warn(deprecated)]` on by default
warning: lint name `test_lint` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:9:23
|
LL | #![cfg_attr(foo, warn(test_lint))]
| ^^^^^^^^^ help: change it to: `clippy::test_lint`
warning: lint name `clippy_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^ help: change it to: `clippy::group`
error: item is named 'lintme'
--> $DIR/lint-tool-test.rs:15:1
--> $DIR/lint-tool-test.rs:18:1
|
LL | fn lintme() { }
| ^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_lint)]` implied by `#[deny(clippy::group)]`
error: item is named 'lintmetoo'
--> $DIR/lint-tool-test.rs:23:5
--> $DIR/lint-tool-test.rs:26:5
|
LL | fn lintmetoo() { }
| ^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-tool-test.rs:12:9
--> $DIR/lint-tool-test.rs:13:9
|
LL | #![deny(clippy_group)]
| ^^^^^^^^^^^^
= note: `#[deny(clippy::test_group)]` implied by `#[deny(clippy::group)]`
warning: lint name `test_group` is deprecated and may not have an effect in the future. Also `cfg_attr(cargo-clippy)` won't be necessary anymore
--> $DIR/lint-tool-test.rs:29:9
|
LL | #[allow(test_group)]
| ^^^^^^^^^^ help: change it to: `clippy::test_group`
error: aborting due to 2 previous errors

View File

@ -157,10 +157,13 @@ trait TRW3<T> where T: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
//~| ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
//~^ ERROR the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified [E0719]
trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }

View File

@ -531,7 +531,15 @@ LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:160:46
--> $DIR/duplicate.rs:158:46
|
LL | trait TRSW1 where Self: Iterator<Item: Copy, Item: Send> {}
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:161:46
|
LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
@ -539,7 +547,15 @@ LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:162:49
--> $DIR/duplicate.rs:161:46
|
LL | trait TRSW2 where Self: Iterator<Item: Copy, Item: Copy> {}
| ---------- ^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:164:49
|
LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -547,7 +563,15 @@ LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:164:43
--> $DIR/duplicate.rs:164:49
|
LL | trait TRSW3 where Self: Iterator<Item: 'static, Item: 'static> {}
| ------------- ^^^^^^^^^^^^^ re-bound here
| |
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:167:43
|
LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
| ---------- ^^^^^^^^^^ re-bound here
@ -555,7 +579,7 @@ LL | trait TRA1 { type A: Iterator<Item: Copy, Item: Send>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:166:43
--> $DIR/duplicate.rs:169:43
|
LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
| ---------- ^^^^^^^^^^ re-bound here
@ -563,7 +587,7 @@ LL | trait TRA2 { type A: Iterator<Item: Copy, Item: Copy>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:168:46
--> $DIR/duplicate.rs:171:46
|
LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -571,7 +595,7 @@ LL | trait TRA3 { type A: Iterator<Item: 'static, Item: 'static>; }
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:171:40
--> $DIR/duplicate.rs:174:40
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ---------- ^^^^^^^^^^ re-bound here
@ -579,7 +603,7 @@ LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:175:44
--> $DIR/duplicate.rs:178:44
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ---------- ^^^^^^^^^^ re-bound here
@ -587,7 +611,7 @@ LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| `Item` bound here first
error[E0719]: the value of the associated type `Item` (from trait `std::iter::Iterator`) is already specified
--> $DIR/duplicate.rs:179:43
--> $DIR/duplicate.rs:182:43
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ------------- ^^^^^^^^^^^^^ re-bound here
@ -667,40 +691,40 @@ LL | type ETAI6 = impl Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:171:28
--> $DIR/duplicate.rs:174:28
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:171:40
--> $DIR/duplicate.rs:174:40
|
LL | type TADyn1 = dyn Iterator<Item: Copy, Item: Send>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:175:32
--> $DIR/duplicate.rs:178:32
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:175:44
--> $DIR/duplicate.rs:178:44
|
LL | type TADyn2 = Box<dyn Iterator<Item: Copy, Item: Copy>>;
| ^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:179:28
--> $DIR/duplicate.rs:182:28
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: could not find defining uses
--> $DIR/duplicate.rs:179:43
--> $DIR/duplicate.rs:182:43
|
LL | type TADyn3 = dyn Iterator<Item: 'static, Item: 'static>;
| ^^^^^^^^^^^^^
error: aborting due to 93 previous errors
error: aborting due to 96 previous errors

View File

@ -8,6 +8,7 @@ impl<T> Trait<'_, '_> for T { }
async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
//~^ ERROR ambiguous lifetime bound
//~| ERROR ambiguous lifetime bound
(a, b)
}

View File

@ -6,5 +6,13 @@ LL | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'
|
= help: add #![feature(member_constraints)] to the crate attributes to enable
error: aborting due to previous error
error: ambiguous lifetime bound in `impl Trait`
--> $DIR/ret-impl-trait-no-fg.rs:9:64
|
LL | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> {
| ^^^^^^^^^^^^^^^^^^ neither `'a` nor `'b` outlives the other
|
= help: add #![feature(member_constraints)] to the crate attributes to enable
error: aborting due to 2 previous errors

View File

@ -8,8 +8,16 @@ async fn bar<T>() -> () {}
async fn foo() {
bar().await;
//~^ ERROR type inside `async fn` body must be known in this context
//~| ERROR type inside `async fn` body must be known in this context
//~| ERROR type inside `async fn` body must be known in this context
//~| NOTE cannot infer type for type parameter `T`
//~| NOTE cannot infer type for type parameter `T`
//~| NOTE cannot infer type for type parameter `T`
//~| NOTE the type is part of the `async fn` body because of this `await`
//~| NOTE the type is part of the `async fn` body because of this `await`
//~| NOTE the type is part of the `async fn` body because of this `await`
//~| NOTE in this expansion of desugaring of `await`
//~| NOTE in this expansion of desugaring of `await`
//~| NOTE in this expansion of desugaring of `await`
}
fn main() {}

View File

@ -10,6 +10,30 @@ note: the type is part of the `async fn` body because of this `await`
LL | bar().await;
| ^^^^^^^^^^^
error: aborting due to previous error
error[E0698]: type inside `async fn` body must be known in this context
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^ cannot infer type for type parameter `T` declared on the function `bar`
|
note: the type is part of the `async fn` body because of this `await`
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^^^^^^^^^
error[E0698]: type inside `async fn` body must be known in this context
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^ cannot infer type for type parameter `T` declared on the function `bar`
|
note: the type is part of the `async fn` body because of this `await`
--> $DIR/unresolved_type_param.rs:9:5
|
LL | bar().await;
| ^^^^^^^^^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0698`.

View File

@ -11,4 +11,5 @@ use tool as renamed_tool; // OK
#[renamed_attr] //~ ERROR cannot use an explicitly registered attribute through an import
#[renamed_tool::attr] //~ ERROR cannot use a tool module through an import
//~| ERROR cannot use a tool module through an import
fn main() {}

View File

@ -22,5 +22,17 @@ note: the tool module imported here
LL | use tool as renamed_tool; // OK
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error: cannot use a tool module through an import
--> $DIR/register-attr-tool-import.rs:13:3
|
LL | #[renamed_tool::attr]
| ^^^^^^^^^^^^
|
note: the tool module imported here
--> $DIR/register-attr-tool-import.rs:10:5
|
LL | use tool as renamed_tool; // OK
| ^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View File

@ -26,6 +26,7 @@ impl<'a, 't> Foo<'a, 't> for &'a isize {
fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
//~^ ERROR method not compatible with trait
//~| ERROR method not compatible with trait
//
// Note: This is a terrible error message. It is caused
// because, in the trait, 'b is early bound, and in the impl,

View File

@ -35,8 +35,27 @@ note: ...does not necessarily outlive the lifetime `'c` as defined on the method
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
error[E0308]: method not compatible with trait
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:5
|
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<'_>)`
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
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
note: ...does not necessarily outlive the lifetime `'c` as defined on the method body at 27:24
--> $DIR/regions-bound-missing-bound-in-impl.rs:27:24
|
LL | fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
| ^^
error[E0195]: lifetime parameters or bounds on method `wrong_bound2` do not match the trait declaration
--> $DIR/regions-bound-missing-bound-in-impl.rs:41:20
--> $DIR/regions-bound-missing-bound-in-impl.rs:42:20
|
LL | fn wrong_bound2<'b,'c,'d:'a+'b>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>);
| ---------------- lifetimes in impl do not match this method in trait
@ -45,7 +64,7 @@ LL | fn wrong_bound2(self, b: Inv, c: Inv, d: Inv) {
| ^ lifetimes do not match method in trait
error[E0276]: impl has stricter requirements than trait
--> $DIR/regions-bound-missing-bound-in-impl.rs:48:5
--> $DIR/regions-bound-missing-bound-in-impl.rs:49:5
|
LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
| ------------------------------------------------------- definition of `another_bound` from trait
@ -53,7 +72,7 @@ LL | fn another_bound<'x: 'a>(self, x: Inv<'x>, y: Inv<'t>);
LL | fn another_bound<'x: 't>(self, x: Inv<'x>, y: Inv<'t>) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'x: 't`
error: aborting due to 5 previous errors
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0195, E0276, E0308.
For more information about an error, try `rustc --explain E0195`.

View File

@ -14,6 +14,7 @@ fn main() {
match -128i8 {
NEG_NEG_128 => println!("A"),
//~^ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
_ => println!("B"),
}
}

View File

@ -4,5 +4,11 @@ error: could not evaluate constant pattern
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
error: aborting due to previous error
error: could not evaluate constant pattern
--> $DIR/const-eval-overflow-2.rs:15:9
|
LL | NEG_NEG_128 => println!("A"),
| ^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -5,6 +5,7 @@ fn main() {
match n {
0..=10 => {},
10..=BAR => {}, //~ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
_ => {},
}
}

View File

@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/ref_to_int_match.rs:24:1
--> $DIR/ref_to_int_match.rs:25:1
|
LL | const BAR: Int = unsafe { Foo { r: &42 }.f };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected initialized plain (non-pointer) bytes
@ -12,6 +12,12 @@ error: could not evaluate constant pattern
LL | 10..=BAR => {},
| ^^^
error: aborting due to 2 previous errors
error: could not evaluate constant pattern
--> $DIR/ref_to_int_match.rs:7:14
|
LL | 10..=BAR => {},
| ^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0080`.

View File

@ -17,6 +17,7 @@ macro_rules! mac {
enum E {
$( $v = $s::V, )*
//~^ ERROR mismatched types
//~| ERROR mismatched types
}
}
}

View File

@ -15,6 +15,23 @@ help: you can convert an `i32` to `isize` and panic if the converted value would
LL | $( $v = $s::V.try_into().unwrap(), )*
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/enum-discr-type-err.rs:18:21
|
LL | $( $v = $s::V, )*
| ^^^^^ expected `isize`, found `i32`
...
LL | / mac! {
LL | | A = F,
LL | | B = T,
LL | | }
| |_- in this macro invocation
|
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
|
LL | $( $v = $s::V.try_into().unwrap(), )*
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View File

@ -10,6 +10,7 @@ fn main() {
match C {
C => {}
//~^ ERROR to use a constant of type `S` in a pattern, `S` must be annotated with
//~| ERROR to use a constant of type `S` in a pattern, `S` must be annotated with
}
const K: &T = &T;
match K { //~ ERROR non-exhaustive patterns: `&T` not covered

View File

@ -5,7 +5,7 @@ LL | C => {}
| ^
error[E0004]: non-exhaustive patterns: `&T` not covered
--> $DIR/match_ice.rs:15:11
--> $DIR/match_ice.rs:16:11
|
LL | struct T;
| --------- `T` defined here
@ -15,6 +15,12 @@ LL | match K {
|
= help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
error: aborting due to 2 previous errors
error: to use a constant of type `S` in a pattern, `S` must be annotated with `#[derive(PartialEq, Eq)]`
--> $DIR/match_ice.rs:11:9
|
LL | C => {}
| ^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0004`.

View File

@ -28,6 +28,7 @@ const READ_INTERIOR_MUT: usize = {
static mut MUTABLE: u32 = 0;
const READ_MUT: u32 = unsafe { MUTABLE }; //~ WARN any use of this value will cause an error
//~^ WARN skipping const checks
//~| WARN skipping const checks
// ok some day perhaps
const READ_IMMUT: &usize = { //~ ERROR it is undefined behavior to use this value

View File

@ -29,7 +29,13 @@ LL | const READ_MUT: u32 = unsafe { MUTABLE };
| ^^^^^^^
warning: skipping const checks
--> $DIR/const_refers_to_static.rs:35:6
--> $DIR/const_refers_to_static.rs:29:32
|
LL | const READ_MUT: u32 = unsafe { MUTABLE };
| ^^^^^^^
warning: skipping const checks
--> $DIR/const_refers_to_static.rs:36:6
|
LL | &FOO
| ^^^
@ -84,7 +90,7 @@ LL | const READ_MUT: u32 = unsafe { MUTABLE };
| constant accesses static
error[E0080]: it is undefined behavior to use this value
--> $DIR/const_refers_to_static.rs:33:1
--> $DIR/const_refers_to_static.rs:34:1
|
LL | / const READ_IMMUT: &usize = {
LL | | static FOO: usize = 0;

View File

@ -8,6 +8,7 @@
fn main() {
match &b""[..] {
ZST => {} //~ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
}
}

View File

@ -1,5 +1,5 @@
error: any use of this value will cause an error
--> $DIR/transmute-size-mismatch-before-typeck.rs:14:29
--> $DIR/transmute-size-mismatch-before-typeck.rs:15:29
|
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ----------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^---
@ -15,7 +15,7 @@ LL | ZST => {}
| ^^^
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
--> $DIR/transmute-size-mismatch-before-typeck.rs:14:29
--> $DIR/transmute-size-mismatch-before-typeck.rs:15:29
|
LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^
@ -23,6 +23,12 @@ LL | const ZST: &[u8] = unsafe { std::mem::transmute(1usize) };
= note: source type: `usize` (word size)
= note: target type: `&'static [u8]` (2 * word size)
error: aborting due to 3 previous errors
error: could not evaluate constant pattern
--> $DIR/transmute-size-mismatch-before-typeck.rs:10:9
|
LL | ZST => {}
| ^^^
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0512`.

View File

@ -3,6 +3,7 @@
trait Foo<X = Box<dyn Foo>> {
//~^ ERROR cycle detected
//~| ERROR cycle detected
}
fn main() { }

View File

@ -11,6 +11,19 @@ note: cycle used when collecting item types in top-level module
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0391]: cycle detected when processing `Foo::X`
--> $DIR/cycle-trait-default-type-trait.rs:4:23
|
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^
|
= note: ...which again requires processing `Foo::X`, completing the cycle
note: cycle used when collecting item types in top-level module
--> $DIR/cycle-trait-default-type-trait.rs:4:1
|
LL | trait Foo<X = Box<dyn Foo>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0391`.

View File

@ -1,5 +1,5 @@
// revisions: duplicate deduplicate
//[duplicate] compile-flags: -Z deduplicate-diagnostics=no
//[deduplicate] compile-flags: -Z deduplicate-diagnostics=yes
#[derive(Unresolved)] //~ ERROR cannot find derive macro `Unresolved` in this scope
//[duplicate]~| ERROR cannot find derive macro `Unresolved` in this scope

View File

@ -10,7 +10,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
enum Enum {
A {
x: Error //~ ERROR
x: Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
}
}

View File

@ -7,6 +7,42 @@ LL | x: Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:13:6
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -10,7 +10,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
enum Enum {
A(
Error //~ ERROR
Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
)
}

View File

@ -7,6 +7,42 @@ LL | Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-enum.rs:13:6
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -9,7 +9,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
struct Struct {
x: Error //~ ERROR
x: Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
}
fn main() {}

View File

@ -7,6 +7,42 @@ LL | x: Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-struct.rs:12:5
|
LL | x: Error
| ^^^^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -9,7 +9,11 @@ struct Error;
#[derive(PartialOrd,PartialEq)]
struct Struct(
Error //~ ERROR
Error //~ ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
//~| ERROR can't compare `Error` with `Error`
);
fn main() {}

View File

@ -7,6 +7,42 @@ LL | Error
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Error` with `Error`
--> $DIR/derives-span-PartialOrd-tuple-struct.rs:12:5
|
LL | Error
| ^^^^^ no implementation for `Error < Error` and `Error > Error`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Error`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,9 +1,11 @@
#[derive(Send)]
//~^ ERROR cannot find derive macro `Send` in this scope
//~| ERROR cannot find derive macro `Send` in this scope
struct Test;
#[derive(Sync)]
//~^ ERROR cannot find derive macro `Sync` in this scope
//~| ERROR cannot find derive macro `Sync` in this scope
struct Test1;
pub fn main() {}

View File

@ -1,11 +1,23 @@
error: cannot find derive macro `Sync` in this scope
--> $DIR/deriving-bounds.rs:5:10
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/deriving-bounds.rs:5:10
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
error: cannot find derive macro `Sync` in this scope
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/deriving-bounds.rs:6:10
|
LL | #[derive(Sync)]
| ^^^^
@ -22,5 +34,17 @@ note: unsafe traits like `Send` should be implemented explicitly
LL | #[derive(Send)]
| ^^^^
error: aborting due to 2 previous errors
error: cannot find derive macro `Send` in this scope
--> $DIR/deriving-bounds.rs:1:10
|
LL | #[derive(Send)]
| ^^^^
|
note: unsafe traits like `Send` should be implemented explicitly
--> $DIR/deriving-bounds.rs:1:10
|
LL | #[derive(Send)]
| ^^^^
error: aborting due to 4 previous errors

View File

@ -1,5 +1,6 @@
#[derive(Eqr)]
//~^ ERROR cannot find derive macro `Eqr` in this scope
//~| ERROR cannot find derive macro `Eqr` in this scope
struct Foo;
pub fn main() {}

View File

@ -4,5 +4,11 @@ error: cannot find derive macro `Eqr` in this scope
LL | #[derive(Eqr)]
| ^^^ help: a derive macro with a similar name exists: `Eq`
error: aborting due to previous error
error: cannot find derive macro `Eqr` in this scope
--> $DIR/deriving-meta-unknown-trait.rs:1:10
|
LL | #[derive(Eqr)]
| ^^^ help: a derive macro with a similar name exists: `Eq`
error: aborting due to 2 previous errors

View File

@ -1,4 +1,5 @@
#[derive(FromPrimitive)] //~ ERROR cannot find derive macro `FromPrimitive` in this scope
//~| ERROR cannot find derive macro `FromPrimitive` in this scope
enum Foo {}
fn main() {}

View File

@ -4,5 +4,11 @@ error: cannot find derive macro `FromPrimitive` in this scope
LL | #[derive(FromPrimitive)]
| ^^^^^^^^^^^^^
error: aborting due to previous error
error: cannot find derive macro `FromPrimitive` in this scope
--> $DIR/deriving-primitive.rs:1:10
|
LL | #[derive(FromPrimitive)]
| ^^^^^^^^^^^^^
error: aborting due to 2 previous errors

View File

@ -5,8 +5,10 @@ fn test_and() {
let b = false;
let _ = a and b; //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
if a and b { //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
println!("both");
}
@ -18,8 +20,10 @@ fn test_or() {
let b = false;
let _ = a or b; //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
if a or b { //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
println!("both");
}
}
@ -28,6 +32,7 @@ fn test_and_par() {
let a = true;
let b = false;
if (a and b) { //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
println!("both");
}
}
@ -36,6 +41,7 @@ fn test_or_par() {
let a = true;
let b = false;
if (a or b) { //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
println!("both");
}
}
@ -44,6 +50,7 @@ fn test_while_and() {
let a = true;
let b = false;
while a and b { //~ ERROR `and` is not a logical operator
//~| ERROR `and` is not a logical operator
println!("both");
}
}
@ -52,6 +59,7 @@ fn test_while_or() {
let a = true;
let b = false;
while a or b { //~ ERROR `or` is not a logical operator
//~| ERROR `or` is not a logical operator
println!("both");
}
}

View File

@ -7,7 +7,23 @@ LL | let _ = a and b;
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
--> $DIR/issue-54109-and_instead_of_ampersands.rs:7:15
|
LL | let _ = a and b;
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:10:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:10:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
@ -15,7 +31,7 @@ LL | if a and b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
@ -23,7 +39,23 @@ LL | let _ = a or b;
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
--> $DIR/issue-54109-and_instead_of_ampersands.rs:22:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:25:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:25:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
@ -31,7 +63,15 @@ LL | if a or b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
--> $DIR/issue-54109-and_instead_of_ampersands.rs:34:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:34:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
@ -39,7 +79,15 @@ LL | if (a and b) {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
--> $DIR/issue-54109-and_instead_of_ampersands.rs:43:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:43:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
@ -47,7 +95,15 @@ LL | if (a or b) {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
--> $DIR/issue-54109-and_instead_of_ampersands.rs:52:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:52:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
@ -55,7 +111,15 @@ LL | while a and b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
--> $DIR/issue-54109-and_instead_of_ampersands.rs:61:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
--> $DIR/issue-54109-and_instead_of_ampersands.rs:61:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
@ -63,13 +127,13 @@ LL | while a or b {
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error[E0308]: mismatched types
--> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
--> $DIR/issue-54109-and_instead_of_ampersands.rs:15:33
|
LL | let _recovery_witness: () = 0;
| -- ^ expected `()`, found integer
| |
| expected due to this
error: aborting due to 9 previous errors
error: aborting due to 17 previous errors
For more information about this error, try `rustc --explain E0308`.

View File

@ -2,5 +2,6 @@ fn main() {
match 5u32 {
1000 ..= 5 => {}
//~^ ERROR lower range bound must be less than or equal to upper
//~| ERROR lower range bound must be less than or equal to upper
}
}

View File

@ -4,6 +4,12 @@ error[E0030]: lower range bound must be less than or equal to upper
LL | 1000 ..= 5 => {}
| ^^^^ lower bound larger than upper bound
error: aborting due to previous error
error[E0030]: lower range bound must be less than or equal to upper
--> $DIR/E0030.rs:3:9
|
LL | 1000 ..= 5 => {}
| ^^^^ lower bound larger than upper bound
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0030`.

View File

@ -1,4 +1,8 @@
#![allow(foo = "")] //~ ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
//~| ERROR E0452
fn main() {
}

View File

@ -4,6 +4,36 @@ error[E0452]: malformed lint attribute input
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error: aborting due to previous error
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error[E0452]: malformed lint attribute input
--> $DIR/E0452.rs:1:10
|
LL | #![allow(foo = "")]
| ^^^^^^^^ bad attribute argument
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0452`.

View File

@ -2,5 +2,7 @@
#[allow(non_snake_case)]
//~^ ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
//~| ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
//~| ERROR allow(non_snake_case) overruled by outer forbid(non_snake_case)
fn main() {
}

View File

@ -7,6 +7,24 @@ LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid
error: aborting due to previous error
error[E0453]: allow(non_snake_case) overruled by outer forbid(non_snake_case)
--> $DIR/E0453.rs:3:9
|
LL | #![forbid(non_snake_case)]
| -------------- `forbid` level set here
LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid
error[E0453]: allow(non_snake_case) overruled by outer forbid(non_snake_case)
--> $DIR/E0453.rs:3:9
|
LL | #![forbid(non_snake_case)]
| -------------- `forbid` level set here
LL |
LL | #[allow(non_snake_case)]
| ^^^^^^^^^^^^^^ overruled by previous forbid
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0453`.

View File

@ -1,5 +1,6 @@
// repr currently doesn't support literals
#[repr("C")] //~ ERROR E0565
//~| ERROR E0565
struct A { }
fn main() { }

View File

@ -4,6 +4,12 @@ error[E0565]: meta item in `repr` must be an identifier
LL | #[repr("C")]
| ^^^
error: aborting due to previous error
error[E0565]: meta item in `repr` must be an identifier
--> $DIR/E0565.rs:2:8
|
LL | #[repr("C")]
| ^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0565`.

View File

@ -2,6 +2,14 @@ error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`
error: aborting due to previous error
error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`
error[E0602]: unknown lint: `bogus`
|
= note: requested on the command line with `-D bogus`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0602`.

View File

@ -3,14 +3,17 @@
mod derive {
#[derive(x3300)]
//~^ ERROR cannot find derive macro `x3300` in this scope
//~| ERROR cannot find derive macro `x3300` in this scope
union U { f: i32 }
#[derive(x3300)]
//~^ ERROR cannot find derive macro `x3300` in this scope
//~| ERROR cannot find derive macro `x3300` in this scope
enum E { }
#[derive(x3300)]
//~^ ERROR cannot find derive macro `x3300` in this scope
//~| ERROR cannot find derive macro `x3300` in this scope
struct S;
}

View File

@ -1,11 +1,23 @@
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:12:14
--> $DIR/issue-43106-gating-of-derive-2.rs:14:14
|
LL | #[derive(x3300)]
| ^^^^^
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:8:14
--> $DIR/issue-43106-gating-of-derive-2.rs:14:14
|
LL | #[derive(x3300)]
| ^^^^^
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:9:14
|
LL | #[derive(x3300)]
| ^^^^^
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:9:14
|
LL | #[derive(x3300)]
| ^^^^^
@ -16,5 +28,11 @@ error: cannot find derive macro `x3300` in this scope
LL | #[derive(x3300)]
| ^^^^^
error: aborting due to 3 previous errors
error: cannot find derive macro `x3300` in this scope
--> $DIR/issue-43106-gating-of-derive-2.rs:4:14
|
LL | #[derive(x3300)]
| ^^^^^
error: aborting due to 6 previous errors

View File

@ -18,6 +18,7 @@ mod rustc_deprecated {
#[rustc_deprecated()] struct S;
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library
#[rustc_deprecated()] type T = S;
//~^ ERROR stability attributes may not be used outside of the standard library

View File

@ -29,17 +29,23 @@ LL | #[rustc_deprecated()] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:22:5
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:19:5
|
LL | #[rustc_deprecated()] struct S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:23:5
|
LL | #[rustc_deprecated()] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:25:5
--> $DIR/issue-43106-gating-of-rustc_deprecated.rs:26:5
|
LL | #[rustc_deprecated()] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`.

View File

@ -18,6 +18,7 @@ mod stable {
#[stable()] struct S;
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library
#[stable()] type T = S;
//~^ ERROR stability attributes may not be used outside of the standard library

View File

@ -29,17 +29,23 @@ LL | #[stable()] struct S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:22:5
--> $DIR/issue-43106-gating-of-stable.rs:19:5
|
LL | #[stable()] struct S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:23:5
|
LL | #[stable()] type T = S;
| ^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-stable.rs:25:5
--> $DIR/issue-43106-gating-of-stable.rs:26:5
|
LL | #[stable()] impl S { }
| ^^^^^^^^^^^
error: aborting due to 7 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`.

View File

@ -18,6 +18,7 @@ mod unstable {
#[unstable()] struct S;
//~^ ERROR stability attributes may not be used outside of the standard library
//~| ERROR stability attributes may not be used outside of the standard library
#[unstable()] type T = S;
//~^ ERROR stability attributes may not be used outside of the standard library

View File

@ -29,17 +29,23 @@ LL | #[unstable()] struct S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:22:5
--> $DIR/issue-43106-gating-of-unstable.rs:19:5
|
LL | #[unstable()] struct S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:23:5
|
LL | #[unstable()] type T = S;
| ^^^^^^^^^^^^^
error[E0734]: stability attributes may not be used outside of the standard library
--> $DIR/issue-43106-gating-of-unstable.rs:25:5
--> $DIR/issue-43106-gating-of-unstable.rs:26:5
|
LL | #[unstable()] impl S { }
| ^^^^^^^^^^^^^
error: aborting due to 7 previous errors
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0734`.

View File

@ -1,2 +1,3 @@
#[doc(include="asdf.md")] //~ ERROR: `#[doc(include)]` is experimental
//~| ERROR: `#[doc(include)]` is experimental
fn main() {}

View File

@ -7,6 +7,15 @@ LL | #[doc(include="asdf.md")]
= note: for more information, see https://github.com/rust-lang/rust/issues/44732
= help: add `#![feature(external_doc)]` to the crate attributes to enable
error: aborting due to previous error
error[E0658]: `#[doc(include)]` is experimental
--> $DIR/feature-gate-external_doc.rs:1:1
|
LL | #[doc(include="asdf.md")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/44732
= help: add `#![feature(external_doc)]` to the crate attributes to enable
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View File

@ -1,4 +1,6 @@
#![warn(nonstandard_style, reason = "the standard should be respected")]
//~^ ERROR lint reasons are experimental
//~| ERROR lint reasons are experimental
//~| ERROR lint reasons are experimental
fn main() {}

View File

@ -7,6 +7,24 @@ LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
= note: for more information, see https://github.com/rust-lang/rust/issues/54503
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
error: aborting due to previous error
error[E0658]: lint reasons are experimental
--> $DIR/feature-gate-lint-reasons.rs:1:28
|
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/54503
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
error[E0658]: lint reasons are experimental
--> $DIR/feature-gate-lint-reasons.rs:1:28
|
LL | #![warn(nonstandard_style, reason = "the standard should be respected")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/54503
= help: add `#![feature(lint_reasons)]` to the crate attributes to enable
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.

View File

@ -29,6 +29,7 @@ fn main() {
};
assert_foo(gen);
//~^ ERROR implementation of `Foo` is not general enough
//~| ERROR implementation of `Foo` is not general enough
// Allow impls which matches any lifetime
let x = &OnlyFooIfRef(No);
@ -47,4 +48,5 @@ fn main() {
};
assert_foo(gen);
//~^ ERROR not general enough
//~| ERROR not general enough
}

View File

@ -11,7 +11,19 @@ LL | assert_foo(gen);
= note: ...but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:48:5
--> $DIR/auto-trait-regions.rs:30:5
|
LL | auto trait Foo {}
| ----------------- trait `Foo` defined here
...
LL | assert_foo(gen);
| ^^^^^^^^^^ implementation of `Foo` is not general enough
|
= note: `Foo` would have to be implemented for the type `&'0 OnlyFooIfStaticRef`, for any lifetime `'0`...
= note: ...but `Foo` is actually implemented for the type `&'1 OnlyFooIfStaticRef`, for some specific lifetime `'1`
error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:49:5
|
LL | auto trait Foo {}
| ----------------- trait `Foo` defined here
@ -22,5 +34,17 @@ LL | assert_foo(gen);
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
= note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
error: aborting due to 2 previous errors
error: implementation of `Foo` is not general enough
--> $DIR/auto-trait-regions.rs:49:5
|
LL | auto trait Foo {}
| ----------------- trait `Foo` defined here
...
LL | assert_foo(gen);
| ^^^^^^^^^^ implementation of `Foo` is not general enough
|
= note: `Foo` would have to be implemented for the type `A<'0, '1>`, for any two lifetimes `'0` and `'1`...
= note: ...but `Foo` is actually implemented for the type `A<'_, '2>`, for some specific lifetime `'2`
error: aborting due to 4 previous errors

View File

@ -44,6 +44,7 @@ fn foo_hrtb_bar_not<'b,T>(mut t: T)
// isize>`, we require `T : for<'a> Bar<&'a isize>`, but the where
// clause only specifies `T : Bar<&'b isize>`.
foo_hrtb_bar_not(&mut t); //~ ERROR mismatched types
//~| ERROR mismatched types
}
fn foo_hrtb_bar_hrtb<T>(mut t: T)

View File

@ -7,6 +7,15 @@ LL | foo_hrtb_bar_not(&mut t);
= note: expected type `Bar<&'a isize>`
found type `Bar<&'b isize>`
error: aborting due to previous error
error[E0308]: mismatched types
--> $DIR/hrtb-perfect-forwarding.rs:46:5
|
LL | foo_hrtb_bar_not(&mut t);
| ^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected type `Bar<&'a isize>`
found type `Bar<&'b isize>`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.

View File

@ -11,10 +11,46 @@ LL | let filter = map.filter(|x: &_| true);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:116:17
--> $DIR/issue-30786.rs:114:18
|
LL | let filter = map.filter(|x: &_| true);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:114:18
|
LL | let filter = map.filter(|x: &_| true);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:114:18
|
LL | let filter = map.filter(|x: &_| true);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:119:17
|
LL | let count = filter.count(); // Assert that we still have a valid stream.
| ^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:119:17
|
LL | let count = filter.count(); // Assert that we still have a valid stream.
| ^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:119:17
|
LL | let count = filter.count(); // Assert that we still have a valid stream.
| ^^^^^^^^^^^^^^
error: higher-ranked subtype error
--> $DIR/issue-30786.rs:119:17
|
LL | let count = filter.count(); // Assert that we still have a valid stream.
| ^^^^^^^^^^^^^^
error: aborting due to 9 previous errors

View File

@ -113,7 +113,12 @@ fn main() {
//[migrate]~| NOTE implementation of `Stream` is not general enough
let filter = map.filter(|x: &_| true);
//[nll]~^ ERROR higher-ranked subtype error
//[nll]~| ERROR higher-ranked subtype error
//[nll]~| ERROR higher-ranked subtype error
//[nll]~| ERROR higher-ranked subtype error
let count = filter.count(); // Assert that we still have a valid stream.
//[nll]~^ ERROR higher-ranked subtype error
//[nll]~| ERROR higher-ranked subtype error
//[nll]~| ERROR higher-ranked subtype error
//[nll]~| ERROR higher-ranked subtype error
}

View File

@ -12,6 +12,7 @@ fn main() {
fn cycle1() -> impl Clone {
//~^ ERROR cycle detected
//~| ERROR cycle detected
//~| ERROR cycle detected
send(cycle2().clone());
//~^ ERROR cannot be sent between threads safely

View File

@ -11,12 +11,12 @@ LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
note: ...which requires processing `cycle2::{{opaque}}#0`...
--> $DIR/auto-trait-leak.rs:21:16
--> $DIR/auto-trait-leak.rs:22:16
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^
note: ...which requires processing `cycle2`...
--> $DIR/auto-trait-leak.rs:21:1
--> $DIR/auto-trait-leak.rs:22:1
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -47,12 +47,47 @@ LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
note: ...which requires processing `cycle2::{{opaque}}#0`...
--> $DIR/auto-trait-leak.rs:21:16
--> $DIR/auto-trait-leak.rs:22:16
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^
note: ...which requires processing `cycle2`...
--> $DIR/auto-trait-leak.rs:21:1
--> $DIR/auto-trait-leak.rs:22:1
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which again requires processing `cycle1::{{opaque}}#0`, completing the cycle
note: cycle used when checking item types in top-level module
--> $DIR/auto-trait-leak.rs:1:1
|
LL | / use std::cell::Cell;
LL | | use std::rc::Rc;
LL | |
LL | | fn send<T: Send>(_: T) {}
... |
LL | | Rc::new(String::from("foo"))
LL | | }
| |_^
error[E0391]: cycle detected when processing `cycle1::{{opaque}}#0`
--> $DIR/auto-trait-leak.rs:12:16
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^
|
note: ...which requires processing `cycle1`...
--> $DIR/auto-trait-leak.rs:12:1
|
LL | fn cycle1() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires evaluating trait selection obligation `impl std::clone::Clone: std::marker::Send`...
note: ...which requires processing `cycle2::{{opaque}}#0`...
--> $DIR/auto-trait-leak.rs:22:16
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^
note: ...which requires processing `cycle2`...
--> $DIR/auto-trait-leak.rs:22:1
|
LL | fn cycle2() -> impl Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -70,7 +105,7 @@ LL | | }
| |_^
error[E0277]: `std::rc::Rc<std::string::String>` cannot be sent between threads safely
--> $DIR/auto-trait-leak.rs:15:5
--> $DIR/auto-trait-leak.rs:16:5
|
LL | fn send<T: Send>(_: T) {}
| ---- ---- required by this bound in `send`
@ -81,7 +116,7 @@ LL | send(cycle2().clone());
= help: within `impl std::clone::Clone`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::string::String>`
= note: required because it appears within the type `impl std::clone::Clone`
error: aborting due to 3 previous errors
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0277, E0391.
For more information about an error, try `rustc --explain E0277`.

View File

@ -3,6 +3,8 @@ use non_existent::non_existent; //~ ERROR unresolved import `non_existent`
#[non_existent] //~ ERROR cannot determine resolution for the attribute macro `non_existent`
#[derive(NonExistent)] //~ ERROR cannot determine resolution for the derive macro `NonExistent`
//~| ERROR cannot determine resolution for the derive macro `NonExistent`
//~| ERROR cannot determine resolution for the derive macro `NonExistent`
struct S;
fn main() {}

View File

@ -29,6 +29,22 @@ LL | #[non_existent]
|
= note: import resolution is stuck, try simplifying macro imports
error: aborting due to 4 previous errors
error: cannot determine resolution for the derive macro `NonExistent`
--> $DIR/issue-55457.rs:5:10
|
LL | #[derive(NonExistent)]
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot determine resolution for the derive macro `NonExistent`
--> $DIR/issue-55457.rs:5:10
|
LL | #[derive(NonExistent)]
| ^^^^^^^^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0432`.

View File

@ -26,6 +26,7 @@ mod inner1 {
}
exported!(); //~ ERROR `exported` is ambiguous
//~| ERROR `exported` is ambiguous
mod inner2 {
define_exported!();

View File

@ -21,8 +21,31 @@ LL | use inner1::*;
| ^^^^^^^^^
= help: consider adding an explicit import of `exported` to disambiguate
error[E0659]: `exported` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
--> $DIR/local-modularized-tricky-fail-1.rs:28:1
|
LL | exported!();
| ^^^^^^^^ ambiguous name
|
note: `exported` could refer to the macro defined here
--> $DIR/local-modularized-tricky-fail-1.rs:5:5
|
LL | / macro_rules! exported {
LL | | () => ()
LL | | }
| |_____^
...
LL | define_exported!();
| ------------------- in this macro invocation
note: `exported` could also refer to the macro imported here
--> $DIR/local-modularized-tricky-fail-1.rs:22:5
|
LL | use inner1::*;
| ^^^^^^^^^
= help: consider adding an explicit import of `exported` to disambiguate
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/local-modularized-tricky-fail-1.rs:35:5
--> $DIR/local-modularized-tricky-fail-1.rs:36:5
|
LL | panic!();
| ^^^^^ ambiguous name
@ -41,7 +64,7 @@ LL | define_panic!();
= help: use `crate::panic` to refer to this macro unambiguously
error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/local-modularized-tricky-fail-1.rs:46:1
--> $DIR/local-modularized-tricky-fail-1.rs:47:1
|
LL | include!();
| ^^^^^^^ ambiguous name
@ -59,6 +82,6 @@ LL | define_include!();
| ------------------ in this macro invocation
= help: use `crate::include` to refer to this macro unambiguously
error: aborting due to 3 previous errors
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0659`.

View File

@ -14,6 +14,7 @@ mod m1 {
mod m2 {
use two_macros::*;
m! { //~ ERROR ambiguous
//~| ERROR ambiguous
use foo::m;
}
}

View File

@ -5,7 +5,25 @@ LL | m! {
| ^ ambiguous name
|
note: `m` could refer to the macro imported here
--> $DIR/macros.rs:17:13
--> $DIR/macros.rs:18:13
|
LL | use foo::m;
| ^^^^^^
note: `m` could also refer to the macro imported here
--> $DIR/macros.rs:15:9
|
LL | use two_macros::*;
| ^^^^^^^^^^^^^
= help: consider adding an explicit import of `m` to disambiguate
error[E0659]: `m` is ambiguous (glob import vs macro-expanded name in the same module during import/macro resolution)
--> $DIR/macros.rs:16:5
|
LL | m! {
| ^ ambiguous name
|
note: `m` could refer to the macro imported here
--> $DIR/macros.rs:18:13
|
LL | use foo::m;
| ^^^^^^
@ -17,23 +35,23 @@ LL | use two_macros::*;
= help: consider adding an explicit import of `m` to disambiguate
error[E0659]: `m` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/macros.rs:29:9
--> $DIR/macros.rs:30:9
|
LL | m! {
| ^ ambiguous name
|
note: `m` could refer to the macro imported here
--> $DIR/macros.rs:30:17
--> $DIR/macros.rs:31:17
|
LL | use two_macros::n as m;
| ^^^^^^^^^^^^^^^^^^
note: `m` could also refer to the macro imported here
--> $DIR/macros.rs:22:9
--> $DIR/macros.rs:23:9
|
LL | use two_macros::m;
| ^^^^^^^^^^^^^
= help: use `self::m` to refer to this macro unambiguously
error: aborting due to 2 previous errors
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0659`.

View File

@ -4,6 +4,7 @@ const C1: &'static mut [usize] = &mut [];
static mut S: usize = 3;
const C2: &'static mut usize = unsafe { &mut S };
//~^ ERROR: constants cannot refer to statics
//~| ERROR: constants cannot refer to statics
//~| ERROR: references in constants may only refer to immutable values
fn main() {}

View File

@ -13,6 +13,12 @@ error[E0013]: constants cannot refer to statics, use a constant instead
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^
error[E0013]: constants cannot refer to statics, use a constant instead
--> $DIR/issue-17718-const-bad-values.rs:5:46
|
LL | const C2: &'static mut usize = unsafe { &mut S };
| ^
error[E0658]: references in constants may only refer to immutable values
--> $DIR/issue-17718-const-bad-values.rs:5:41
|
@ -22,7 +28,7 @@ LL | const C2: &'static mut usize = unsafe { &mut S };
= note: for more information, see https://github.com/rust-lang/rust/issues/57349
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
error: aborting due to 3 previous errors
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0013, E0658.
For more information about an error, try `rustc --explain E0013`.

View File

@ -28,6 +28,7 @@ impl<'a> Publisher<'a> for MyStruct<'a> {
fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
// Not obvious, but there is an implicit lifetime here -------^
//~^^ ERROR cannot infer
//~| ERROR cannot infer
//~| ERROR mismatched types
//~| ERROR mismatched types
//

View File

@ -102,7 +102,49 @@ LL | | }
= note: expected `Publisher<'_>`
found `Publisher<'_>`
error: aborting due to 3 previous errors
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
--> $DIR/issue-20831-debruijn.rs:28:5
|
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
|
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the method body at 28:5...
--> $DIR/issue-20831-debruijn.rs:28:5
|
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
note: ...but the lifetime must also be valid for the lifetime `'a` as defined on the impl at 26:6...
--> $DIR/issue-20831-debruijn.rs:26:6
|
LL | impl<'a> Publisher<'a> for MyStruct<'a> {
| ^^
note: ...so that the types are compatible
--> $DIR/issue-20831-debruijn.rs:28:5
|
LL | / fn subscribe(&mut self, t : Box<dyn Subscriber<Input=<Self as Publisher>::Output> + 'a>) {
LL | | // Not obvious, but there is an implicit lifetime here -------^
LL | |
LL | |
... |
LL | | self.sub = t;
LL | | }
| |_____^
= note: expected `Publisher<'_>`
found `Publisher<'_>`
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0308, E0495.
For more information about an error, try `rustc --explain E0308`.

View File

@ -7,5 +7,6 @@ fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
fn main() {
size_of_copy::<dyn Misc + Copy>();
//~^ ERROR only auto traits can be used as additional traits in a trait object
//~| ERROR only auto traits can be used as additional traits in a trait object
//~| ERROR the trait bound `dyn Misc: std::marker::Copy` is not satisfied
}

View File

@ -9,6 +9,17 @@ LL | size_of_copy::<dyn Misc + Copy>();
| first non-auto trait
| trait alias used in trait object type (first use)
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/issue-32963.rs:8:31
|
LL | size_of_copy::<dyn Misc + Copy>();
| ---- ^^^^
| | |
| | additional non-auto trait
| | trait alias used in trait object type (additional use)
| first non-auto trait
| trait alias used in trait object type (first use)
error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied
--> $DIR/issue-32963.rs:8:5
|
@ -18,7 +29,7 @@ LL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }
LL | size_of_copy::<dyn Misc + Copy>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc`
error: aborting due to 2 previous errors
error: aborting due to 3 previous errors
Some errors have detailed explanations: E0225, E0277.
For more information about an error, try `rustc --explain E0225`.

View File

@ -1,5 +1,6 @@
#[derive(Clone,
Sync, //~ ERROR cannot find derive macro `Sync` in this scope
//~| ERROR cannot find derive macro `Sync` in this scope
Copy)]
enum Foo {}

View File

@ -10,5 +10,17 @@ note: unsafe traits like `Sync` should be implemented explicitly
LL | Sync,
| ^^^^
error: aborting due to previous error
error: cannot find derive macro `Sync` in this scope
--> $DIR/issue-33571.rs:2:10
|
LL | Sync,
| ^^^^
|
note: unsafe traits like `Sync` should be implemented explicitly
--> $DIR/issue-33571.rs:2:10
|
LL | Sync,
| ^^^^
error: aborting due to 2 previous errors

View File

@ -1,5 +1,9 @@
#[derive(PartialEq)] struct Comparable;
#[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
//~^ ERROR can't compare `Comparable`
//~| ERROR can't compare `Comparable`
//~| ERROR can't compare `Comparable`
//~| ERROR can't compare `Comparable`
//~| ERROR can't compare `Comparable`
fn main() {}

View File

@ -7,6 +7,42 @@ LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
= help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to previous error
error[E0277]: can't compare `Comparable` with `Comparable`
--> $DIR/issue-34229.rs:2:46
|
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
| ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Comparable` with `Comparable`
--> $DIR/issue-34229.rs:2:46
|
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
| ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Comparable` with `Comparable`
--> $DIR/issue-34229.rs:2:46
|
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
| ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error[E0277]: can't compare `Comparable` with `Comparable`
--> $DIR/issue-34229.rs:2:46
|
LL | #[derive(PartialEq, PartialOrd)] struct Nope(Comparable);
| ^^^^^^^^^^ no implementation for `Comparable < Comparable` and `Comparable > Comparable`
|
= help: the trait `std::cmp::PartialOrd` is not implemented for `Comparable`
= note: required by `std::cmp::PartialOrd::partial_cmp`
error: aborting due to 5 previous errors
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,4 +1,5 @@
#![derive(Copy)] //~ ERROR `derive` may only be applied to structs, enums and unions
//~| ERROR cannot determine resolution for the derive macro `Copy`
//~| ERROR cannot determine resolution for the derive macro `Copy`
fn main() {}

View File

@ -12,5 +12,13 @@ LL | #![derive(Copy)]
|
= note: import resolution is stuck, try simplifying macro imports
error: aborting due to 2 previous errors
error: cannot determine resolution for the derive macro `Copy`
--> $DIR/issue-36617.rs:1:11
|
LL | #![derive(Copy)]
| ^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: aborting due to 3 previous errors

View File

@ -12,16 +12,28 @@ fn main() {
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING this was previously accepted by the compiler but is being
5.0f32 => {}, //~ ERROR floating-point types cannot be used in patterns
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| WARNING hard error
-5.0 => {}, //~ ERROR floating-point types cannot be used in patterns
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| WARNING hard error
1.0 .. 33.0 => {}, //~ ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
39.0 ..= 70.0 => {}, //~ ERROR floating-point types cannot be used in patterns
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| ERROR floating-point types cannot be used in patterns
//~| ERROR floating-point types cannot be used in patterns
//~| WARNING hard error
//~| WARNING hard error
//~| WARNING hard error
_ => {},
};
@ -29,6 +41,8 @@ fn main() {
// Same for tuples
match (x, 5) {
(3.14, 1) => {}, //~ ERROR floating-point types cannot be used
//~| ERROR floating-point types cannot be used
//~| WARNING hard error
//~| WARNING hard error
_ => {},
}
@ -36,6 +50,8 @@ fn main() {
struct Foo { x: f32 };
match (Foo { x }) {
Foo { x: 2.0 } => {}, //~ ERROR floating-point types cannot be used
//~| ERROR floating-point types cannot be used
//~| WARNING hard error
//~| WARNING hard error
_ => {},
}

View File

@ -22,7 +22,7 @@ LL | 5.0f32 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:16:10
--> $DIR/issue-41255.rs:18:10
|
LL | -5.0 => {},
| ^^^
@ -31,7 +31,7 @@ LL | -5.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:18:9
--> $DIR/issue-41255.rs:22:9
|
LL | 1.0 .. 33.0 => {},
| ^^^
@ -40,7 +40,7 @@ LL | 1.0 .. 33.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:18:16
--> $DIR/issue-41255.rs:22:16
|
LL | 1.0 .. 33.0 => {},
| ^^^^
@ -49,7 +49,7 @@ LL | 1.0 .. 33.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:22:9
--> $DIR/issue-41255.rs:30:9
|
LL | 39.0 ..= 70.0 => {},
| ^^^^
@ -58,7 +58,7 @@ LL | 39.0 ..= 70.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:22:18
--> $DIR/issue-41255.rs:30:18
|
LL | 39.0 ..= 70.0 => {},
| ^^^^
@ -67,7 +67,7 @@ LL | 39.0 ..= 70.0 => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:31:10
--> $DIR/issue-41255.rs:43:10
|
LL | (3.14, 1) => {},
| ^^^^
@ -76,7 +76,7 @@ LL | (3.14, 1) => {},
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:38:18
--> $DIR/issue-41255.rs:52:18
|
LL | Foo { x: 2.0 } => {},
| ^^^
@ -93,5 +93,77 @@ LL | 5.0 => {},
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: aborting due to 10 previous errors
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:14:9
|
LL | 5.0f32 => {},
| ^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:18:10
|
LL | -5.0 => {},
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:22:9
|
LL | 1.0 .. 33.0 => {},
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:22:16
|
LL | 1.0 .. 33.0 => {},
| ^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:30:9
|
LL | 39.0 ..= 70.0 => {},
| ^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:30:18
|
LL | 39.0 ..= 70.0 => {},
| ^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:43:10
|
LL | (3.14, 1) => {},
| ^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: floating-point types cannot be used in patterns
--> $DIR/issue-41255.rs:52:18
|
LL | Foo { x: 2.0 } => {},
| ^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620>
error: aborting due to 18 previous errors

View File

@ -8,6 +8,7 @@ fn main() {
match 1 {
NUM => unimplemented!(),
//~^ ERROR could not evaluate constant pattern
//~| ERROR could not evaluate constant pattern
_ => unimplemented!(),
}
}

Some files were not shown because too many files have changed in this diff Show More