Rollup merge of #120763 - Nadrieril:suggest-patterns, r=Mark-Simulacrum
Suggest pattern tests when modifying exhaustiveness The vast majority of exhaustiveness tests are in `tests/ui/pattern`, this is what I've been using for years. This PR is me telling `x suggest` about that. cc `@Ezrashaw`
This commit is contained in:
commit
040ecbfb9f
@ -4,20 +4,29 @@
|
|||||||
|
|
||||||
type DynamicSuggestion = fn(&Path) -> Vec<Suggestion>;
|
type DynamicSuggestion = fn(&Path) -> Vec<Suggestion>;
|
||||||
|
|
||||||
pub(crate) const DYNAMIC_SUGGESTIONS: &[DynamicSuggestion] = &[|path: &Path| -> Vec<Suggestion> {
|
pub(crate) const DYNAMIC_SUGGESTIONS: &[DynamicSuggestion] = &[
|
||||||
if path.starts_with("compiler/") || path.starts_with("library/") {
|
|path: &Path| -> Vec<Suggestion> {
|
||||||
let path = path.components().take(2).collect::<Vec<_>>();
|
if path.starts_with("compiler/") || path.starts_with("library/") {
|
||||||
|
let path = path.components().take(2).collect::<Vec<_>>();
|
||||||
|
|
||||||
vec![Suggestion::with_single_path(
|
vec![Suggestion::with_single_path(
|
||||||
"test",
|
"test",
|
||||||
None,
|
None,
|
||||||
&format!(
|
&format!(
|
||||||
"{}/{}",
|
"{}/{}",
|
||||||
path[0].as_os_str().to_str().unwrap(),
|
path[0].as_os_str().to_str().unwrap(),
|
||||||
path[1].as_os_str().to_str().unwrap()
|
path[1].as_os_str().to_str().unwrap()
|
||||||
),
|
),
|
||||||
)]
|
)]
|
||||||
} else {
|
} else {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
}];
|
},
|
||||||
|
|path: &Path| -> Vec<Suggestion> {
|
||||||
|
if path.starts_with("compiler/rustc_pattern_analysis") {
|
||||||
|
vec![Suggestion::new("test", None, &["tests/ui", "--test-args", "pattern"])]
|
||||||
|
} else {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user