Skip to content

Commit

Permalink
bless
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed Jun 8, 2024
1 parent 8960079 commit 6a4236d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/ui/unnecessary_operation.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn main() {
break 'label
};
let () = const {
[42, 55][get_usize()];
assert!([42, 55].len() > get_usize());
};
}

Expand Down
8 changes: 7 additions & 1 deletion tests/ui/unnecessary_operation.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,17 @@ LL | | s: String::from("blah"),
LL | | };
| |______^ help: statement can be reduced to: `String::from("blah");`

error: unnecessary operation
--> tests/ui/unnecessary_operation.rs:121:9
|
LL | [42, 55][get_usize()];
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`

error: unnecessary operation
--> tests/ui/unnecessary_operation.rs:130:5
|
LL | [42, 55][get_usize()];
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`

error: aborting due to 20 previous errors
error: aborting due to 21 previous errors

0 comments on commit 6a4236d

Please sign in to comment.