1
Fork 0

Rollup merge of #111756 - Urgau:rename_drop_forget_copy_ref_lints, r=fee1-dead

Rename `{drop,forget}_{copy,ref}` lints to more consistent naming

This PR renames previous uplifted lints in https://github.com/rust-lang/rust/pull/109732 to more consistent naming.

I followed the renaming done [here](https://github.com/rust-lang/rust/issues/53224) and also advocated in this [clippy issue](https://github.com/rust-lang/rust-clippy/issues/2845):
   - `drop_copy` to `dropping_copy_types`
   - `forget_copy` to `forgetting_copy_types`
   - `drop_ref` to `dropping_references`
   - `forget_ref` to `forgetting_references`
This commit is contained in:
Dylan DPC 2023-05-23 00:32:19 +05:30 committed by GitHub
commit 71f78682be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 155 additions and 155 deletions

View file

@ -521,18 +521,18 @@ lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its ass
lint_opaque_hidden_inferred_bound_sugg = add this bound lint_opaque_hidden_inferred_bound_sugg = add this bound
lint_drop_ref = calls to `std::mem::drop` with a reference instead of an owned value does nothing lint_dropping_references = calls to `std::mem::drop` with a reference instead of an owned value does nothing
.label = argument has type `{$arg_ty}` .label = argument has type `{$arg_ty}`
.note = use `let _ = ...` to ignore the expression or result .note = use `let _ = ...` to ignore the expression or result
lint_drop_copy = calls to `std::mem::drop` with a value that implements `Copy` does nothing lint_dropping_copy_types = calls to `std::mem::drop` with a value that implements `Copy` does nothing
.label = argument has type `{$arg_ty}` .label = argument has type `{$arg_ty}`
.note = use `let _ = ...` to ignore the expression or result .note = use `let _ = ...` to ignore the expression or result
lint_forget_ref = calls to `std::mem::forget` with a reference instead of an owned value does nothing lint_forgetting_references = calls to `std::mem::forget` with a reference instead of an owned value does nothing
.label = argument has type `{$arg_ty}` .label = argument has type `{$arg_ty}`
.note = use `let _ = ...` to ignore the expression or result .note = use `let _ = ...` to ignore the expression or result
lint_forget_copy = calls to `std::mem::forget` with a value that implements `Copy` does nothing lint_forgetting_copy_types = calls to `std::mem::forget` with a value that implements `Copy` does nothing
.label = argument has type `{$arg_ty}` .label = argument has type `{$arg_ty}`
.note = use `let _ = ...` to ignore the expression or result .note = use `let _ = ...` to ignore the expression or result

View file

@ -7,7 +7,7 @@ use crate::{
}; };
declare_lint! { declare_lint! {
/// The `drop_ref` lint checks for calls to `std::mem::drop` with a reference /// The `dropping_references` lint checks for calls to `std::mem::drop` with a reference
/// instead of an owned value. /// instead of an owned value.
/// ///
/// ### Example /// ### Example
@ -29,13 +29,13 @@ declare_lint! {
/// reference itself, which is a no-op. It will not call the `drop` method (from /// reference itself, which is a no-op. It will not call the `drop` method (from
/// the `Drop` trait implementation) on the underlying referenced value, which /// the `Drop` trait implementation) on the underlying referenced value, which
/// is likely what was intended. /// is likely what was intended.
pub DROP_REF, pub DROPPING_REFERENCES,
Warn, Warn,
"calls to `std::mem::drop` with a reference instead of an owned value" "calls to `std::mem::drop` with a reference instead of an owned value"
} }
declare_lint! { declare_lint! {
/// The `forget_ref` lint checks for calls to `std::mem::forget` with a reference /// The `forgetting_references` lint checks for calls to `std::mem::forget` with a reference
/// instead of an owned value. /// instead of an owned value.
/// ///
/// ### Example /// ### Example
@ -52,13 +52,13 @@ declare_lint! {
/// Calling `forget` on a reference will only forget the /// Calling `forget` on a reference will only forget the
/// reference itself, which is a no-op. It will not forget the underlying /// reference itself, which is a no-op. It will not forget the underlying
/// referenced value, which is likely what was intended. /// referenced value, which is likely what was intended.
pub FORGET_REF, pub FORGETTING_REFERENCES,
Warn, Warn,
"calls to `std::mem::forget` with a reference instead of an owned value" "calls to `std::mem::forget` with a reference instead of an owned value"
} }
declare_lint! { declare_lint! {
/// The `drop_copy` lint checks for calls to `std::mem::drop` with a value /// The `dropping_copy_types` lint checks for calls to `std::mem::drop` with a value
/// that derives the Copy trait. /// that derives the Copy trait.
/// ///
/// ### Example /// ### Example
@ -76,13 +76,13 @@ declare_lint! {
/// Calling `std::mem::drop` [does nothing for types that /// Calling `std::mem::drop` [does nothing for types that
/// implement Copy](https://doc.rust-lang.org/std/mem/fn.drop.html), since the /// implement Copy](https://doc.rust-lang.org/std/mem/fn.drop.html), since the
/// value will be copied and moved into the function on invocation. /// value will be copied and moved into the function on invocation.
pub DROP_COPY, pub DROPPING_COPY_TYPES,
Warn, Warn,
"calls to `std::mem::drop` with a value that implements Copy" "calls to `std::mem::drop` with a value that implements Copy"
} }
declare_lint! { declare_lint! {
/// The `forget_copy` lint checks for calls to `std::mem::forget` with a value /// The `forgetting_copy_types` lint checks for calls to `std::mem::forget` with a value
/// that derives the Copy trait. /// that derives the Copy trait.
/// ///
/// ### Example /// ### Example
@ -104,12 +104,12 @@ declare_lint! {
/// An alternative, but also valid, explanation is that Copy types do not /// An alternative, but also valid, explanation is that Copy types do not
/// implement the Drop trait, which means they have no destructors. Without a /// implement the Drop trait, which means they have no destructors. Without a
/// destructor, there is nothing for `std::mem::forget` to ignore. /// destructor, there is nothing for `std::mem::forget` to ignore.
pub FORGET_COPY, pub FORGETTING_COPY_TYPES,
Warn, Warn,
"calls to `std::mem::forget` with a value that implements Copy" "calls to `std::mem::forget` with a value that implements Copy"
} }
declare_lint_pass!(DropForgetUseless => [DROP_REF, FORGET_REF, DROP_COPY, FORGET_COPY]); declare_lint_pass!(DropForgetUseless => [DROPPING_REFERENCES, FORGETTING_REFERENCES, DROPPING_COPY_TYPES, FORGETTING_COPY_TYPES]);
impl<'tcx> LateLintPass<'tcx> for DropForgetUseless { impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
@ -123,16 +123,16 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr); let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
match fn_name { match fn_name {
sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => { sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => {
cx.emit_spanned_lint(DROP_REF, expr.span, DropRefDiag { arg_ty, label: arg.span }); cx.emit_spanned_lint(DROPPING_REFERENCES, expr.span, DropRefDiag { arg_ty, label: arg.span });
}, },
sym::mem_forget if arg_ty.is_ref() => { sym::mem_forget if arg_ty.is_ref() => {
cx.emit_spanned_lint(FORGET_REF, expr.span, ForgetRefDiag { arg_ty, label: arg.span }); cx.emit_spanned_lint(FORGETTING_REFERENCES, expr.span, ForgetRefDiag { arg_ty, label: arg.span });
}, },
sym::mem_drop if is_copy && !drop_is_single_call_in_arm => { sym::mem_drop if is_copy && !drop_is_single_call_in_arm => {
cx.emit_spanned_lint(DROP_COPY, expr.span, DropCopyDiag { arg_ty, label: arg.span }); cx.emit_spanned_lint(DROPPING_COPY_TYPES, expr.span, DropCopyDiag { arg_ty, label: arg.span });
} }
sym::mem_forget if is_copy => { sym::mem_forget if is_copy => {
cx.emit_spanned_lint(FORGET_COPY, expr.span, ForgetCopyDiag { arg_ty, label: arg.span }); cx.emit_spanned_lint(FORGETTING_COPY_TYPES, expr.span, ForgetCopyDiag { arg_ty, label: arg.span });
} }
_ => return, _ => return,
}; };

View file

@ -662,9 +662,9 @@ pub struct ForLoopsOverFalliblesSuggestion<'a> {
pub end_span: Span, pub end_span: Span,
} }
// drop_ref.rs // drop_forget_useless.rs
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(lint_drop_ref)] #[diag(lint_dropping_references)]
#[note] #[note]
pub struct DropRefDiag<'a> { pub struct DropRefDiag<'a> {
pub arg_ty: Ty<'a>, pub arg_ty: Ty<'a>,
@ -673,7 +673,7 @@ pub struct DropRefDiag<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(lint_drop_copy)] #[diag(lint_dropping_copy_types)]
#[note] #[note]
pub struct DropCopyDiag<'a> { pub struct DropCopyDiag<'a> {
pub arg_ty: Ty<'a>, pub arg_ty: Ty<'a>,
@ -682,7 +682,7 @@ pub struct DropCopyDiag<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(lint_forget_ref)] #[diag(lint_forgetting_references)]
#[note] #[note]
pub struct ForgetRefDiag<'a> { pub struct ForgetRefDiag<'a> {
pub arg_ty: Ty<'a>, pub arg_ty: Ty<'a>,
@ -691,7 +691,7 @@ pub struct ForgetRefDiag<'a> {
} }
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(lint_forget_copy)] #[diag(lint_forgetting_copy_types)]
#[note] #[note]
pub struct ForgetCopyDiag<'a> { pub struct ForgetCopyDiag<'a> {
pub arg_ty: Ty<'a>, pub arg_ty: Ty<'a>,

View file

@ -968,7 +968,7 @@ pub const fn replace<T>(dest: &mut T, src: T) -> T {
/// Integers and other types implementing [`Copy`] are unaffected by `drop`. /// Integers and other types implementing [`Copy`] are unaffected by `drop`.
/// ///
/// ``` /// ```
/// # #![cfg_attr(not(bootstrap), allow(drop_copy))] /// # #![cfg_attr(not(bootstrap), allow(dropping_copy_types))]
/// #[derive(Copy, Clone)] /// #[derive(Copy, Clone)]
/// struct Foo(u8); /// struct Foo(u8);
/// ///

View file

@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetRef {
let is_copy = is_copy(cx, arg_ty); let is_copy = is_copy(cx, arg_ty);
let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr); let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr);
let (lint, msg) = match fn_name { let (lint, msg) = match fn_name {
// early return for uplifted lints: drop_ref, drop_copy, forget_ref, forget_copy // early return for uplifted lints: dropping_references, dropping_copy_types, forgetting_references, forgetting_copy_types
sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => return, sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => return,
sym::mem_forget if arg_ty.is_ref() => return, sym::mem_forget if arg_ty.is_ref() => return,
sym::mem_drop if is_copy && !drop_is_single_call_in_arm => return, sym::mem_drop if is_copy && !drop_is_single_call_in_arm => return,

View file

@ -33,13 +33,13 @@ pub static RENAMED_LINTS: &[(&str, &str)] = &[
("clippy::zero_width_space", "clippy::invisible_characters"), ("clippy::zero_width_space", "clippy::invisible_characters"),
("clippy::clone_double_ref", "suspicious_double_ref_op"), ("clippy::clone_double_ref", "suspicious_double_ref_op"),
("clippy::drop_bounds", "drop_bounds"), ("clippy::drop_bounds", "drop_bounds"),
("clippy::drop_copy", "drop_copy"), ("clippy::drop_copy", "dropping_copy_types"),
("clippy::drop_ref", "drop_ref"), ("clippy::drop_ref", "dropping_references"),
("clippy::for_loop_over_option", "for_loops_over_fallibles"), ("clippy::for_loop_over_option", "for_loops_over_fallibles"),
("clippy::for_loop_over_result", "for_loops_over_fallibles"), ("clippy::for_loop_over_result", "for_loops_over_fallibles"),
("clippy::for_loops_over_fallibles", "for_loops_over_fallibles"), ("clippy::for_loops_over_fallibles", "for_loops_over_fallibles"),
("clippy::forget_copy", "forget_copy"), ("clippy::forget_copy", "forgetting_copy_types"),
("clippy::forget_ref", "forget_ref"), ("clippy::forget_ref", "forgetting_references"),
("clippy::into_iter_on_array", "array_into_iter"), ("clippy::into_iter_on_array", "array_into_iter"),
("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"), ("clippy::invalid_atomic_ordering", "invalid_atomic_ordering"),
("clippy::invalid_ref", "invalid_value"), ("clippy::invalid_ref", "invalid_value"),

View file

@ -5,7 +5,7 @@ use std::mem as memstuff;
use std::mem::forget as forgetSomething; use std::mem::forget as forgetSomething;
#[warn(clippy::mem_forget)] #[warn(clippy::mem_forget)]
#[allow(forget_copy)] #[allow(forgetting_copy_types)]
fn main() { fn main() {
let five: i32 = 5; let five: i32 = 5;
forgetSomething(five); forgetSomething(five);

View file

@ -2,7 +2,7 @@
#![allow(unused)] #![allow(unused)]
#![allow(deref_nullptr)] #![allow(deref_nullptr)]
#![allow(clippy::unnecessary_operation)] #![allow(clippy::unnecessary_operation)]
#![allow(drop_copy)] #![allow(dropping_copy_types)]
#![warn(clippy::multiple_unsafe_ops_per_block)] #![warn(clippy::multiple_unsafe_ops_per_block)]
extern crate proc_macros; extern crate proc_macros;

View file

@ -30,11 +30,11 @@
#![allow(clippy::invisible_characters)] #![allow(clippy::invisible_characters)]
#![allow(suspicious_double_ref_op)] #![allow(suspicious_double_ref_op)]
#![allow(drop_bounds)] #![allow(drop_bounds)]
#![allow(drop_copy)] #![allow(dropping_copy_types)]
#![allow(drop_ref)] #![allow(dropping_references)]
#![allow(for_loops_over_fallibles)] #![allow(for_loops_over_fallibles)]
#![allow(forget_copy)] #![allow(forgetting_copy_types)]
#![allow(forget_ref)] #![allow(forgetting_references)]
#![allow(array_into_iter)] #![allow(array_into_iter)]
#![allow(invalid_atomic_ordering)] #![allow(invalid_atomic_ordering)]
#![allow(invalid_value)] #![allow(invalid_value)]
@ -77,13 +77,13 @@
#![warn(clippy::invisible_characters)] #![warn(clippy::invisible_characters)]
#![warn(suspicious_double_ref_op)] #![warn(suspicious_double_ref_op)]
#![warn(drop_bounds)] #![warn(drop_bounds)]
#![warn(drop_copy)] #![warn(dropping_copy_types)]
#![warn(drop_ref)] #![warn(dropping_references)]
#![warn(for_loops_over_fallibles)] #![warn(for_loops_over_fallibles)]
#![warn(for_loops_over_fallibles)] #![warn(for_loops_over_fallibles)]
#![warn(for_loops_over_fallibles)] #![warn(for_loops_over_fallibles)]
#![warn(forget_copy)] #![warn(forgetting_copy_types)]
#![warn(forget_ref)] #![warn(forgetting_references)]
#![warn(array_into_iter)] #![warn(array_into_iter)]
#![warn(invalid_atomic_ordering)] #![warn(invalid_atomic_ordering)]
#![warn(invalid_value)] #![warn(invalid_value)]

View file

@ -30,11 +30,11 @@
#![allow(clippy::invisible_characters)] #![allow(clippy::invisible_characters)]
#![allow(suspicious_double_ref_op)] #![allow(suspicious_double_ref_op)]
#![allow(drop_bounds)] #![allow(drop_bounds)]
#![allow(drop_copy)] #![allow(dropping_copy_types)]
#![allow(drop_ref)] #![allow(dropping_references)]
#![allow(for_loops_over_fallibles)] #![allow(for_loops_over_fallibles)]
#![allow(forget_copy)] #![allow(forgetting_copy_types)]
#![allow(forget_ref)] #![allow(forgetting_references)]
#![allow(array_into_iter)] #![allow(array_into_iter)]
#![allow(invalid_atomic_ordering)] #![allow(invalid_atomic_ordering)]
#![allow(invalid_value)] #![allow(invalid_value)]

View file

@ -186,17 +186,17 @@ error: lint `clippy::drop_bounds` has been renamed to `drop_bounds`
LL | #![warn(clippy::drop_bounds)] LL | #![warn(clippy::drop_bounds)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds` | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `drop_bounds`
error: lint `clippy::drop_copy` has been renamed to `drop_copy` error: lint `clippy::drop_copy` has been renamed to `dropping_copy_types`
--> $DIR/rename.rs:80:9 --> $DIR/rename.rs:80:9
| |
LL | #![warn(clippy::drop_copy)] LL | #![warn(clippy::drop_copy)]
| ^^^^^^^^^^^^^^^^^ help: use the new name: `drop_copy` | ^^^^^^^^^^^^^^^^^ help: use the new name: `dropping_copy_types`
error: lint `clippy::drop_ref` has been renamed to `drop_ref` error: lint `clippy::drop_ref` has been renamed to `dropping_references`
--> $DIR/rename.rs:81:9 --> $DIR/rename.rs:81:9
| |
LL | #![warn(clippy::drop_ref)] LL | #![warn(clippy::drop_ref)]
| ^^^^^^^^^^^^^^^^ help: use the new name: `drop_ref` | ^^^^^^^^^^^^^^^^ help: use the new name: `dropping_references`
error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles` error: lint `clippy::for_loop_over_option` has been renamed to `for_loops_over_fallibles`
--> $DIR/rename.rs:82:9 --> $DIR/rename.rs:82:9
@ -216,17 +216,17 @@ error: lint `clippy::for_loops_over_fallibles` has been renamed to `for_loops_ov
LL | #![warn(clippy::for_loops_over_fallibles)] LL | #![warn(clippy::for_loops_over_fallibles)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `for_loops_over_fallibles`
error: lint `clippy::forget_copy` has been renamed to `forget_copy` error: lint `clippy::forget_copy` has been renamed to `forgetting_copy_types`
--> $DIR/rename.rs:85:9 --> $DIR/rename.rs:85:9
| |
LL | #![warn(clippy::forget_copy)] LL | #![warn(clippy::forget_copy)]
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forget_copy` | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_copy_types`
error: lint `clippy::forget_ref` has been renamed to `forget_ref` error: lint `clippy::forget_ref` has been renamed to `forgetting_references`
--> $DIR/rename.rs:86:9 --> $DIR/rename.rs:86:9
| |
LL | #![warn(clippy::forget_ref)] LL | #![warn(clippy::forget_ref)]
| ^^^^^^^^^^^^^^^^^^ help: use the new name: `forget_ref` | ^^^^^^^^^^^^^^^^^^ help: use the new name: `forgetting_references`
error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter` error: lint `clippy::into_iter_on_array` has been renamed to `array_into_iter`
--> $DIR/rename.rs:87:9 --> $DIR/rename.rs:87:9

View file

@ -1,4 +1,4 @@
#![allow(drop_ref)] #![allow(dropping_references)]
fn main() { fn main() {
let target = &mut 42; let target = &mut 42;

View file

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

View file

@ -1,7 +1,7 @@
//@error-in-other-file: memory is uninitialized at [0x4..0x8] //@error-in-other-file: memory is uninitialized at [0x4..0x8]
//@normalize-stderr-test: "a[0-9]+" -> "ALLOC" //@normalize-stderr-test: "a[0-9]+" -> "ALLOC"
#![feature(strict_provenance)] #![feature(strict_provenance)]
#![allow(drop_copy)] #![allow(dropping_copy_types)]
// Test printing allocations that contain single-byte provenance. // Test printing allocations that contain single-byte provenance.

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
// check-pass // check-pass
#![feature(rustc_attrs)] #![feature(rustc_attrs)]
#![allow(drop_ref)] #![allow(dropping_references)]
fn main() { fn main() {
let mut x = 1; let mut x = 1;

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![allow(forget_copy)] #![allow(forgetting_copy_types)]
use std::mem::forget; use std::mem::forget;

View file

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

View file

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

View file

@ -1,7 +1,7 @@
// run-pass // run-pass
// needs-unwind // needs-unwind
#![allow(drop_ref, drop_copy)] #![allow(dropping_references, dropping_copy_types)]
static mut CHECK: usize = 0; static mut CHECK: usize = 0;

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
// run-rustfix // run-rustfix
#![allow(drop_ref)] #![allow(dropping_references)]
struct Foo; struct Foo;

View file

@ -1,6 +1,6 @@
// run-rustfix // run-rustfix
#![allow(drop_ref)] #![allow(dropping_references)]
struct Foo; struct Foo;

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![warn(drop_copy)] #![warn(dropping_copy_types)]
use std::mem::drop; use std::mem::drop;
use std::vec::Vec; use std::vec::Vec;

View file

@ -1,5 +1,5 @@
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/drop_copy.rs:34:5 --> $DIR/dropping_copy_types.rs:34:5
| |
LL | drop(s1); LL | drop(s1);
| ^^^^^--^ | ^^^^^--^
@ -8,13 +8,13 @@ LL | drop(s1);
| |
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
note: the lint level is defined here note: the lint level is defined here
--> $DIR/drop_copy.rs:3:9 --> $DIR/dropping_copy_types.rs:3:9
| |
LL | #![warn(drop_copy)] LL | #![warn(dropping_copy_types)]
| ^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/drop_copy.rs:35:5 --> $DIR/dropping_copy_types.rs:35:5
| |
LL | drop(s2); LL | drop(s2);
| ^^^^^--^ | ^^^^^--^
@ -24,7 +24,7 @@ LL | drop(s2);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_copy.rs:36:5 --> $DIR/dropping_copy_types.rs:36:5
| |
LL | drop(s3); LL | drop(s3);
| ^^^^^--^ | ^^^^^--^
@ -32,10 +32,10 @@ LL | drop(s3);
| argument has type `&SomeStruct` | argument has type `&SomeStruct`
| |
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
= note: `#[warn(drop_ref)]` on by default = note: `#[warn(dropping_references)]` on by default
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/drop_copy.rs:37:5 --> $DIR/dropping_copy_types.rs:37:5
| |
LL | drop(s4); LL | drop(s4);
| ^^^^^--^ | ^^^^^--^
@ -45,7 +45,7 @@ LL | drop(s4);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_copy.rs:38:5 --> $DIR/dropping_copy_types.rs:38:5
| |
LL | drop(s5); LL | drop(s5);
| ^^^^^--^ | ^^^^^--^
@ -55,7 +55,7 @@ LL | drop(s5);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_copy.rs:50:5 --> $DIR/dropping_copy_types.rs:50:5
| |
LL | drop(a2); LL | drop(a2);
| ^^^^^--^ | ^^^^^--^
@ -65,7 +65,7 @@ LL | drop(a2);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_copy.rs:52:5 --> $DIR/dropping_copy_types.rs:52:5
| |
LL | drop(a4); LL | drop(a4);
| ^^^^^--^ | ^^^^^--^
@ -75,7 +75,7 @@ LL | drop(a4);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/drop_copy.rs:71:13 --> $DIR/dropping_copy_types.rs:71:13
| |
LL | drop(println_and(13)); LL | drop(println_and(13));
| ^^^^^---------------^ | ^^^^^---------------^
@ -85,7 +85,7 @@ LL | drop(println_and(13));
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/drop_copy.rs:74:14 --> $DIR/dropping_copy_types.rs:74:14
| |
LL | 3 if drop(println_and(14)) == () => (), LL | 3 if drop(println_and(14)) == () => (),
| ^^^^^---------------^ | ^^^^^---------------^
@ -95,7 +95,7 @@ LL | 3 if drop(println_and(14)) == () => (),
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing
--> $DIR/drop_copy.rs:76:14 --> $DIR/dropping_copy_types.rs:76:14
| |
LL | 4 => drop(2), LL | 4 => drop(2),
| ^^^^^-^ | ^^^^^-^

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![warn(drop_ref)] #![warn(dropping_references)]
struct SomeStruct; struct SomeStruct;

View file

@ -1,5 +1,5 @@
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:8:5 --> $DIR/dropping_references.rs:8:5
| |
LL | drop(&SomeStruct); LL | drop(&SomeStruct);
| ^^^^^-----------^ | ^^^^^-----------^
@ -8,13 +8,13 @@ LL | drop(&SomeStruct);
| |
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
note: the lint level is defined here note: the lint level is defined here
--> $DIR/drop_ref.rs:3:9 --> $DIR/dropping_references.rs:3:9
| |
LL | #![warn(drop_ref)] LL | #![warn(dropping_references)]
| ^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:11:5 --> $DIR/dropping_references.rs:11:5
| |
LL | drop(&owned1); LL | drop(&owned1);
| ^^^^^-------^ | ^^^^^-------^
@ -24,7 +24,7 @@ LL | drop(&owned1);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:12:5 --> $DIR/dropping_references.rs:12:5
| |
LL | drop(&&owned1); LL | drop(&&owned1);
| ^^^^^--------^ | ^^^^^--------^
@ -34,7 +34,7 @@ LL | drop(&&owned1);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:13:5 --> $DIR/dropping_references.rs:13:5
| |
LL | drop(&mut owned1); LL | drop(&mut owned1);
| ^^^^^-----------^ | ^^^^^-----------^
@ -44,7 +44,7 @@ LL | drop(&mut owned1);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:17:5 --> $DIR/dropping_references.rs:17:5
| |
LL | drop(reference1); LL | drop(reference1);
| ^^^^^----------^ | ^^^^^----------^
@ -54,7 +54,7 @@ LL | drop(reference1);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:20:5 --> $DIR/dropping_references.rs:20:5
| |
LL | drop(reference2); LL | drop(reference2);
| ^^^^^----------^ | ^^^^^----------^
@ -64,7 +64,7 @@ LL | drop(reference2);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:23:5 --> $DIR/dropping_references.rs:23:5
| |
LL | drop(reference3); LL | drop(reference3);
| ^^^^^----------^ | ^^^^^----------^
@ -74,7 +74,7 @@ LL | drop(reference3);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:28:5 --> $DIR/dropping_references.rs:28:5
| |
LL | drop(&val); LL | drop(&val);
| ^^^^^----^ | ^^^^^----^
@ -84,7 +84,7 @@ LL | drop(&val);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:36:5 --> $DIR/dropping_references.rs:36:5
| |
LL | std::mem::drop(&SomeStruct); LL | std::mem::drop(&SomeStruct);
| ^^^^^^^^^^^^^^^-----------^ | ^^^^^^^^^^^^^^^-----------^
@ -94,7 +94,7 @@ LL | std::mem::drop(&SomeStruct);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:91:13 --> $DIR/dropping_references.rs:91:13
| |
LL | drop(println_and(&13)); LL | drop(println_and(&13));
| ^^^^^----------------^ | ^^^^^----------------^
@ -104,7 +104,7 @@ LL | drop(println_and(&13));
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:94:14 --> $DIR/dropping_references.rs:94:14
| |
LL | 3 if drop(println_and(&14)) == () => (), LL | 3 if drop(println_and(&14)) == () => (),
| ^^^^^----------------^ | ^^^^^----------------^
@ -114,7 +114,7 @@ LL | 3 if drop(println_and(&14)) == () => (),
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing warning: calls to `std::mem::drop` with a reference instead of an owned value does nothing
--> $DIR/drop_ref.rs:96:14 --> $DIR/dropping_references.rs:96:14
| |
LL | 4 => drop(&2), LL | 4 => drop(&2),
| ^^^^^--^ | ^^^^^--^

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![warn(forget_copy)] #![warn(forgetting_copy_types)]
use std::mem::forget; use std::mem::forget;
use std::vec::Vec; use std::vec::Vec;

View file

@ -1,5 +1,5 @@
warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
--> $DIR/forget_copy.rs:34:5 --> $DIR/forgetting_copy_types.rs:34:5
| |
LL | forget(s1); LL | forget(s1);
| ^^^^^^^--^ | ^^^^^^^--^
@ -8,13 +8,13 @@ LL | forget(s1);
| |
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
note: the lint level is defined here note: the lint level is defined here
--> $DIR/forget_copy.rs:3:9 --> $DIR/forgetting_copy_types.rs:3:9
| |
LL | #![warn(forget_copy)] LL | #![warn(forgetting_copy_types)]
| ^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
--> $DIR/forget_copy.rs:35:5 --> $DIR/forgetting_copy_types.rs:35:5
| |
LL | forget(s2); LL | forget(s2);
| ^^^^^^^--^ | ^^^^^^^--^
@ -24,7 +24,7 @@ LL | forget(s2);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_copy.rs:36:5 --> $DIR/forgetting_copy_types.rs:36:5
| |
LL | forget(s3); LL | forget(s3);
| ^^^^^^^--^ | ^^^^^^^--^
@ -32,10 +32,10 @@ LL | forget(s3);
| argument has type `&SomeStruct` | argument has type `&SomeStruct`
| |
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
= note: `#[warn(forget_ref)]` on by default = note: `#[warn(forgetting_references)]` on by default
warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing warning: calls to `std::mem::forget` with a value that implements `Copy` does nothing
--> $DIR/forget_copy.rs:37:5 --> $DIR/forgetting_copy_types.rs:37:5
| |
LL | forget(s4); LL | forget(s4);
| ^^^^^^^--^ | ^^^^^^^--^
@ -45,7 +45,7 @@ LL | forget(s4);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_copy.rs:38:5 --> $DIR/forgetting_copy_types.rs:38:5
| |
LL | forget(s5); LL | forget(s5);
| ^^^^^^^--^ | ^^^^^^^--^
@ -55,7 +55,7 @@ LL | forget(s5);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_copy.rs:50:5 --> $DIR/forgetting_copy_types.rs:50:5
| |
LL | forget(a2); LL | forget(a2);
| ^^^^^^^--^ | ^^^^^^^--^
@ -65,7 +65,7 @@ LL | forget(a2);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_copy.rs:52:5 --> $DIR/forgetting_copy_types.rs:52:5
| |
LL | forget(a3); LL | forget(a3);
| ^^^^^^^--^ | ^^^^^^^--^
@ -75,7 +75,7 @@ LL | forget(a3);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_copy.rs:53:5 --> $DIR/forgetting_copy_types.rs:53:5
| |
LL | forget(a4); LL | forget(a4);
| ^^^^^^^--^ | ^^^^^^^--^

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![warn(forget_ref)] #![warn(forgetting_references)]
use std::mem::forget; use std::mem::forget;

View file

@ -1,5 +1,5 @@
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:10:5 --> $DIR/forgetting_references.rs:10:5
| |
LL | forget(&SomeStruct); LL | forget(&SomeStruct);
| ^^^^^^^-----------^ | ^^^^^^^-----------^
@ -8,13 +8,13 @@ LL | forget(&SomeStruct);
| |
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
note: the lint level is defined here note: the lint level is defined here
--> $DIR/forget_ref.rs:3:9 --> $DIR/forgetting_references.rs:3:9
| |
LL | #![warn(forget_ref)] LL | #![warn(forgetting_references)]
| ^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:13:5 --> $DIR/forgetting_references.rs:13:5
| |
LL | forget(&owned); LL | forget(&owned);
| ^^^^^^^------^ | ^^^^^^^------^
@ -24,7 +24,7 @@ LL | forget(&owned);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:14:5 --> $DIR/forgetting_references.rs:14:5
| |
LL | forget(&&owned); LL | forget(&&owned);
| ^^^^^^^-------^ | ^^^^^^^-------^
@ -34,7 +34,7 @@ LL | forget(&&owned);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:15:5 --> $DIR/forgetting_references.rs:15:5
| |
LL | forget(&mut owned); LL | forget(&mut owned);
| ^^^^^^^----------^ | ^^^^^^^----------^
@ -44,7 +44,7 @@ LL | forget(&mut owned);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:19:5 --> $DIR/forgetting_references.rs:19:5
| |
LL | forget(&*reference1); LL | forget(&*reference1);
| ^^^^^^^------------^ | ^^^^^^^------------^
@ -54,7 +54,7 @@ LL | forget(&*reference1);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:22:5 --> $DIR/forgetting_references.rs:22:5
| |
LL | forget(reference2); LL | forget(reference2);
| ^^^^^^^----------^ | ^^^^^^^----------^
@ -64,7 +64,7 @@ LL | forget(reference2);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:25:5 --> $DIR/forgetting_references.rs:25:5
| |
LL | forget(reference3); LL | forget(reference3);
| ^^^^^^^----------^ | ^^^^^^^----------^
@ -74,7 +74,7 @@ LL | forget(reference3);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:30:5 --> $DIR/forgetting_references.rs:30:5
| |
LL | forget(&val); LL | forget(&val);
| ^^^^^^^----^ | ^^^^^^^----^
@ -84,7 +84,7 @@ LL | forget(&val);
= note: use `let _ = ...` to ignore the expression or result = note: use `let _ = ...` to ignore the expression or result
warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing warning: calls to `std::mem::forget` with a reference instead of an owned value does nothing
--> $DIR/forget_ref.rs:38:5 --> $DIR/forgetting_references.rs:38:5
| |
LL | std::mem::forget(&SomeStruct); LL | std::mem::forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^-----------^ | ^^^^^^^^^^^^^^^^^-----------^

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,8 +2,8 @@
// Test `@` patterns combined with `box` patterns. // Test `@` patterns combined with `box` patterns.
#![allow(drop_ref)] #![allow(dropping_references)]
#![allow(drop_copy)] #![allow(dropping_copy_types)]
#![feature(box_patterns)] #![feature(box_patterns)]

View file

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

View file

@ -1,6 +1,6 @@
// check-pass // check-pass
#![allow(drop_ref)] #![allow(dropping_references)]
fn main() {} fn main() {}

View file

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

View file

@ -3,7 +3,7 @@
// build-pass // build-pass
// ignore-pass // ignore-pass
#![allow(drop_copy)] #![allow(dropping_copy_types)]
async fn wait() {} async fn wait() {}

View file

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

View file

@ -3,7 +3,7 @@
// check-pass // check-pass
#![allow(drop_copy)] #![allow(dropping_copy_types)]
use std::marker::PhantomData; use std::marker::PhantomData;

View file

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

View file

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

View file

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

View file

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

View file

@ -12,7 +12,7 @@
// //
// In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!" // In regular builds, the bad cast was UB, like "Invalid LLVMRustVisibility value!"
#![allow(drop_copy)] #![allow(dropping_copy_types)]
pub mod before { pub mod before {
#[no_mangle] #[no_mangle]

View file

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

View file

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

View file

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

View file

@ -2,7 +2,7 @@
// Check tautalogically false `Copy` bounds // Check tautalogically false `Copy` bounds
#![feature(trivial_bounds)] #![feature(trivial_bounds)]
#![allow(drop_ref, drop_copy)] #![allow(dropping_references, dropping_copy_types)]
fn copy_string(t: String) -> String where String: Copy { //~ WARNING trivial_bounds fn copy_string(t: String) -> String where String: Copy { //~ WARNING trivial_bounds
is_copy(&t); is_copy(&t);