lower `bstr` version requirement to `1.6.0`

This commit is contained in:
Oli Scherer 2024-02-27 13:34:01 +00:00
parent e33cba523a
commit 592fe89997
10 changed files with 27 additions and 22 deletions

View File

@ -30,7 +30,7 @@ color-print = "0.3.4"
anstream = "0.6.0" anstream = "0.6.0"
[dev-dependencies] [dev-dependencies]
ui_test = "0.22.1" ui_test = "0.22.2"
tester = "0.9" tester = "0.9"
regex = "1.5" regex = "1.5"
toml = "0.7.3" toml = "0.7.3"

View File

@ -4,6 +4,7 @@
macro_rules! define_other_core { macro_rules! define_other_core {
( ) => { ( ) => {
extern crate std as core; extern crate std as core;
//~^ ERROR: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
}; };
} }
@ -12,4 +13,3 @@ fn main() {
} }
define_other_core!(); define_other_core!();
//~^ ERROR: macro-expanded `extern crate` items cannot shadow names passed with `--extern`

View File

@ -14,9 +14,10 @@ const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::n
macro_rules! declare_const { macro_rules! declare_const {
($name:ident: $ty:ty = $e:expr) => { ($name:ident: $ty:ty = $e:expr) => {
const $name: $ty = $e; const $name: $ty = $e;
//~^ ERROR: interior mutable
}; };
} }
declare_const!(_ONCE: Once = Once::new()); //~ ERROR: interior mutable declare_const!(_ONCE: Once = Once::new());
// const ATOMIC_REF: &AtomicUsize = &AtomicUsize::new(7); // This will simply trigger E0492. // const ATOMIC_REF: &AtomicUsize = &AtomicUsize::new(7); // This will simply trigger E0492.
@ -49,7 +50,7 @@ mod issue_8493 {
}; };
} }
issue_8493!(); //~ ERROR: interior mutable issue_8493!();
} }
fn main() {} fn main() {}

View File

