Skip to content

Commit 61ff271

Browse files
committed
Adjust tests for new drop and forget lints
1 parent 3f81b6b commit 61ff271

File tree

61 files changed

+145
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+145
-64
lines changed

src/tools/miri/tests/fail/stacked_borrows/illegal_write2.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(drop_ref)]
2+
13
fn main() {
24
let target = &mut 42;
35
let target2 = target as *mut _;

src/tools/miri/tests/fail/uninit_buffer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@error-pattern: memory is uninitialized at [0x4..0x10]
22

3+
#![allow(drop_copy)]
4+
35
use std::alloc::{alloc, dealloc, Layout};
46
use std::slice::from_raw_parts;
57

src/tools/miri/tests/fail/uninit_buffer_with_provenance.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
//@normalize-stderr-test: "a[0-9]+" -> "ALLOC"
33
#![feature(strict_provenance)]
44

5+
#![allow(drop_copy)]
6+
57
// Test printing allocations that contain single-byte provenance.
68

79
use std::alloc::{alloc, dealloc, Layout};

src/tools/miri/tests/pass/stacked-borrows/zst-field-retagging-terminates.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//@compile-flags: -Zmiri-retag-fields
22
// Checks that the test does not run forever (which relies on a fast path).
3+
4+
#![allow(drop_copy)]
5+
36
fn main() {
47
let array = [(); usize::MAX];
58
drop(array); // Pass the array to a function, retagging its fields

tests/ui/associated-inherent-types/inference.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#![feature(inherent_associated_types)]
55
#![allow(incomplete_features)]
6+
#![allow(drop_copy)]
67

78
use std::convert::identity;
89

tests/ui/async-await/multiple-lifetimes/partial-relation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
async fn lotsa_lifetimes<'a, 'b, 'c>(a: &'a u32, b: &'b u32, c: &'c u32) -> (&'a u32, &'b u32)
55
where 'b: 'a
66
{
7-
drop((a, c));
7+
let _ = (a, c);
88
(b, b)
99
}
1010

tests/ui/borrowck/borrowck-closures-slice-patterns-ok.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Check that closure captures for slice patterns are inferred correctly
22

33
#![allow(unused_variables)]
4+
#![allow(drop_ref)]
45

56
// run-pass
67

tests/ui/borrowck/borrowck-field-sensitivity-rpass.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
#![allow(unused_mut)]
33
#![allow(unused_variables)]
4+
#![allow(drop_copy)]
45
// pretty-expanded FIXME #23616
56

67
struct A { a: isize, b: Box<isize> }

tests/ui/borrowck/borrowck-use-mut-borrow-rpass.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// run-pass
22
// pretty-expanded FIXME #23616
33

4+
#![allow(drop_copy)]
5+
46
struct A { a: isize, b: Box<isize> }
57

68
fn field_copy_after_field_borrow() {

tests/ui/closures/2229_closure_analysis/migrations/issue-78720.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22

33
#![warn(rust_2021_incompatible_closure_captures)]
4+
#![allow(drop_ref, drop_copy)]
45

56
fn main() {
67
if let a = "" {

0 commit comments

Comments
 (0)