mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Add moved-out-of-ref
diagnostic
This commit is contained in:
parent
09d1265e1e
commit
b55fbd3ad7
11 changed files with 352 additions and 10 deletions
|
@ -121,6 +121,15 @@ pub(crate) fn check_diagnostics_with_config(config: DiagnosticsConfig, ra_fixtur
|
|||
})
|
||||
.collect::<Vec<_>>();
|
||||
actual.sort_by_key(|(range, _)| range.start());
|
||||
if expected.is_empty() {
|
||||
// makes minicore smoke test debugable
|
||||
for (e, _) in &actual {
|
||||
eprintln!(
|
||||
"Code in range {e:?} = {}",
|
||||
&db.file_text(file_id)[usize::from(e.start())..usize::from(e.end())]
|
||||
)
|
||||
}
|
||||
}
|
||||
assert_eq!(expected, actual);
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +165,11 @@ fn minicore_smoke_test() {
|
|||
|
||||
// Checks that there is no diagnostic in minicore for each flag.
|
||||
for flag in MiniCore::available_flags() {
|
||||
if flag == "clone" {
|
||||
// Clone without copy has `moved-out-of-ref`, so ignoring.
|
||||
// FIXME: Maybe we should merge copy and clone in a single flag?
|
||||
continue;
|
||||
}
|
||||
eprintln!("Checking minicore flag {flag}");
|
||||
check(MiniCore::from_flags([flag]));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue