diff --git a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs index 9db5233e21e57..ceca54b7cd75f 100644 --- a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs +++ b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(associated_type_bounds)] diff --git a/src/test/ui/associated-type-bounds/fn-apit.rs b/src/test/ui/associated-type-bounds/fn-apit.rs index 7e208b4e70d81..3c9f511338f69 100644 --- a/src/test/ui/associated-type-bounds/fn-apit.rs +++ b/src/test/ui/associated-type-bounds/fn-apit.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-dyn-apit.rs b/src/test/ui/associated-type-bounds/fn-dyn-apit.rs index 9ff4a50e1e6e4..c4e8092c211d6 100644 --- a/src/test/ui/associated-type-bounds/fn-dyn-apit.rs +++ b/src/test/ui/associated-type-bounds/fn-dyn-apit.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-dyn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_dyn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-inline.rs b/src/test/ui/associated-type-bounds/fn-inline.rs index 7b188763b7a5e..8fa7212d6275b 100644 --- a/src/test/ui/associated-type-bounds/fn-inline.rs +++ b/src/test/ui/associated-type-bounds/fn-inline.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-where.rs b/src/test/ui/associated-type-bounds/fn-where.rs index 60d7149a56f25..9c4f82ac991c8 100644 --- a/src/test/ui/associated-type-bounds/fn-where.rs +++ b/src/test/ui/associated-type-bounds/fn-where.rs @@ -1,6 +1,7 @@ // run-pass // aux-build:fn-aux.rs +#![allow(unused)] #![feature(associated_type_bounds)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/fn-wrap-apit.rs b/src/test/ui/associated-type-bounds/fn-wrap-apit.rs index 23790d416e1f7..96df13e372a24 100644 --- a/src/test/ui/associated-type-bounds/fn-wrap-apit.rs +++ b/src/test/ui/associated-type-bounds/fn-wrap-apit.rs @@ -2,6 +2,7 @@ // aux-build:fn-aux.rs #![feature(associated_type_bounds)] +#![allow(dead_code)] extern crate fn_aux; diff --git a/src/test/ui/associated-type-bounds/struct-bounds.rs b/src/test/ui/associated-type-bounds/struct-bounds.rs index 2d189cd66724a..2c1ce1c3785ae 100644 --- a/src/test/ui/associated-type-bounds/struct-bounds.rs +++ b/src/test/ui/associated-type-bounds/struct-bounds.rs @@ -1,5 +1,6 @@ // run-pass +#![allow(unused)] #![feature(associated_type_bounds)] trait Tr1 { type As1; } diff --git a/src/test/ui/async-await/argument-patterns.rs b/src/test/ui/async-await/argument-patterns.rs index 0e42f48b8351e..b9fc1a88cee13 100644 --- a/src/test/ui/async-await/argument-patterns.rs +++ b/src/test/ui/async-await/argument-patterns.rs @@ -1,7 +1,6 @@ // edition:2018 -// run-pass +// check-pass -#![allow(unused_variables)] #![deny(unused_mut)] type A = Vec; diff --git a/src/test/ui/async-await/async-await.rs b/src/test/ui/async-await/async-await.rs index bf8bf0bcce0fe..1dc7315e88c11 100644 --- a/src/test/ui/async-await/async-await.rs +++ b/src/test/ui/async-await/async-await.rs @@ -1,5 +1,7 @@ // run-pass +#![allow(unused)] + // edition:2018 // aux-build:arc_wake.rs diff --git a/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs b/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs index 5d020c9a52601..15cc9fbc81fb7 100644 --- a/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs +++ b/src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs @@ -3,6 +3,9 @@ // run-pass #![deny(dead_code)] +#![allow(unused_variables)] +#![allow(unused_must_use)] +#![allow(path_statements)] // Test that the drop order for locals in a fn and async fn matches up. extern crate arc_wake; @@ -10,7 +13,6 @@ extern crate arc_wake; use arc_wake::ArcWake; use std::cell::RefCell; use std::future::Future; -use std::marker::PhantomData; use std::pin::Pin; use std::rc::Rc; use std::sync::Arc; @@ -42,7 +44,7 @@ struct NeverReady; impl Future for NeverReady { type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { Poll::Pending } } diff --git a/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs b/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs index 84fe79348c601..9e8304935bffc 100644 --- a/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs +++ b/src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs @@ -6,6 +6,8 @@ // parameters (used or unused) are not dropped until the async fn is cancelled. // This file is mostly copy-pasted from drop-order-for-async-fn-parameters.rs +#![allow(unused_variables)] + extern crate arc_wake; use arc_wake::ArcWake; @@ -43,7 +45,7 @@ struct NeverReady; impl Future for NeverReady { type Output = (); - fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll { + fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll { Poll::Pending } } diff --git a/src/test/ui/async-await/issues/issue-54752-async-block.stderr b/src/test/ui/async-await/issues/issue-54752-async-block.stderr new file mode 100644 index 0000000000000..c3b3392cfc495 --- /dev/null +++ b/src/test/ui/async-await/issues/issue-54752-async-block.stderr @@ -0,0 +1,8 @@ +warning: unnecessary parentheses around assigned value + --> $DIR/issue-54752-async-block.rs:6:22 + | +LL | fn main() { let _a = (async { }); } + | ^^^^^^^^^^^^ help: remove these parentheses + | + = note: `#[warn(unused_parens)]` on by default + diff --git a/src/test/ui/async-await/issues/issue-59972.rs b/src/test/ui/async-await/issues/issue-59972.rs index 154226e8bb88f..c2e24a96b1d93 100644 --- a/src/test/ui/async-await/issues/issue-59972.rs +++ b/src/test/ui/async-await/issues/issue-59972.rs @@ -4,7 +4,7 @@ // run-pass -// compile-flags: --edition=2018 +// compile-flags: --edition=2018 -Aunused pub enum Uninhabited { } diff --git a/src/test/ui/async-await/multiple-lifetimes/hrtb.rs b/src/test/ui/async-await/multiple-lifetimes/hrtb.rs index 31d0736ba63c8..e788ca5ff49c3 100644 --- a/src/test/ui/async-await/multiple-lifetimes/hrtb.rs +++ b/src/test/ui/async-await/multiple-lifetimes/hrtb.rs @@ -1,5 +1,5 @@ // edition:2018 -// run-pass +// check-pass // Test that we can use async fns with multiple arbitrary lifetimes. diff --git a/src/test/ui/borrowck/borrowck-migrate-to-nll.rs b/src/test/ui/borrowck/borrowck-migrate-to-nll.rs index 98fd5682277b3..6587dfdbc03f3 100644 --- a/src/test/ui/borrowck/borrowck-migrate-to-nll.rs +++ b/src/test/ui/borrowck/borrowck-migrate-to-nll.rs @@ -17,7 +17,7 @@ // revisions: zflag edition //[zflag]compile-flags: -Z borrowck=migrate //[edition]edition:2018 -//[zflag] run-pass +//[zflag] check-pass pub struct Block<'a> { current: &'a u8, diff --git a/src/test/ui/borrowck/issue-10876.rs b/src/test/ui/borrowck/issue-10876.rs index 20ab905fec46e..22eaa119f2467 100644 --- a/src/test/ui/borrowck/issue-10876.rs +++ b/src/test/ui/borrowck/issue-10876.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass enum Nat { S(Box), diff --git a/src/test/ui/borrowck/two-phase-multiple-activations.rs b/src/test/ui/borrowck/two-phase-multiple-activations.rs index a7fa7fac13e73..599138a9ce0f1 100644 --- a/src/test/ui/borrowck/two-phase-multiple-activations.rs +++ b/src/test/ui/borrowck/two-phase-multiple-activations.rs @@ -11,7 +11,7 @@ pub trait FakeRead { } impl FakeRead for Foo { - fn read_to_end(&mut self, buf: &mut Vec) -> Result { + fn read_to_end(&mut self, _buf: &mut Vec) -> Result { Ok(4) } } @@ -19,5 +19,5 @@ impl FakeRead for Foo { fn main() { let mut a = Foo {}; let mut v = Vec::new(); - a.read_to_end(&mut v); + a.read_to_end(&mut v).unwrap(); } diff --git a/src/test/ui/const-generics/apit-with-const-param.rs b/src/test/ui/const-generics/apit-with-const-param.rs index 70e718d889029..7acc50819a6ad 100644 --- a/src/test/ui/const-generics/apit-with-const-param.rs +++ b/src/test/ui/const-generics/apit-with-const-param.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash diff --git a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs index d83846fcf88d4..2d1a405ebdd80 100644 --- a/src/test/ui/const-generics/array-wrapper-struct-ctor.rs +++ b/src/test/ui/const-generics/array-wrapper-struct-ctor.rs @@ -3,6 +3,8 @@ #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash +#![allow(dead_code)] + struct ArrayStruct { data: [T; N], } diff --git a/src/test/ui/const-generics/const-types.rs b/src/test/ui/const-generics/const-types.rs index 11757cd588dab..bc5188133d7f1 100644 --- a/src/test/ui/const-generics/const-types.rs +++ b/src/test/ui/const-generics/const-types.rs @@ -3,7 +3,7 @@ #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash -#[allow(dead_code)] +#![allow(dead_code, unused_variables)] struct ConstArray { array: [T; LEN], diff --git a/src/test/ui/const-generics/issue-61422.rs b/src/test/ui/const-generics/issue-61422.rs index 68e5a52e0ac5c..45d37b6a2f3c5 100644 --- a/src/test/ui/const-generics/issue-61422.rs +++ b/src/test/ui/const-generics/issue-61422.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash @@ -8,7 +8,7 @@ use std::mem; fn foo() { let arr: [u8; SIZE] = unsafe { #[allow(deprecated)] - let mut array: [u8; SIZE] = mem::uninitialized(); + let array: [u8; SIZE] = mem::uninitialized(); array }; } diff --git a/src/test/ui/const-generics/unused-const-param.rs b/src/test/ui/const-generics/unused-const-param.rs index ee98e5eb4a01f..8025b3af8f1bf 100644 --- a/src/test/ui/const-generics/unused-const-param.rs +++ b/src/test/ui/const-generics/unused-const-param.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(const_generics)] //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash diff --git a/src/test/ui/consts/const-eval/const_transmute.rs b/src/test/ui/consts/const-eval/const_transmute.rs index 4a7d8490ef25f..f0e1d8263022b 100644 --- a/src/test/ui/consts/const-eval/const_transmute.rs +++ b/src/test/ui/consts/const-eval/const_transmute.rs @@ -1,6 +1,7 @@ // run-pass #![feature(const_fn_union)] +#![allow(dead_code)] #[repr(C)] union Transmute { diff --git a/src/test/ui/consts/const-labeled-break.rs b/src/test/ui/consts/const-labeled-break.rs index 36e308ade9c54..7cdbb22f92459 100644 --- a/src/test/ui/consts/const-labeled-break.rs +++ b/src/test/ui/consts/const-labeled-break.rs @@ -1,4 +1,4 @@ -// run-pass +// build-pass // Using labeled break in a while loop has caused an illegal instruction being // generated, and an ICE later. diff --git a/src/test/ui/consts/packed_pattern.stderr b/src/test/ui/consts/packed_pattern.stderr new file mode 100644 index 0000000000000..9b7daf2e674fb --- /dev/null +++ b/src/test/ui/consts/packed_pattern.stderr @@ -0,0 +1,8 @@ +warning: unreachable pattern + --> $DIR/packed_pattern.rs:16:9 + | +LL | FOO => unreachable!(), + | ^^^ + | + = note: `#[warn(unreachable_patterns)]` on by default + diff --git a/src/test/ui/consts/packed_pattern2.stderr b/src/test/ui/consts/packed_pattern2.stderr new file mode 100644 index 0000000000000..6cc0225d3043d --- /dev/null +++ b/src/test/ui/consts/packed_pattern2.stderr @@ -0,0 +1,8 @@ +warning: unreachable pattern + --> $DIR/packed_pattern2.rs:24:9 + | +LL | FOO => unreachable!(), + | ^^^ + | + = note: `#[warn(unreachable_patterns)]` on by default + diff --git a/src/test/ui/deprecation/deprecation-in-future.rs b/src/test/ui/deprecation/deprecation-in-future.rs index c4f9fdce74907..464ddcc4cdb94 100644 --- a/src/test/ui/deprecation/deprecation-in-future.rs +++ b/src/test/ui/deprecation/deprecation-in-future.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![deny(deprecated_in_future)] diff --git a/src/test/ui/drop/dynamic-drop-async.rs b/src/test/ui/drop/dynamic-drop-async.rs index 79d09d1817601..91063edf0f6c4 100644 --- a/src/test/ui/drop/dynamic-drop-async.rs +++ b/src/test/ui/drop/dynamic-drop-async.rs @@ -8,6 +8,7 @@ // ignore-wasm32-bare compiled with panic=abort by default #![feature(slice_patterns)] +#![allow(unused)] use std::{ cell::{Cell, RefCell}, diff --git a/src/test/ui/hrtb/issue-57639.rs b/src/test/ui/hrtb/issue-57639.rs index 4bcaef3616bd5..392e7233b567a 100644 --- a/src/test/ui/hrtb/issue-57639.rs +++ b/src/test/ui/hrtb/issue-57639.rs @@ -10,7 +10,7 @@ // // See [this comment on GitHub][c] for more details. // -// run-pass +// check-pass // // [c]: https://github.com/rust-lang/rust/issues/57639#issuecomment-455685861 diff --git a/src/test/ui/if-ret.stderr b/src/test/ui/if-ret.stderr new file mode 100644 index 0000000000000..73402e55a4fd8 --- /dev/null +++ b/src/test/ui/if-ret.stderr @@ -0,0 +1,8 @@ +warning: unreachable block in `if` expression + --> $DIR/if-ret.rs:6:24 + | +LL | fn foo() { if (return) { } } + | ^^^ + | + = note: `#[warn(unreachable_code)]` on by default + diff --git a/src/test/ui/impl-trait/closure-calling-parent-fn.rs b/src/test/ui/impl-trait/closure-calling-parent-fn.rs index 58d7875ccd034..9dab334a217c2 100644 --- a/src/test/ui/impl-trait/closure-calling-parent-fn.rs +++ b/src/test/ui/impl-trait/closure-calling-parent-fn.rs @@ -5,7 +5,7 @@ // `foo` and hence is treated opaquely within the closure body. This // resulted in a failed subtype relationship. // -// run-pass +// check-pass fn foo() -> impl Copy { || foo(); } fn bar() -> impl Copy { || bar(); } diff --git a/src/test/ui/impl-trait/issues/issue-53457.rs b/src/test/ui/impl-trait/issues/issue-53457.rs index de8c579743fc0..3f97502492506 100644 --- a/src/test/ui/impl-trait/issues/issue-53457.rs +++ b/src/test/ui/impl-trait/issues/issue-53457.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![feature(type_alias_impl_trait)] @@ -9,7 +9,7 @@ fn bar(f: F) -> F { } fn foo() -> X { - bar(|x| ()) + bar(|_| ()) } fn main() {} diff --git a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs index 2da3886bb552b..3911769b0c63d 100644 --- a/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs +++ b/src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs @@ -1,5 +1,5 @@ // edition:2018 -// run-pass +// check-pass // revisions: migrate mir //[mir]compile-flags: -Z borrowck=mir diff --git a/src/test/ui/impl-trait/needs_least_region_or_bound.rs b/src/test/ui/impl-trait/needs_least_region_or_bound.rs index 52475f65a8353..3c8682bb62aa5 100644 --- a/src/test/ui/impl-trait/needs_least_region_or_bound.rs +++ b/src/test/ui/impl-trait/needs_least_region_or_bound.rs @@ -1,9 +1,7 @@ -// run-pass +// check-pass #![feature(member_constraints)] -use std::fmt::Debug; - trait MultiRegionTrait<'a, 'b> {} impl<'a, 'b> MultiRegionTrait<'a, 'b> for (&'a u32, &'b u32) {} diff --git a/src/test/ui/issues/issue-26448-2.rs b/src/test/ui/issues/issue-26448-2.rs index 17e7c1f977a6d..c60e06c3ceb35 100644 --- a/src/test/ui/issues/issue-26448-2.rs +++ b/src/test/ui/issues/issue-26448-2.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass pub struct Bar { items: Vec<&'static str>, diff --git a/src/test/ui/issues/issue-26448-3.rs b/src/test/ui/issues/issue-26448-3.rs index e57352e57f4fc..d48022c09fee3 100644 --- a/src/test/ui/issues/issue-26448-3.rs +++ b/src/test/ui/issues/issue-26448-3.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass pub struct Item { _inner: &'static str, diff --git a/src/test/ui/issues/issue-27697.rs b/src/test/ui/issues/issue-27697.rs index 83070012f5f04..12af8a8e875af 100644 --- a/src/test/ui/issues/issue-27697.rs +++ b/src/test/ui/issues/issue-27697.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass use std::ops::Deref; diff --git a/src/test/ui/issues/issue-38591.rs b/src/test/ui/issues/issue-38591.rs index 7aa71f8b9eb9b..2f594b48e697f 100644 --- a/src/test/ui/issues/issue-38591.rs +++ b/src/test/ui/issues/issue-38591.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass struct S { t : T, diff --git a/src/test/ui/issues/issue-43806.rs b/src/test/ui/issues/issue-43806.rs index cbfbfa35afbd9..8c8cccfb2bb82 100644 --- a/src/test/ui/issues/issue-43806.rs +++ b/src/test/ui/issues/issue-43806.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass #![deny(unused_results)] diff --git a/src/test/ui/issues/issue-48132.rs b/src/test/ui/issues/issue-48132.rs index ea325ea695f66..f564aefe78ced 100644 --- a/src/test/ui/issues/issue-48132.rs +++ b/src/test/ui/issues/issue-48132.rs @@ -3,6 +3,8 @@ // run-pass +#![allow(dead_code)] + struct Inner { iterator: I, item: V, diff --git a/src/test/ui/issues/issue-48179.rs b/src/test/ui/issues/issue-48179.rs index 90e9858d74197..f81203dc41299 100644 --- a/src/test/ui/issues/issue-48179.rs +++ b/src/test/ui/issues/issue-48179.rs @@ -1,7 +1,7 @@ // Regression test for #48132. This was failing due to problems around // the projection caching and dropck type enumeration. -// run-pass +// check-pass pub struct Container { value: Option, diff --git a/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs b/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs index 8fc09c89f786b..de7d6a0d80c9e 100644 --- a/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs +++ b/src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs @@ -5,7 +5,7 @@ // aux-build:xcrate-issue-61711-b.rs // compile-flags:--extern xcrate_issue_61711_b -// run-pass +// build-pass fn f(_: F) { } fn main() { } diff --git a/src/test/ui/lint/empty-lint-attributes.rs b/src/test/ui/lint/empty-lint-attributes.rs index 1f0a9538d88b1..9a0ec253322e4 100644 --- a/src/test/ui/lint/empty-lint-attributes.rs +++ b/src/test/ui/lint/empty-lint-attributes.rs @@ -1,6 +1,6 @@ #![feature(lint_reasons)] -// run-pass +// check-pass // Empty (and reason-only) lint attributes are legal—although we may want to // lint them in the future (Issue #55112). diff --git a/src/test/ui/nll/issue-55288.rs b/src/test/ui/nll/issue-55288.rs index c7b6ac5924837..aab2dc267d594 100644 --- a/src/test/ui/nll/issue-55288.rs +++ b/src/test/ui/nll/issue-55288.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass struct Slice(&'static [&'static [u8]]); diff --git a/src/test/ui/nll/issue-57960.rs b/src/test/ui/nll/issue-57960.rs index 1399694a79b6a..32e45184a9195 100644 --- a/src/test/ui/nll/issue-57960.rs +++ b/src/test/ui/nll/issue-57960.rs @@ -30,7 +30,6 @@ fn digits(x: u8) -> u32 { OneDigit::FIRST..=OneDigit::LAST => 1, TwoDigits::FIRST..=TwoDigits::LAST => 2, ThreeDigits::FIRST..=ThreeDigits::LAST => 3, - _ => unreachable!(), } } diff --git a/src/test/ui/nll/normalization-bounds.rs b/src/test/ui/nll/normalization-bounds.rs index 5d2825ef2d670..bb6d981e0133f 100644 --- a/src/test/ui/nll/normalization-bounds.rs +++ b/src/test/ui/nll/normalization-bounds.rs @@ -1,6 +1,6 @@ // Check that lifetime bounds get checked the right way around with NLL enabled. -//run-pass +// check-pass trait Visitor<'d> { type Value; diff --git a/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs b/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs index 6d5bdfa4da2f0..3b06b0db37065 100644 --- a/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs +++ b/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs @@ -1,11 +1,11 @@ // Check that mutable promoted length zero arrays don't check for conflicting // access -// run-pass +// check-pass pub fn main() { let mut x: Vec<&[i32; 0]> = Vec::new(); - for i in 0..10 { + for _ in 0..10 { x.push(&[]); } } diff --git a/src/test/ui/nll/user-annotations/issue-55219.rs b/src/test/ui/nll/user-annotations/issue-55219.rs index 4d18e96cc1543..147413663897d 100644 --- a/src/test/ui/nll/user-annotations/issue-55219.rs +++ b/src/test/ui/nll/user-annotations/issue-55219.rs @@ -3,7 +3,7 @@ // The `Self::HASH_LEN` here expands to a "self-type" where `T` is not // known. This unbound inference variable was causing an ICE. // -// run-pass +// check-pass pub struct Foo(T); diff --git a/src/test/ui/nll/user-annotations/normalize-self-ty.rs b/src/test/ui/nll/user-annotations/normalize-self-ty.rs index a06229a02032a..df905c8786a18 100644 --- a/src/test/ui/nll/user-annotations/normalize-self-ty.rs +++ b/src/test/ui/nll/user-annotations/normalize-self-ty.rs @@ -2,7 +2,7 @@ // the inherent impl requires normalization to be equal to the // user-provided type. // -// run-pass +// check-pass trait Mirror { type Me; @@ -15,7 +15,7 @@ impl Mirror for T { struct Foo(A, B); impl Foo::Me> { - fn m(b: A) { } + fn m(_: A) { } } fn main() { diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs index e43c8541e6d6d..041e410df85c9 100644 --- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs +++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs @@ -11,8 +11,8 @@ use std::sync::mpsc::channel; fn main() { let (tx, rx) = channel(); let x = Some(rx); - tx.send(false); - tx.send(false); + tx.send(false).unwrap(); + tx.send(false).unwrap(); match x { Some(z) if z.recv().unwrap() => { panic!() }, Some(z) => { assert!(!z.recv().unwrap()); }, diff --git a/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs index 470a5ea9833ad..fe7df44590b8d 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/variants_same_crate.rs @@ -10,11 +10,11 @@ pub enum NonExhaustiveVariants { fn main() { let variant_tuple = NonExhaustiveVariants::Tuple(340); - let variant_struct = NonExhaustiveVariants::Struct { field: 340 }; + let _variant_struct = NonExhaustiveVariants::Struct { field: 340 }; match variant_tuple { NonExhaustiveVariants::Unit => "", - NonExhaustiveVariants::Tuple(fe_tpl) => "", - NonExhaustiveVariants::Struct { field } => "" + NonExhaustiveVariants::Tuple(_fe_tpl) => "", + NonExhaustiveVariants::Struct { field: _ } => "" }; } diff --git a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs index 1de4e5bcebee9..b95105b59eddb 100644 --- a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs +++ b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.rs @@ -2,8 +2,6 @@ #![allow(irrefutable_let_patterns)] -use std::ops::Range; - fn main() { let x: bool; // This should associate as: `(x = (true && false));`. diff --git a/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr new file mode 100644 index 0000000000000..be7ef658411e1 --- /dev/null +++ b/src/test/ui/rfc-2497-if-let-chains/protect-precedences.stderr @@ -0,0 +1,8 @@ +warning: unreachable block in `if` expression + --> $DIR/protect-precedences.rs:13:41 + | +LL | if let _ = return true && false {}; + | ^^ + | + = note: `#[warn(unreachable_code)]` on by default + diff --git a/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs b/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs index fb26b7e2df7cb..1440f02df1df8 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs +++ b/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs @@ -1,4 +1,4 @@ -// run-pass +// check-pass // This test checks that trait objects involving trait aliases are well-formed. diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs index 0c212096f9234..19fcc78721ab1 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs +++ b/src/test/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs @@ -9,13 +9,13 @@ #![allow(irrefutable_let_patterns)] -enum Enum { TSVariant(T), SVariant { v: T }, UVariant } +enum Enum { TSVariant(T), SVariant { _v: T }, UVariant } type Alias = Enum; type AliasFixed = Enum<()>; macro_rules! is_variant { (TSVariant, $expr:expr) => (is_variant!(@check TSVariant, (_), $expr)); - (SVariant, $expr:expr) => (is_variant!(@check SVariant, { v: _ }, $expr)); + (SVariant, $expr:expr) => (is_variant!(@check SVariant, { _v: _ }, $expr)); (UVariant, $expr:expr) => (is_variant!(@check UVariant, {}, $expr)); (@check $variant:ident, $matcher:tt, $expr:expr) => ( assert!(if let Enum::$variant::<()> $matcher = $expr { true } else { false }, @@ -37,14 +37,14 @@ fn main() { // Struct variant - is_variant!(SVariant, Enum::SVariant { v: () }); - is_variant!(SVariant, Enum::SVariant::<()> { v: () }); - is_variant!(SVariant, Enum::<()>::SVariant { v: () }); + is_variant!(SVariant, Enum::SVariant { _v: () }); + is_variant!(SVariant, Enum::SVariant::<()> { _v: () }); + is_variant!(SVariant, Enum::<()>::SVariant { _v: () }); - is_variant!(SVariant, Alias::SVariant { v: () }); - is_variant!(SVariant, Alias::<()>::SVariant { v: () }); + is_variant!(SVariant, Alias::SVariant { _v: () }); + is_variant!(SVariant, Alias::<()>::SVariant { _v: () }); - is_variant!(SVariant, AliasFixed::SVariant { v: () }); + is_variant!(SVariant, AliasFixed::SVariant { _v: () }); // Unit variant diff --git a/src/test/ui/while-let.rs b/src/test/ui/while-let.rs index 69f9de9497740..53babefae81c0 100644 --- a/src/test/ui/while-let.rs +++ b/src/test/ui/while-let.rs @@ -1,5 +1,6 @@ // run-pass +#[allow(dead_code)] fn macros() { macro_rules! foo{ ($p:pat, $e:expr, $b:block) => {{ @@ -12,16 +13,16 @@ fn macros() { }} } - foo!(a, 1, { //~ WARN irrefutable while-let + foo!(_a, 1, { //~ WARN irrefutable while-let println!("irrefutable pattern"); }); - bar!(a, 1, { //~ WARN irrefutable while-let + bar!(_a, 1, { //~ WARN irrefutable while-let println!("irrefutable pattern"); }); } pub fn main() { - while let a = 1 { //~ WARN irrefutable while-let + while let _a = 1 { //~ WARN irrefutable while-let println!("irrefutable pattern"); break; } diff --git a/src/test/ui/while-let.stderr b/src/test/ui/while-let.stderr index 348925aa9702c..30307ecaeadf2 100644 --- a/src/test/ui/while-let.stderr +++ b/src/test/ui/while-let.stderr @@ -1,10 +1,10 @@ warning: irrefutable while-let pattern - --> $DIR/while-let.rs:6:13 + --> $DIR/while-let.rs:7:13 | LL | while let $p = $e $b | ^^^^^ ... -LL | / foo!(a, 1, { +LL | / foo!(_a, 1, { LL | | println!("irrefutable pattern"); LL | | }); | |_______- in this macro invocation @@ -12,20 +12,20 @@ LL | | }); = note: `#[warn(irrefutable_let_patterns)]` on by default warning: irrefutable while-let pattern - --> $DIR/while-let.rs:6:13 + --> $DIR/while-let.rs:7:13 | LL | while let $p = $e $b | ^^^^^ ... -LL | / bar!(a, 1, { +LL | / bar!(_a, 1, { LL | | println!("irrefutable pattern"); LL | | }); | |_______- in this macro invocation warning: irrefutable while-let pattern - --> $DIR/while-let.rs:24:5 + --> $DIR/while-let.rs:25:5 | -LL | / while let a = 1 { +LL | / while let _a = 1 { LL | | println!("irrefutable pattern"); LL | | break; LL | | }