@ -37,7 +37,7 @@ LL | declare_const!(_ONCE: Once = Once::new());
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/others.rs:43:13 --> tests/ui/declare_interior_mutable_const/others.rs:44:13
| |
LL | const _BAZ: Cell<usize> = Cell::new(0); LL | const _BAZ: Cell<usize> = Cell::new(0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -7,6 +7,7 @@ use std::sync::atomic::AtomicUsize;
macro_rules! declare_const { macro_rules! declare_const {
($name:ident: $ty:ty = $e:expr) => { ($name:ident: $ty:ty = $e:expr) => {
const $name: $ty = $e; const $name: $ty = $e;
//~^ ERROR: interior mutable
}; };
} }
@ -15,7 +16,7 @@ trait ConcreteTypes {
const ATOMIC: AtomicUsize; //~ ERROR: interior mutable const ATOMIC: AtomicUsize; //~ ERROR: interior mutable
const INTEGER: u64; const INTEGER: u64;
const STRING: String; const STRING: String;
declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR: interior mutable declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC);
} }
impl ConcreteTypes for u64 { impl ConcreteTypes for u64 {

View File

@ -1,5 +1,5 @@
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:15:5 --> tests/ui/declare_interior_mutable_const/traits.rs:16:5
| |
LL | const ATOMIC: AtomicUsize; LL | const ATOMIC: AtomicUsize;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -19,55 +19,55 @@ LL | declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC);
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:43:5 --> tests/ui/declare_interior_mutable_const/traits.rs:44:5
| |
LL | const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11); LL | const TO_BE_CONCRETE: AtomicUsize = AtomicUsize::new(11);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:68:5 --> tests/ui/declare_interior_mutable_const/traits.rs:69:5
| |
LL | const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13); LL | const TO_BE_UNFROZEN: Self::ToBeUnfrozen = AtomicUsize::new(13);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:69:5 --> tests/ui/declare_interior_mutable_const/traits.rs:70:5
| |
LL | const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14)); LL | const WRAPPED_TO_BE_UNFROZEN: Wrapper<Self::ToBeUnfrozen> = Wrapper(AtomicUsize::new(14));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:88:5 --> tests/ui/declare_interior_mutable_const/traits.rs:89:5
| |
LL | const BOUNDED: T::ToBeBounded; LL | const BOUNDED: T::ToBeBounded;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:116:5 --> tests/ui/declare_interior_mutable_const/traits.rs:117:5
| |
LL | const SELF: Self = AtomicUsize::new(17); LL | const SELF: Self = AtomicUsize::new(17);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:117:5 --> tests/ui/declare_interior_mutable_const/traits.rs:118:5
| |
LL | const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21)); LL | const WRAPPED_SELF: Option<Self> = Some(AtomicUsize::new(21));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:125:5 --> tests/ui/declare_interior_mutable_const/traits.rs:126:5
| |
LL | const INDIRECT: Cell<*const T>; LL | const INDIRECT: Cell<*const T>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:141:5 --> tests/ui/declare_interior_mutable_const/traits.rs:142:5
| |
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(18); LL | const ATOMIC: AtomicUsize = AtomicUsize::new(18);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item should never be interior mutable error: a `const` item should never be interior mutable
--> tests/ui/declare_interior_mutable_const/traits.rs:147:5 --> tests/ui/declare_interior_mutable_const/traits.rs:148:5
| |
LL | const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19); LL | const BOUNDED_ASSOC_TYPE: T::ToBeBounded = AtomicUsize::new(19);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -224,6 +224,7 @@ mod macro_tests {
macro_rules! mk_struct { macro_rules! mk_struct {
() => { () => {
struct MacroStruct { struct MacroStruct {
//~^ ERROR: all fields have the same prefix: `some`
some_a: i32, some_a: i32,
some_b: i32, some_b: i32,
some_c: i32, some_c: i32,
@ -231,24 +232,24 @@ mod macro_tests {
}; };
} }
mk_struct!(); mk_struct!();
//~^ ERROR: all fields have the same prefix: `some`
macro_rules! mk_struct2 { macro_rules! mk_struct2 {
() => { () => {
struct Macrobaz { struct Macrobaz {
macrobaz_a: i32, macrobaz_a: i32,
//~^ ERROR: field name starts with the struct's name
some_b: i32, some_b: i32,
some_c: i32, some_c: i32,
} }
}; };
} }
mk_struct2!(); mk_struct2!();
//~^ ERROR: field name starts with the struct's name
macro_rules! mk_struct_with_names { macro_rules! mk_struct_with_names {
($struct_name:ident, $field:ident) => { ($struct_name:ident, $field:ident) => {
struct $struct_name { struct $struct_name {
$field: i32, $field: i32,
//~^ ERROR: field name starts with the struct's name
other_something: i32, other_something: i32,
other_field: i32, other_field: i32,
} }
@ -256,7 +257,6 @@ mod macro_tests {
} }
// expands to `struct Foo { foo: i32, ... }` // expands to `struct Foo { foo: i32, ... }`
mk_struct_with_names!(Foo, foo); mk_struct_with_names!(Foo, foo);
//~^ ERROR: field name starts with the struct's name
// expands to a struct with all fields starting with `other` but should not // expands to a struct with all fields starting with `other` but should not
// be linted because some fields come from the macro definition and the other from the input // be linted because some fields come from the macro definition and the other from the input
@ -289,6 +289,7 @@ mod macro_tests {
macro_rules! mk_struct_full_def { macro_rules! mk_struct_full_def {
($struct_name:ident, $field1:ident, $field2:ident, $field3:ident) => { ($struct_name:ident, $field1:ident, $field2:ident, $field3:ident) => {
struct $struct_name { struct $struct_name {
//~^ ERROR: all fields have the same prefix: `some`
$field1: i32, $field1: i32,
$field2: i32, $field2: i32,
$field3: i32, $field3: i32,
@ -296,7 +297,6 @@ mod macro_tests {
}; };
} }
mk_struct_full_def!(PrefixData, some_data, some_meta, some_other); mk_struct_full_def!(PrefixData, some_data, some_meta, some_other);
//~^ ERROR: all fields have the same prefix: `some`
} }
// should not lint on external code // should not lint on external code

View File

@ -211,6 +211,7 @@ error: all fields have the same prefix: `some`
--> tests/ui/struct_fields.rs:226:13 --> tests/ui/struct_fields.rs:226:13
| |
LL | / struct MacroStruct { LL | / struct MacroStruct {
LL | |
LL | | some_a: i32, LL | | some_a: i32,
LL | | some_b: i32, LL | | some_b: i32,
LL | | some_c: i32, LL | | some_c: i32,
@ -249,6 +250,7 @@ error: all fields have the same prefix: `some`
--> tests/ui/struct_fields.rs:291:13 --> tests/ui/struct_fields.rs:291:13
| |
LL | / struct $struct_name { LL | / struct $struct_name {
LL | |
LL | | $field1: i32, LL | | $field1: i32,
LL | | $field2: i32, LL | | $field2: i32,
LL | | $field3: i32, LL | | $field3: i32,

View File

@ -147,6 +147,7 @@ macro_rules! impl_partial_eq {
($ty:ident) => { ($ty:ident) => {
impl PartialEq for $ty { impl PartialEq for $ty {
fn eq(&self, other: &Self) -> bool { fn eq(&self, other: &Self) -> bool {
//~^ ERROR: function cannot return without recursing
self == other self == other
} }
} }
@ -156,7 +157,6 @@ macro_rules! impl_partial_eq {
struct S5; struct S5;
impl_partial_eq!(S5); impl_partial_eq!(S5);
//~^ ERROR: function cannot return without recursing
struct S6 { struct S6 {
field: String, field: String,

View File

@ -291,6 +291,7 @@ error: function cannot return without recursing
--> tests/ui/unconditional_recursion.rs:149:13 --> tests/ui/unconditional_recursion.rs:149:13
| |
LL | / fn eq(&self, other: &Self) -> bool { LL | / fn eq(&self, other: &Self) -> bool {
LL | |
LL | | self == other LL | | self == other
LL | | } LL | | }
| |_____________^ | |_____________^
@ -299,7 +300,7 @@ LL | impl_partial_eq!(S5);
| -------------------- in this macro invocation | -------------------- in this macro invocation
| |
note: recursive call site note: recursive call site
--> tests/ui/unconditional_recursion.rs:150:17 --> tests/ui/unconditional_recursion.rs:151:17
| |
LL | self == other LL | self == other
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^