Skip to content

Commit

Permalink
Fix new tests updates
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 15, 2025
1 parent 8a2dae6 commit 1f94d55
Show file tree
Hide file tree
Showing 1,025 changed files with 5,989 additions and 7,822 deletions.
2 changes: 0 additions & 2 deletions tests/ui/as_pointer_underscore.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ struct S;
fn f(s: &S) -> usize {
&s as *const &S as usize
//~^ as_pointer_underscore

}

fn g(s: &mut S) -> usize {
s as *mut S as usize
//~^ as_pointer_underscore

}
2 changes: 0 additions & 2 deletions tests/ui/as_pointer_underscore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ struct S;
fn f(s: &S) -> usize {
&s as *const _ as usize
//~^ as_pointer_underscore

}

fn g(s: &mut S) -> usize {
s as *mut _ as usize
//~^ as_pointer_underscore

}
2 changes: 1 addition & 1 deletion tests/ui/as_pointer_underscore.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | &s as *const _ as usize
= help: to override `-D warnings` add `#[allow(clippy::as_pointer_underscore)]`

error: using inferred pointer cast
--> tests/ui/as_pointer_underscore.rs:14:10
--> tests/ui/as_pointer_underscore.rs:13:10
|
LL | s as *mut _ as usize
| ^^^^^^ help: use explicit type: `*mut S`
Expand Down
1 change: 0 additions & 1 deletion tests/ui/as_ptr_cast_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fn main() {
let _ = string.as_ptr() as *mut u8;
//~^ as_ptr_cast_mut


let _: *mut i8 = string.as_ptr() as *mut _;
//~^ as_ptr_cast_mut

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/as_ptr_cast_mut.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LL | let _ = string.as_ptr() as *mut u8;
= help: to override `-D warnings` add `#[allow(clippy::as_ptr_cast_mut)]`

error: casting the result of `as_ptr` to *mut i8
--> tests/ui/as_ptr_cast_mut.rs:26:22
--> tests/ui/as_ptr_cast_mut.rs:25:22
|
LL | let _: *mut i8 = string.as_ptr() as *mut _;
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `string.as_mut_ptr()`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/asm_syntax_x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ mod warn_att {

asm!("", options(nostack, att_syntax));
//~^ inline_asm_x86_att_syntax

}

global_asm!("");
global_asm!("", options());
global_asm!("", options(att_syntax));
//~^ inline_asm_x86_att_syntax

}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/asm_syntax_x86.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ LL | asm!("", options(nostack, att_syntax));
= help: use Intel x86 assembly syntax

