Adjust tests for new drop and forget lints

This commit is contained in:
Urgau 2023-03-29 22:18:20 +02:00
parent 3f81b6b8a2
commit 61ff2718f7
61 changed files with 145 additions and 64 deletions

View File

@ -1,3 +1,5 @@
#![allow(drop_ref)]
fn main() {
let target = &mut 42;
let target2 = target as *mut _;

View File

@ -1,5 +1,7 @@
//@error-pattern: memory is uninitialized at [0x4..0x10]
#![allow(drop_copy)]
use std::alloc::{alloc, dealloc, Layout};
use std::slice::from_raw_parts;

View File

@ -2,6 +2,8 @@
//@normalize-stderr-test: "a[0-9]+" -> "ALLOC"
#![feature(strict_provenance)]
#![allow(drop_copy)]
// Test printing allocations that contain single-byte provenance.
use std::alloc::{alloc, dealloc, Layout};

View File

@ -1,5 +1,8 @@
//@compile-flags: -Zmiri-retag-fields
// Checks that the test does not run forever (which relies on a fast path).
#![allow(drop_copy)]
fn main() {
let array = [(); usize::MAX];
drop(array); // Pass the array to a function, retagging its fields

View File

@ -3,6 +3,7 @@
#![feature(inherent_associated_types)]
#![allow(incomplete_features)]
#![allow(drop_copy)]
use std::convert::identity;

View File

@ -4,7 +4,7 @@
async fn lotsa_lifetimes<'a, 'b, 'c>(a: &'a u32, b: &'b u32, c: &'c u32) -> (&'a u32, &'b u32)
where 'b: 'a
{
drop((a, c));
let _ = (a, c);
(b, b)
}

View File

@ -1,6 +1,7 @@
// Check that closure captures for slice patterns are inferred correctly
#![allow(unused_variables)]
#![allow(drop_ref)]
// run-pass

View File

@ -1,6 +1,7 @@
// run-pass
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(drop_copy)]
// pretty-expanded FIXME #23616
struct A { a: isize, b: Box<isize> }

View File

