Skip to content

Commit 2632230

Browse files
committed
ide-diagnostics:
drop redundant lint-attribute tests for unused_must_use Address ChayimFriedman2 review: the four allow_*/deny_* lock-in tests added earlier in this PR re-test generic #[allow]/#[deny] lint-attribute resolution, which is already covered for lint attributes in general and need not be repeated per lint. Remove them and keep the container-expression behavior tests that are the subject of this PR. Signed-off-by: Onyeka Obi <softwareengineerasaservant@isurvivable.cv>
1 parent 6a6de48 commit 2632230

1 file changed

Lines changed: 0 additions & 57 deletions

File tree

crates/ide-diagnostics/src/handlers/unused_must_use.rs

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -261,63 +261,6 @@ fn main() {
261261
//^^^^^^^^^^ warn: unused return value that must be used
262262
};
263263
}
264-
"#,
265-
);
266-
}
267-
268-
#[test]
269-
fn allow_attribute_on_fn_silences_lint() {
270-
check_diagnostics(
271-
r#"
272-
#[must_use]
273-
fn produces() -> i32 { 0 }
274-
#[allow(unused_must_use)]
275-
fn main() {
276-
produces();
277-
}
278-
"#,
279-
);
280-
}
281-
282-
#[test]
283-
fn allow_attribute_on_stmt_silences_lint() {
284-
check_diagnostics(
285-
r#"
286-
#[must_use]
287-
fn produces() -> i32 { 0 }
288-
fn main() {
289-
#[allow(unused_must_use)]
290-
produces();
291-
}
292-
"#,
293-
);
294-
}
295-
296-
#[test]
297-
fn allow_unused_group_silences_lint() {
298-
check_diagnostics(
299-
r#"
300-
#[must_use]
301-
fn produces() -> i32 { 0 }
302-
#[allow(unused)]
303-
fn main() {
304-
produces();
305-
}
306-
"#,
307-
);
308-
}
309-
310-
#[test]
311-
fn deny_attribute_escalates_lint() {
312-
check_diagnostics(
313-
r#"
314-
#[must_use]
315-
fn produces() -> i32 { 0 }
316-
#[deny(unused_must_use)]
317-
fn main() {
318-
produces();
319-
//^^^^^^^^^^ error: unused return value that must be used
320-
}
321264
"#,
322265
);
323266
}

0 commit comments

Comments
 (0)