summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/from_str_radix_10.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /src/tools/clippy/tests/ui/from_str_radix_10.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/from_str_radix_10.rs')
-rw-r--r--src/tools/clippy/tests/ui/from_str_radix_10.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/from_str_radix_10.rs b/src/tools/clippy/tests/ui/from_str_radix_10.rs
index 2f2ea0484..e9d022157 100644
--- a/src/tools/clippy/tests/ui/from_str_radix_10.rs
+++ b/src/tools/clippy/tests/ui/from_str_radix_10.rs
@@ -26,17 +26,26 @@ impl std::ops::Add<Test> for Test {
fn main() -> Result<(), Box<dyn std::error::Error>> {
// all of these should trigger the lint
u32::from_str_radix("30", 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
+ //~| NOTE: `-D clippy::from-str-radix-10` implied by `-D warnings`
i64::from_str_radix("24", 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
isize::from_str_radix("100", 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
u8::from_str_radix("7", 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
u16::from_str_radix(&("10".to_owned() + "5"), 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
i128::from_str_radix(Test + Test, 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
let string = "300";
i32::from_str_radix(string, 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
let stringier = "400".to_string();
i32::from_str_radix(&stringier, 10)?;
+ //~^ ERROR: this call to `from_str_radix` can be replaced with a call to `str::parse`
// none of these should trigger the lint
u16::from_str_radix("20", 3)?;