@ -1,6 +1,8 @@
// run-pass
// pretty-expanded FIXME #23616
#![allow(drop_copy)]
struct A { a: isize, b: Box<isize> }
fn field_copy_after_field_borrow() {

View File

@ -1,6 +1,7 @@
// run-pass
#![warn(rust_2021_incompatible_closure_captures)]
#![allow(drop_ref, drop_copy)]
fn main() {
if let a = "" {

View File

@ -1,5 +1,5 @@
warning: irrefutable `if let` pattern
--> $DIR/issue-78720.rs:6:8
--> $DIR/issue-78720.rs:7:8
|
LL | if let a = "" {
| ^^^^^^^^^^

View File

@ -3,6 +3,7 @@
#![allow(unused)]
#![allow(dead_code)]
#![allow(drop_ref)]
struct Int(i32);
struct B<'a>(&'a i32);

View File

@ -1,6 +1,8 @@
// edition:2021
// check-pass
#![feature(rustc_attrs)]
#![allow(drop_ref)]
fn main() {
let mut x = 1;

View File

@ -1,5 +1,7 @@
// check-pass
#![allow(forget_copy)]
use std::mem::forget;
const _: () = forget(0i32);

View File

@ -1,4 +1,7 @@
// check-pass
#![allow(forget_copy)]
const _: () = core::mem::forget(Box::<u32>::default);
const _: () = core::mem::forget(|| Box::<u32>::default());

View File

@ -1,6 +1,8 @@
// run-pass
// pretty-expanded FIXME #23616
#![allow(drop_copy)]
fn main() {
use ::std::mem;
mem::drop(2_usize);

View File

@ -1,6 +1,8 @@
// run-pass
// needs-unwind
#![allow(drop_ref, drop_copy)]
static mut CHECK: usize = 0;
struct DropChecker(usize);

View File

@ -1,4 +1,7 @@
// run-rustfix
#![allow(drop_ref)]
struct Foo {
x: isize
}

View File

@ -1,4 +1,7 @@
// run-rustfix
#![allow(drop_ref)]
struct Foo {
x: isize
}

View File

@ -1,5 +1,5 @@
error[E0040]: explicit use of destructor method
--> $DIR/explicit-call-to-supertrait-dtor.rs:19:14
--> $DIR/explicit-call-to-supertrait-dtor.rs:22:14
|
LL | self.drop();
| -----^^^^--

View File

@ -13,5 +13,4 @@ fn non_unsafe_pin_new_unchecked<T>(pointer: &mut T) -> Pin<&mut T> {
fn main() {
let mut self_referential = PhantomPinned;
let _: Pin<&mut PhantomPinned> = non_unsafe_pin_new_unchecked(&mut self_referential);
core::mem::forget(self_referential); // move and disable drop glue!
}

View File

@ -4,6 +4,7 @@
//[nomiropt]compile-flags: -Z mir-opt-level=0
#![feature(generators, generator_trait)]
#![allow(drop_copy)]
use std::ops::Generator;
use std::pin::Pin;

View File

@ -1,5 +1,5 @@
error: generator cannot be sent between threads safely
--> $DIR/issue-57017.rs:31:25
--> $DIR/issue-57017.rs:32:25
|
LL | assert_send(g);
| ^ generator is not `Send`
@ -15,7 +15,7 @@ LL | | );
|
= help: the trait `Sync` is not implemented for `copy::unsync::Client`
note: generator is not `Send` as this value is used across a yield
--> $DIR/issue-57017.rs:29:28
--> $DIR/issue-57017.rs:30:28
|
LL | let g = move || match drop(&$name::unsync::Client::default()) {
| --------------------------------- has type `&copy::unsync::Client` which is not `Send`
@ -33,14 +33,14 @@ LL | | }
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
--> $DIR/issue-57017.rs:51:19
--> $DIR/issue-57017.rs:52:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
--> $DIR/issue-57017.rs:43:25
--> $DIR/issue-57017.rs:44:25
|
LL | assert_send(g);
| ^ generator is not `Send`
@ -54,9 +54,9 @@ LL | | }
LL | | );
| |_____- in this macro invocation
|
= help: within `[generator@$DIR/issue-57017.rs:40:21: 40:28]`, the trait `Send` is not implemented for `copy::unsend::Client`
= help: within `[generator@$DIR/issue-57017.rs:41:21: 41:28]`, the trait `Send` is not implemented for `copy::unsend::Client`
note: generator is not `Send` as this value is used across a yield
--> $DIR/issue-57017.rs:41:28
--> $DIR/issue-57017.rs:42:28
|
LL | let g = move || match drop($name::unsend::Client::default()) {
| -------------------------------- has type `copy::unsend::Client` which is not `Send`
@ -74,14 +74,14 @@ LL | | }
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
--> $DIR/issue-57017.rs:51:19
--> $DIR/issue-57017.rs:52:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
--> $DIR/issue-57017.rs:31:25
--> $DIR/issue-57017.rs:32:25
|
LL | assert_send(g);
| ^ generator is not `Send`
@ -97,7 +97,7 @@ LL | | );
|
= help: the trait `Sync` is not implemented for `derived_drop::unsync::Client`
note: generator is not `Send` as this value is used across a yield
--> $DIR/issue-57017.rs:29:28
--> $DIR/issue-57017.rs:30:28
|
LL | let g = move || match drop(&$name::unsync::Client::default()) {
| --------------------------------- has type `&derived_drop::unsync::Client` which is not `Send`
@ -115,14 +115,14 @@ LL | | }
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
--> $DIR/issue-57017.rs:51:19
--> $DIR/issue-57017.rs:52:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
--> $DIR/issue-57017.rs:43:25
--> $DIR/issue-57017.rs:44:25
|
LL | assert_send(g);
| ^ generator is not `Send`
@ -136,9 +136,9 @@ LL | | }
LL | | );
| |_____- in this macro invocation
|
= help: within `[generator@$DIR/issue-57017.rs:40:21: 40:28]`, the trait `Send` is not implemented for `derived_drop::unsend::Client`
= help: within `[generator@$DIR/issue-57017.rs:41:21: 41:28]`, the trait `Send` is not implemented for `derived_drop::unsend::Client`
note: generator is not `Send` as this value is used across a yield
--> $DIR/issue-57017.rs:41:28
--> $DIR/issue-57017.rs:42:28
|
LL | let g = move || match drop($name::unsend::Client::default()) {
| -------------------------------- has type `derived_drop::unsend::Client` which is not `Send`
@ -156,14 +156,14 @@ LL | | }
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
--> $DIR/issue-57017.rs:51:19
--> $DIR/issue-57017.rs:52:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
--> $DIR/issue-57017.rs:31:25
--> $DIR/issue-57017.rs:32:25
|
LL | assert_send(g);
| ^ generator is not `Send`
@ -179,7 +179,7 @@ LL | | );
|
= help: the trait `Sync` is not implemented for `significant_drop::unsync::Client`
note: generator is not `Send` as this value is used across a yield
--> $DIR/issue-57017.rs:29:28
--> $DIR/issue-57017.rs:30:28
|
LL | let g = move || match drop(&$name::unsync::Client::default()) {
| --------------------------------- has type `&significant_drop::unsync::Client` which is not `Send`
@ -197,14 +197,14 @@ LL | | }
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
--> $DIR/issue-57017.rs:51:19
--> $DIR/issue-57017.rs:52:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`
= note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
error: generator cannot be sent between threads safely
--> $DIR/issue-57017.rs:43:25
--> $DIR/issue-57017.rs:44:25
|
LL | assert_send(g);
| ^ generator is not `Send`
@ -218,9 +218,9 @@ LL | | }
LL | | );
| |_____- in this macro invocation
|
= help: within `[generator@$DIR/issue-57017.rs:40:21: 40:28]`, the trait `Send` is not implemented for `significant_drop::unsend::Client`
= help: within `[generator@$DIR/issue-57017.rs:41:21: 41:28]`, the trait `Send` is not implemented for `significant_drop::unsend::Client`
note: generator is not `Send` as this value is used across a yield
--> $DIR/issue-57017.rs:41:28
--> $DIR/issue-57017.rs:42:28
|
LL | let g = move || match drop($name::unsend::Client::default()) {
| -------------------------------- has type `significant_drop::unsend::Client` which is not `Send`
@ -238,7 +238,7 @@ LL | | }
LL | | );
| |_____- in this macro invocation
note: required by a bound in `assert_send`
--> $DIR/issue-57017.rs:51:19
--> $DIR/issue-57017.rs:52:19
|
LL | fn assert_send<T: Send>(_thing: T) {}
| ^^^^ required by this bound in `assert_send`

View File

@ -5,6 +5,7 @@
// [drop_tracking_mir] build-pass
#![feature(generators, negative_impls)]
#![allow(drop_ref, drop_copy)]
macro_rules! type_combinations {
(

View File

@ -3,6 +3,7 @@
// run-pass
#![feature(generators, generator_trait)]
#![allow(drop_copy)]
use std::marker::{PhantomPinned, Unpin};

View File

@ -1,4 +1,5 @@
#![feature(generators)]
#![allow(drop_copy)]
// run-pass

View File

@ -1,6 +1,7 @@
// check-pass
#![feature(decl_macro)]
#![allow(drop_copy)]
macro mac() {
mod m {

View File

@ -1,4 +1,7 @@
// run-rustfix
#![allow(drop_ref)]
struct Foo;
impl Drop for Foo {

View File

@ -1,4 +1,7 @@
// run-rustfix
#![allow(drop_ref)]
struct Foo;
impl Drop for Foo {

View File

@ -1,5 +1,5 @@
error[E0040]: explicit use of destructor method
--> $DIR/illegal-ufcs-drop.rs:9:5
--> $DIR/illegal-ufcs-drop.rs:12:5
|
LL | Drop::drop(&mut Foo)
| ^^^^^^^^^^

View File

@ -1,7 +1,7 @@
#![warn(unused)]
#![deny(unused_variables)]
#![deny(unused_assignments)]
#![allow(dead_code, non_camel_case_types, trivial_numeric_casts)]
#![allow(dead_code, non_camel_case_types, trivial_numeric_casts, drop_copy)]
use std::ops::AddAssign;

View File

@ -4,6 +4,7 @@
#![allow(unused_assignments)]
#![allow(unused_variables)]
#![allow(stable_features)]
#![allow(drop_copy)]
// Test parsing binary operators after macro invocations.

View File

@ -3,6 +3,7 @@
// check-pass
#![feature(never_type)]
#![allow(drop_copy)]
#![warn(unused)]
fn main() {

View File

@ -1,5 +1,5 @@
warning: unreachable statement
--> $DIR/never-assign-dead-code.rs:10:5
--> $DIR/never-assign-dead-code.rs:11:5
|
LL | let x: ! = panic!("aah");
| ------------- any code following this expression is unreachable
@ -7,14 +7,14 @@ LL | drop(x);
| ^^^^^^^^ unreachable statement
|
note: the lint level is defined here
--> $DIR/never-assign-dead-code.rs:6:9
--> $DIR/never-assign-dead-code.rs:7:9
|
LL | #![warn(unused)]
| ^^^^^^
= note: `#[warn(unreachable_code)]` implied by `#[warn(unused)]`
warning: unreachable call
--> $DIR/never-assign-dead-code.rs:10:5
--> $DIR/never-assign-dead-code.rs:11:5
|
LL | drop(x);
| ^^^^ - any code following this expression is unreachable
@ -22,7 +22,7 @@ LL | drop(x);
| unreachable call
warning: unused variable: `x`
--> $DIR/never-assign-dead-code.rs:9:9
--> $DIR/never-assign-dead-code.rs:10:9
|
LL | let x: ! = panic!("aah");
| ^ help: if this is intentional, prefix it with an underscore: `_x`

View File

@ -5,6 +5,8 @@
// check-pass
// compile-flags:-Zno-leak-check
#![allow(drop_copy)]
fn make_it() -> for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32 {
panic!()
}

View File

@ -3,6 +3,8 @@
//
// check-pass
#![allow(drop_ref)]
trait MyTrait<'a> {
type Output;
}

View File

@ -3,6 +3,8 @@
// check-pass
#![allow(irrefutable_let_patterns)]
#![allow(drop_copy)]
#![allow(drop_ref)]
fn main() {
// A regression test for a mistake we made at one point:

View File

@ -2,6 +2,9 @@
// Test `@` patterns combined with `box` patterns.
#![allow(drop_ref)]
#![allow(drop_copy)]
#![feature(box_patterns)]
#[derive(Copy, Clone)]

View File

@ -2,6 +2,8 @@
// Test `Copy` bindings in the rhs of `@` patterns.
#![allow(drop_copy)]
#[derive(Copy, Clone)]
struct C;

View File

@ -1,5 +1,7 @@
// check-pass
#![allow(drop_ref)]
fn main() {}
struct U;

View File

@ -1,5 +1,7 @@
// check-pass
#![allow(drop_ref)]
fn main() {
struct U;
fn accept_fn_once(_: impl FnOnce()) {}

View File

@ -3,6 +3,8 @@
// build-pass
// ignore-pass
#![allow(drop_copy)]
async fn wait() {}
pub async fn test(arg: [u8; 8192]) {

View File

@ -1,4 +1,4 @@
print-type-size type: `[async fn body@$DIR/async.rs:8:36: 11:2]`: 16386 bytes, alignment: 1 bytes
print-type-size type: `[async fn body@$DIR/async.rs:10:36: 13:2]`: 16386 bytes, alignment: 1 bytes
print-type-size discriminant: 1 bytes
print-type-size variant `Unresumed`: 8192 bytes
print-type-size upvar `.arg`: 8192 bytes
@ -16,14 +16,14 @@ print-type-size type: `std::mem::MaybeUninit<[u8; 8192]>`: 8192 bytes, alignment
print-type-size variant `MaybeUninit`: 8192 bytes
print-type-size field `.uninit`: 0 bytes
print-type-size field `.value`: 8192 bytes
print-type-size type: `[async fn body@$DIR/async.rs:6:17: 6:19]`: 1 bytes, alignment: 1 bytes
print-type-size type: `[async fn body@$DIR/async.rs:8:17: 8:19]`: 1 bytes, alignment: 1 bytes
print-type-size discriminant: 1 bytes
print-type-size variant `Unresumed`: 0 bytes
print-type-size variant `Returned`: 0 bytes
print-type-size variant `Panicked`: 0 bytes
print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:6:17: 6:19]>`: 1 bytes, alignment: 1 bytes
print-type-size type: `std::mem::ManuallyDrop<[async fn body@$DIR/async.rs:8:17: 8:19]>`: 1 bytes, alignment: 1 bytes
print-type-size field `.value`: 1 bytes
print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:6:17: 6:19]>`: 1 bytes, alignment: 1 bytes
print-type-size type: `std::mem::MaybeUninit<[async fn body@$DIR/async.rs:8:17: 8:19]>`: 1 bytes, alignment: 1 bytes
print-type-size variant `MaybeUninit`: 1 bytes
print-type-size field `.uninit`: 0 bytes
print-type-size field `.value`: 1 bytes

View File

@ -6,6 +6,7 @@
// Avoid emitting panic handlers, like the rest of these tests...
#![feature(generators)]
#![allow(drop_copy)]
pub fn foo() {
let a = || {

View File

@ -1,4 +1,4 @@
print-type-size type: `[generator@$DIR/generator_discr_placement.rs:11:13: 11:15]`: 8 bytes, alignment: 4 bytes
print-type-size type: `[generator@$DIR/generator_discr_placement.rs:12:13: 12:15]`: 8 bytes, alignment: 4 bytes
print-type-size discriminant: 1 bytes
print-type-size variant `Unresumed`: 0 bytes
print-type-size variant `Suspend0`: 7 bytes

View File

@ -55,11 +55,11 @@ where
}
pub fn x<T: Copy>(a: Array<T>) {
// drop just avoids a must_use warning
drop((0..1).filter(|_| true));
// _ just avoids a must_use warning
let _ = (0..1).filter(|_| true);
let y = a.index_axis();
a.axis_iter().for_each(|_| {
drop(y);
let _ = y;
});
}

View File

@ -3,6 +3,8 @@
// check-pass
#![allow(drop_copy)]
use std::marker::PhantomData;
fn apply<T, F: FnOnce(T)>(_: T, _: F) {}

View File

@ -3,6 +3,8 @@
// check-pass
#![allow(drop_ref)]
// aux-build:monovariants.rs
extern crate monovariants;

View File

@ -4,6 +4,8 @@
// Tests ensuring that `dbg!(expr)` has the expected run-time behavior.
// as well as some compile time properties we expect.
#![allow(drop_copy)]
#[derive(Copy, Clone, Debug)]
struct Unit;

View File

@ -1,28 +1,28 @@
[$DIR/dbg-macro-expected-behavior.rs:20] Unit = Unit
[$DIR/dbg-macro-expected-behavior.rs:21] a = Unit
[$DIR/dbg-macro-expected-behavior.rs:27] Point { x: 42, y: 24 } = Point {
[$DIR/dbg-macro-expected-behavior.rs:22] Unit = Unit
[$DIR/dbg-macro-expected-behavior.rs:23] a = Unit
[$DIR/dbg-macro-expected-behavior.rs:29] Point { x: 42, y: 24 } = Point {
x: 42,
y: 24,
}
[$DIR/dbg-macro-expected-behavior.rs:28] b = Point {
[$DIR/dbg-macro-expected-behavior.rs:30] b = Point {
x: 42,
y: 24,
}
[$DIR/dbg-macro-expected-behavior.rs:36]
[$DIR/dbg-macro-expected-behavior.rs:40] &a = NoCopy(
[$DIR/dbg-macro-expected-behavior.rs:38]
[$DIR/dbg-macro-expected-behavior.rs:42] &a = NoCopy(
1337,
)
[$DIR/dbg-macro-expected-behavior.rs:40] dbg!(& a) = NoCopy(
[$DIR/dbg-macro-expected-behavior.rs:42] dbg!(& a) = NoCopy(
1337,
)
[$DIR/dbg-macro-expected-behavior.rs:45] f(&42) = 42
[$DIR/dbg-macro-expected-behavior.rs:47] f(&42) = 42
before
[$DIR/dbg-macro-expected-behavior.rs:50] { foo += 1; eprintln!("before"); 7331 } = 7331
[$DIR/dbg-macro-expected-behavior.rs:58] ("Yeah",) = (
[$DIR/dbg-macro-expected-behavior.rs:52] { foo += 1; eprintln!("before"); 7331 } = 7331
[$DIR/dbg-macro-expected-behavior.rs:60] ("Yeah",) = (
"Yeah",
)
[$DIR/dbg-macro-expected-behavior.rs:61] 1 = 1
[$DIR/dbg-macro-expected-behavior.rs:61] 2 = 2
[$DIR/dbg-macro-expected-behavior.rs:65] 1u8 = 1
[$DIR/dbg-macro-expected-behavior.rs:65] 2u32 = 2
[$DIR/dbg-macro-expected-behavior.rs:65] "Yeah" = "Yeah"
[$DIR/dbg-macro-expected-behavior.rs:63] 1 = 1
[$DIR/dbg-macro-expected-behavior.rs:63] 2 = 2
[$DIR/dbg-macro-expected-behavior.rs:67] 1u8 = 1
[$DIR/dbg-macro-expected-behavior.rs:67] 2u32 = 2
[$DIR/dbg-macro-expected-behavior.rs:67] "Yeah" = "Yeah"

View File

@ -5,6 +5,7 @@
// compile-flags:--extern remove_extern_crate
#![warn(rust_2018_idioms)]
#![allow(drop_copy)]
//~ WARNING unused extern crate
// Shouldn't suggest changing to `use`, as `another_name`

View File

@ -5,6 +5,7 @@
// compile-flags:--extern remove_extern_crate
#![warn(rust_2018_idioms)]
#![allow(drop_copy)]
extern crate core; //~ WARNING unused extern crate
// Shouldn't suggest changing to `use`, as `another_name`

View File

@ -1,5 +1,5 @@
warning: unused extern crate
--> $DIR/remove-extern-crate.rs:9:1
--> $DIR/remove-extern-crate.rs:10:1
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^ help: remove it
@ -12,7 +12,7 @@ LL | #![warn(rust_2018_idioms)]
= note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]`
warning: `extern crate` is not idiomatic in the new edition
--> $DIR/remove-extern-crate.rs:33:5
--> $DIR/remove-extern-crate.rs:34:5
|
LL | extern crate core;
| ^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL | use core;
| ~~~
warning: `extern crate` is not idiomatic in the new edition
--> $DIR/remove-extern-crate.rs:43:5
--> $DIR/remove-extern-crate.rs:44:5
|
LL | pub extern crate core;
| ^^^^^^^^^^^^^^^^^^^^^^

View File

@ -12,6 +12,8 @@
//
// In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!"
#![allow(drop_copy)]
pub mod before {
#[no_mangle]
pub static GLOBAL1: [u8; 1] = [1];

View File

@ -1,5 +1,8 @@
// run-pass
#![allow(dead_code)]
#![allow(drop_copy)]
// "guessing" in trait selection can affect `copy_or_move`. Check that this
// is correctly handled. I am not sure what is the "correct" behaviour,
// but we should at least not ICE.

View File

@ -6,6 +6,8 @@
// check-pass
#![allow(drop_copy)]
trait A {
type B;
}

View File

@ -1,5 +1,5 @@
error[E0277]: `impl Future<Output = ()>` cannot be sent between threads safely
--> $DIR/auto-with-drop_tracking_mir.rs:24:13
--> $DIR/auto-with-drop_tracking_mir.rs:25:13
|
LL | is_send(foo());
| ------- ^^^^^ `impl Future<Output = ()>` cannot be sent between threads safely
@ -8,7 +8,7 @@ LL | is_send(foo());
|
= help: the trait `Send` is not implemented for `impl Future<Output = ()>`
note: required by a bound in `is_send`
--> $DIR/auto-with-drop_tracking_mir.rs:23:24
--> $DIR/auto-with-drop_tracking_mir.rs:24:24
|
LL | fn is_send(_: impl Send) {}
| ^^^^ required by this bound in `is_send`

View File

@ -14,6 +14,7 @@ async fn foo() {
#[cfg(fail)]
let x = &NotSync;
bar().await;
#[allow(drop_ref)]
drop(x);
}

View File

@ -18,5 +18,5 @@ fn main() {
let w = Wrapper(x);
needs_foo(w);
x = 1;
drop(x);
let _ = x;
}

View File

@ -1,6 +1,8 @@
// check-pass
// Check tautalogically false `Copy` bounds
#![feature(trivial_bounds)]
#![allow(drop_ref, drop_copy)]
fn copy_string(t: String) -> String where String: Copy { //~ WARNING trivial_bounds
is_copy(&t);

View File

@ -1,5 +1,5 @@
warning: trait bound String: Copy does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-inconsistent-copy.rs:5:51
--> $DIR/trivial-bounds-inconsistent-copy.rs:7:51
|
LL | fn copy_string(t: String) -> String where String: Copy {
| ^^^^
@ -7,19 +7,19 @@ LL | fn copy_string(t: String) -> String where String: Copy {
= note: `#[warn(trivial_bounds)]` on by default
warning: trait bound String: Copy does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-inconsistent-copy.rs:12:56
--> $DIR/trivial-bounds-inconsistent-copy.rs:14:56
|
LL | fn copy_out_string(t: &String) -> String where String: Copy {
| ^^^^
warning: trait bound String: Copy does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-inconsistent-copy.rs:16:55
--> $DIR/trivial-bounds-inconsistent-copy.rs:18:55
|
LL | fn copy_string_with_param<T>(x: String) where String: Copy {
| ^^^^
warning: trait bound for<'b> &'b mut i32: Copy does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-inconsistent-copy.rs:22:76
--> $DIR/trivial-bounds-inconsistent-copy.rs:24:76
|
LL | fn copy_mut<'a>(t: &&'a mut i32) -> &'a mut i32 where for<'b> &'b mut i32: Copy {
| ^^^^