mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-26 22:03:11 +00:00
Merge pull request #19462 from Veykril/push-ypvprvvwkyll
refactor: Lower type-refs before type inference
This commit is contained in:
commit
dc363f7f77
127 changed files with 6733 additions and 7993 deletions
|
|
@ -4,6 +4,7 @@ use std::{
|
|||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use itertools::Itertools;
|
||||
use xshell::Shell;
|
||||
|
||||
use xshell::cmd;
|
||||
|
|
@ -189,9 +190,17 @@ fn check_test_attrs(path: &Path, text: &str) {
|
|||
// Generated code from lints contains doc tests in string literals.
|
||||
"ide-db/src/generated/lints.rs",
|
||||
];
|
||||
if text.contains("#[should_panic") && !need_panic.iter().any(|p| path.ends_with(p)) {
|
||||
if need_panic.iter().any(|p| path.ends_with(p)) {
|
||||
return;
|
||||
}
|
||||
if let Some((line, _)) = text
|
||||
.lines()
|
||||
.tuple_windows()
|
||||
.enumerate()
|
||||
.find(|(_, (a, b))| b.contains("#[should_panic") && !a.contains("FIXME"))
|
||||
{
|
||||
panic!(
|
||||
"\ndon't add `#[should_panic]` tests, see:\n\n {}\n\n {}\n",
|
||||
"\ndon't add `#[should_panic]` tests, see:\n\n {}\n\n {}:{line}\n",
|
||||
panic_rule,
|
||||
path.display(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue