Merge pull request #19462 from Veykril/push-ypvprvvwkyll

refactor: Lower type-refs before type inference
This commit is contained in:
Lukas Wirth 2025-04-09 08:54:28 +00:00 committed by GitHub
commit dc363f7f77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
127 changed files with 6733 additions and 7993 deletions

View file

@ -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(),
)