error: AT&T x86 assembly syntax used
--> tests/ui/asm_syntax_x86.rs:48:5
--> tests/ui/asm_syntax_x86.rs:47:5
|
LL | global_asm!("", options(att_syntax));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 0 additions & 6 deletions tests/ui/assertions_on_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@ fn main() {
assert!(false, "false message");
//~^ assertions_on_constants


let msg = "panic message";
assert!(false, "{}", msg.to_uppercase());
//~^ assertions_on_constants


const B: bool = true;
assert!(B);
//~^ assertions_on_constants


const C: bool = false;
assert!(C);
//~^ assertions_on_constants

assert!(C, "C message");
//~^ assertions_on_constants


debug_assert!(true);
//~^ assertions_on_constants

Expand All @@ -58,11 +54,9 @@ fn main() {
const _: () = assert!(true);
//~^ assertions_on_constants


assert!(8 == (7 + 1));
//~^ assertions_on_constants


// Don't lint if the value is dependent on a defined constant:
const N: usize = 1024;
const _: () = assert!(N.is_power_of_two());
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/assertions_on_constants.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -33,63 +33,63 @@ LL | assert!(false, "false message");
= help: use `panic!(..)` or `unreachable!(..)`

error: `assert!(false, ..)` should probably be replaced
--> tests/ui/assertions_on_constants.rs:24:5
--> tests/ui/assertions_on_constants.rs:23:5
|
LL | assert!(false, "{}", msg.to_uppercase());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use `panic!(..)` or `unreachable!(..)`

error: `assert!(true)` will be optimized out by the compiler
--> tests/ui/assertions_on_constants.rs:29:5
--> tests/ui/assertions_on_constants.rs:27:5
|
LL | assert!(B);
| ^^^^^^^^^^
|
= help: remove it

error: `assert!(false)` should probably be replaced
--> tests/ui/assertions_on_constants.rs:34:5
--> tests/ui/assertions_on_constants.rs:31:5
|
LL | assert!(C);
| ^^^^^^^^^^
|
= help: use `panic!()` or `unreachable!()`

error: `assert!(false, ..)` should probably be replaced
--> tests/ui/assertions_on_constants.rs:37:5
--> tests/ui/assertions_on_constants.rs:34:5
|
LL | assert!(C, "C message");
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= help: use `panic!(..)` or `unreachable!(..)`

error: `debug_assert!(true)` will be optimized out by the compiler
--> tests/ui/assertions_on_constants.rs:41:5
--> tests/ui/assertions_on_constants.rs:37:5
|
LL | debug_assert!(true);
| ^^^^^^^^^^^^^^^^^^^
|
= help: remove it

error: `assert!(true)` will be optimized out by the compiler
--> tests/ui/assertions_on_constants.rs:58:19
--> tests/ui/assertions_on_constants.rs:54:19
|
LL | const _: () = assert!(true);
| ^^^^^^^^^^^^^
|
= help: remove it

error: `assert!(true)` will be optimized out by the compiler
--> tests/ui/assertions_on_constants.rs:62:5
--> tests/ui/assertions_on_constants.rs:57:5
|
LL | assert!(8 == (7 + 1));
| ^^^^^^^^^^^^^^^^^^^^^
|
= help: remove it

error: `assert!(true)` will be optimized out by the compiler
--> tests/ui/assertions_on_constants.rs:72:5
--> tests/ui/assertions_on_constants.rs:66:5
|
LL | assert!(true);
| ^^^^^^^^^^^^^
Expand Down
3 changes: 0 additions & 3 deletions tests/ui/assign_ops2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ fn main() {
a += a + 1;
//~^ misrefactored_assign_op


a += 1 + a;
//~^ misrefactored_assign_op

Expand Down Expand Up @@ -72,8 +71,6 @@ fn cow_add_assign() {
buf = buf + cows.clone();
//~^ assign_op_pattern



// this should not as cow<str> Add is not commutative
buf = cows + buf;
println!("{}", buf);
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/assign_ops2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ LL | a = a + a + 1;
| ~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:12:5
--> tests/ui/assign_ops2.rs:11:5
|
LL | a += 1 + a;
| ^^^^^^^^^^
Expand All @@ -31,7 +31,7 @@ LL | a = a + 1 + a;
| ~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:15:5
--> tests/ui/assign_ops2.rs:14:5
|
LL | a -= a - 1;
| ^^^^^^^^^^
Expand All @@ -46,7 +46,7 @@ LL | a = a - (a - 1);
| ~~~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:18:5
--> tests/ui/assign_ops2.rs:17:5
|
LL | a *= a * 99;
| ^^^^^^^^^^^
Expand All @@ -61,7 +61,7 @@ LL | a = a * a * 99;
| ~~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:21:5
--> tests/ui/assign_ops2.rs:20:5
|
LL | a *= 42 * a;
| ^^^^^^^^^^^
Expand All @@ -76,7 +76,7 @@ LL | a = a * 42 * a;
| ~~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:24:5
--> tests/ui/assign_ops2.rs:23:5
|
LL | a /= a / 2;
| ^^^^^^^^^^
Expand All @@ -91,7 +91,7 @@ LL | a = a / (a / 2);
| ~~~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:27:5
--> tests/ui/assign_ops2.rs:26:5
|
LL | a %= a % 5;
| ^^^^^^^^^^
Expand All @@ -106,7 +106,7 @@ LL | a = a % (a % 5);
| ~~~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:30:5
--> tests/ui/assign_ops2.rs:29:5
|
LL | a &= a & 1;
| ^^^^^^^^^^
Expand All @@ -121,7 +121,7 @@ LL | a = a & a & 1;
| ~~~~~~~~~~~~~

error: variable appears on both sides of an assignment operation
--> tests/ui/assign_ops2.rs:33:5
--> tests/ui/assign_ops2.rs:32:5
|
LL | a *= a * a;
| ^^^^^^^^^^
Expand All @@ -136,7 +136,7 @@ LL | a = a * a * a;
| ~~~~~~~~~~~~~

error: manual implementation of an assign operation
--> tests/ui/assign_ops2.rs:72:5
--> tests/ui/assign_ops2.rs:71:5
|
LL | buf = buf + cows.clone();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buf += cows.clone()`
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#[inline(always)]
//~^ inline_always


fn test_attr_lint() {
assert!(true)
}
Expand All @@ -28,7 +27,6 @@ fn empty_and_false_positive_stmt() {
#[deprecated(since = "forever")]
//~^ deprecated_semver


pub const SOME_CONST: u8 = 42;

#[deprecated(since = "1")]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/attrs.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: the since field must contain a semver-compliant version
--> tests/ui/attrs.rs:28:14
--> tests/ui/attrs.rs:27:14
|
LL | #[deprecated(since = "forever")]
| ^^^^^^^^^^^^^^^^^
Expand All @@ -8,7 +8,7 @@ LL | #[deprecated(since = "forever")]
= help: to override `-D warnings` add `#[allow(clippy::deprecated_semver)]`

error: the since field must contain a semver-compliant version
--> tests/ui/attrs.rs:34:14
--> tests/ui/attrs.rs:32:14
|
LL | #[deprecated(since = "1")]
| ^^^^^^^^^^^
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/await_holding_refcell_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ async fn also_bad(x: &RefCell<u32>) -> u32 {
let b = x.borrow_mut();
//~^ await_holding_refcell_ref


let second = baz().await;

let third = baz().await;
Expand All @@ -50,7 +49,6 @@ async fn less_bad(x: &RefCell<u32>) -> u32 {
let b = x.borrow_mut();
//~^ await_holding_refcell_ref


let second = baz().await;

drop(b);
Expand Down
14 changes: 7 additions & 7 deletions tests/ui/await_holding_refcell_ref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LL | let b = x.borrow_mut();
|
= help: ensure the reference is dropped before calling `await`
note: these are all the await points this reference is held through
--> tests/ui/await_holding_refcell_ref.rs:40:24
--> tests/ui/await_holding_refcell_ref.rs:39:24
|
LL | let second = baz().await;
| ^^^^^
Expand All @@ -43,40 +43,40 @@ LL | let third = baz().await;
| ^^^^^

error: this `RefCell` reference is held across an await point
--> tests/ui/await_holding_refcell_ref.rs:50:9
--> tests/ui/await_holding_refcell_ref.rs:49:9
|
LL | let b = x.borrow_mut();
| ^
|
= help: ensure the reference is dropped before calling `await`
note: these are all the await points this reference is held through
--> tests/ui/await_holding_refcell_ref.rs:54:24
--> tests/ui/await_holding_refcell_ref.rs:52:24
|
LL | let second = baz().await;
| ^^^^^

error: this `RefCell` reference is held across an await point
--> tests/ui/await_holding_refcell_ref.rs:67:13
--> tests/ui/await_holding_refcell_ref.rs:65:13
|
LL | let b = x.borrow_mut();
| ^
|
= help: ensure the reference is dropped before calling `await`
note: these are all the await points this reference is held through
--> tests/ui/await_holding_refcell_ref.rs:70:15
--> tests/ui/await_holding_refcell_ref.rs:68:15
|
LL | baz().await
| ^^^^^

error: this `RefCell` reference is held across an await point
--> tests/ui/await_holding_refcell_ref.rs:81:13
--> tests/ui/await_holding_refcell_ref.rs:79:13
|
LL | let b = x.borrow_mut();
| ^
|
= help: ensure the reference is dropped before calling `await`
note: these are all the await points this reference is held through
--> tests/ui/await_holding_refcell_ref.rs:84:15
--> tests/ui/await_holding_refcell_ref.rs:82:15
|
LL | baz().await
| ^^^^^
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/bind_instead_of_map_multipart.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub fn main() {

fn hard_example() {
Some("42").map(|s| {
//~^ bind_instead_of_map
//~^ bind_instead_of_map
if {
if s == "43" {
return 43;
Expand Down
Loading

0 comments on commit 1f94d55

Please sign in to comment.