Skip to content

Rustup https://github.com/rust-lang/rust/pull/67359 #5146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion tests/ui/assertions_on_constants.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ LL | assert!(true);
|
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
= help: remove it
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(false)` should probably be replaced
--> $DIR/assertions_on_constants.rs:10:5
Expand All @@ -14,6 +15,7 @@ LL | assert!(false);
| ^^^^^^^^^^^^^^^
|
= help: use `panic!()` or `unreachable!()`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(true)` will be optimized out by the compiler
--> $DIR/assertions_on_constants.rs:11:5
Expand All @@ -22,6 +24,7 @@ LL | assert!(true, "true message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: remove it
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(false, "false message")` should probably be replaced
--> $DIR/assertions_on_constants.rs:12:5
Expand All @@ -30,6 +33,7 @@ LL | assert!(false, "false message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use `panic!("false message")` or `unreachable!("false message")`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(false, msg.to_uppercase())` should probably be replaced
--> $DIR/assertions_on_constants.rs:15:5
Expand All @@ -38,6 +42,7 @@ LL | assert!(false, msg.to_uppercase());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use `panic!(msg.to_uppercase())` or `unreachable!(msg.to_uppercase())`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(true)` will be optimized out by the compiler
--> $DIR/assertions_on_constants.rs:18:5
Expand All @@ -46,6 +51,7 @@ LL | assert!(B);
| ^^^^^^^^^^^
|
= help: remove it
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(false)` should probably be replaced
--> $DIR/assertions_on_constants.rs:21:5
Expand All @@ -54,6 +60,7 @@ LL | assert!(C);
| ^^^^^^^^^^^
|
= help: use `panic!()` or `unreachable!()`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert!(false, "C message")` should probably be replaced
--> $DIR/assertions_on_constants.rs:22:5
Expand All @@ -62,6 +69,7 @@ LL | assert!(C, "C message");
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use `panic!("C message")` or `unreachable!("C message")`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `debug_assert!(true)` will be optimized out by the compiler
--> $DIR/assertions_on_constants.rs:24:5
Expand All @@ -70,7 +78,7 @@ LL | debug_assert!(true);
| ^^^^^^^^^^^^^^^^^^^^
|
= help: remove it
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 9 previous errors

2 changes: 2 additions & 0 deletions tests/ui/checked_unwrap/simple_conditionals.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ LL | $a.unwrap(); // unnecessary
...
LL | m!(x);
| ------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: You checked before that `unwrap()` cannot fail. Instead of checking and unwrapping, it's better to use `if let` or `match`.
--> $DIR/simple_conditionals.rs:27:9
Expand Down
1 change: 1 addition & 0 deletions tests/ui/crashes/ice-2636.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ LL | test_hash!(&a, A => 0, B => 1, C => 2);
| --------------------------------------- in this macro invocation
|
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

4 changes: 4 additions & 0 deletions tests/ui/declare_interior_mutable_const.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ LL | const $name: $ty = $e;
...
LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
| ------------------------------------------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:40:5
Expand Down Expand Up @@ -71,6 +73,8 @@ LL | const $name: $ty = $e;
...
LL | declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior mutable
| ----------------------------------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: a `const` item should never be interior mutable
--> $DIR/declare_interior_mutable_const.rs:60:5
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/default_lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ note: the lint level is defined here
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::default_lint)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

4 changes: 4 additions & 0 deletions tests/ui/derive_hash_xor_eq.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ LL | | true
LL | | }
LL | | }
| |_^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: you are deriving `Hash` but have implemented `PartialEq` explicitly
--> $DIR/derive_hash_xor_eq.rs:19:10
Expand All @@ -30,6 +31,7 @@ LL | | true
LL | | }
LL | | }
| |_^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: you are implementing `Hash` explicitly but have derived `PartialEq`
--> $DIR/derive_hash_xor_eq.rs:31:1
Expand All @@ -44,6 +46,7 @@ note: `PartialEq` implemented here
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: you are implementing `Hash` explicitly but have derived `PartialEq`
--> $DIR/derive_hash_xor_eq.rs:49:5
Expand All @@ -58,6 +61,7 @@ note: `PartialEq` implemented here
|
LL | #[derive(PartialEq)]
| ^^^^^^^^^
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 4 previous errors

2 changes: 2 additions & 0 deletions tests/ui/doc_unsafe.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ LL | | }
...
LL | very_unsafe!();
| --------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 5 previous errors

6 changes: 3 additions & 3 deletions tests/ui/fallible_impl_from.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ note: potential failure(s)
|
LL | panic!();
| ^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:35:1
Expand All @@ -65,7 +65,7 @@ LL | } else if s.parse::<u32>().unwrap() != 42 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
LL | panic!("{:?}", s);
| ^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:53:1
Expand All @@ -87,7 +87,7 @@ LL | if s.parse::<u32>().ok().unwrap() != 42 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | panic!("{:?}", s);
| ^^^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 4 previous errors

3 changes: 3 additions & 0 deletions tests/ui/implicit_hasher.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
LL | gen!(impl);
| ----------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider adding a type parameter
|
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
Expand All @@ -123,6 +124,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
LL | gen!(fn bar);
| ------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider adding a type parameter
|
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
Expand All @@ -137,6 +139,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
LL | gen!(fn bar);
| ------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider adding a type parameter
|
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/lint_without_lint_pass.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ note: the lint level is defined here
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::lint_without_lint_pass)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

4 changes: 2 additions & 2 deletions tests/ui/match_same_arms2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ help: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
|
LL | (Ok(x), Some(_)) => println!("ok {}", x),
| ^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: this `match` has identical arm bodies
--> $DIR/match_same_arms2.rs:117:18
Expand All @@ -139,7 +139,7 @@ help: consider refactoring into `Ok(3) | Ok(_)`
|
LL | Ok(3) => println!("ok"),
| ^^^^^
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 7 previous errors

2 changes: 2 additions & 0 deletions tests/ui/mem_discriminant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ LL | mem_discriminant_but_in_a_macro!(&rro);
| | |
| | help: try dereferencing: `*rro`
| in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: calling `mem::discriminant` on non-enum type `&&&&&std::option::Option<i32>`
--> $DIR/mem_discriminant.rs:34:5
Expand Down
1 change: 1 addition & 0 deletions tests/ui/mem_replace_macro.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ LL | take!(s);
| --------- in this macro invocation
|
= note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

2 changes: 2 additions & 0 deletions tests/ui/mut_mut.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ LL | &mut $p
...
LL | let mut z = mut_ptr!(&mut 3u32);
| ------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: this expression mutably borrows a mutable reference. Consider reborrowing
--> $DIR/mut_mut.rs:22:21
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/unit_cmp.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LL | | }
LL | | );
| |______^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `debug_assert_eq` of unit values detected. This will always succeed
--> $DIR/unit_cmp.rs:32:5
Expand All @@ -48,7 +48,7 @@ LL | | }
LL | | );
| |______^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `assert_ne` of unit values detected. This will always fail
--> $DIR/unit_cmp.rs:41:5
Expand All @@ -62,7 +62,7 @@ LL | | }
LL | | );
| |______^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: `debug_assert_ne` of unit values detected. This will always fail
--> $DIR/unit_cmp.rs:49:5
Expand All @@ -76,7 +76,7 @@ LL | | }
LL | | );
| |______^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 6 previous errors

2 changes: 2 additions & 0 deletions tests/ui/unseparated_prefix_literals.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ LL | 42usize
...
LL | let _ = lit_from_macro!();
| ----------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: integer type suffix should be separated by an underscore
--> $DIR/unseparated_prefix_literals.rs:40:16
Expand Down
5 changes: 4 additions & 1 deletion tests/ui/update-all-references.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ if [[ "$1" == "--help" || "$1" == "-h" ]]; then
echo "usage: $0"
fi

BUILD_DIR=$PWD/target/debug/test_build_base
CARGO_TARGET_DIR=${CARGO_TARGET_DIR:-$PWD/target}
PROFILE=${PROFILE:-debug}
BUILD_DIR=${CARGO_TARGET_DIR}/${PROFILE}/test_build_base

MY_DIR=$(dirname "$0")
cd "$MY_DIR" || exit
find . -name '*.rs' -exec ./update-references.sh "$BUILD_DIR" {} +
4 changes: 4 additions & 0 deletions tests/ui/use_self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ LL | fn new() -> Foo {
...
LL | use_self_expand!(); // Should lint in local macros
| ------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: unnecessary structure name repetition
--> $DIR/use_self.rs:113:17
Expand All @@ -65,6 +67,8 @@ LL | Foo {}
...
LL | use_self_expand!(); // Should lint in local macros
| ------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: unnecessary structure name repetition
--> $DIR/use_self.rs:148:21
Expand Down