-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #99119 - TaKO8Ki:remove-string-matching-about-methods…
…, r=cjgillot Refactor: remove a string matching about methods This patch remove a string matching about methods and adds some rustfix tests.
- Loading branch information
Showing
9 changed files
with
130 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// run-rustfix | ||
#![allow(dead_code)] | ||
|
||
struct Bravery { | ||
guts: String, | ||
brains: String, | ||
} | ||
|
||
fn main() { | ||
let guts = "mettle"; | ||
let _ = Bravery { | ||
guts: guts.to_string(), //~ ERROR mismatched types | ||
brains: guts.to_string(), //~ ERROR mismatched types | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// run-rustfix | ||
#![allow(dead_code)] | ||
|
||
struct Bravery { | ||
guts: String, | ||
brains: String, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// run-rustfix | ||
#![allow(unused_variables)] | ||
|
||
fn main() { | ||
let items = vec![1, 2, 3]; | ||
let ref_items: &[i32] = &items; | ||
let items_clone: Vec<i32> = ref_items.to_vec(); | ||
//~^ ERROR mismatched types | ||
|
||
// in that case no suggestion will be triggered | ||
let items_clone_2: Vec<i32> = items.clone(); | ||
|
||
let s = "hi"; | ||
let string: String = s.to_string(); | ||
//~^ ERROR mismatched types | ||
|
||
// in that case no suggestion will be triggered | ||
let s2 = "hi"; | ||
let string_2: String = s2.to_string(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
// run-rustfix | ||
#![allow(unused_variables)] | ||
|
||
fn main() { | ||
let items = vec![1, 2, 3]; | ||
let ref_items: &[i32] = &items; | ||
let items_clone: Vec<i32> = ref_items.clone(); | ||
//~^ ERROR mismatched types | ||
let items = vec![1, 2, 3]; | ||
let ref_items: &[i32] = &items; | ||
let items_clone: Vec<i32> = ref_items.clone(); | ||
//~^ ERROR mismatched types | ||
|
||
// in that case no suggestion will be triggered | ||
let items_clone_2:Vec<i32> = items.clone(); | ||
// in that case no suggestion will be triggered | ||
let items_clone_2: Vec<i32> = items.clone(); | ||
|
||
let s = "hi"; | ||
let string: String = s.clone(); | ||
//~^ ERROR mismatched types | ||
let s = "hi"; | ||
let string: String = s.clone(); | ||
//~^ ERROR mismatched types | ||
|
||
// in that case no suggestion will be triggered | ||
let s2 = "hi"; | ||
let string_2: String = s2.to_string(); | ||
// in that case no suggestion will be triggered | ||
let s2 = "hi"; | ||
let string_2: String = s2.to_string(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters