diff --git a/src/librustc_middle/ty/print/pretty.rs b/src/librustc_middle/ty/print/pretty.rs index 84360b90470b7..3bf067ebf1fe2 100644 --- a/src/librustc_middle/ty/print/pretty.rs +++ b/src/librustc_middle/ty/print/pretty.rs @@ -639,9 +639,7 @@ pub trait PrettyPrinter<'tcx>: } } } else { - // Cross-crate closure types should only be - // visible in codegen bug reports, I imagine. - p!(write("@{:?}", did)); + p!(write("@{}", self.tcx().def_path_str(did))); if substs.as_generator().is_valid() { let upvar_tys = substs.as_generator().upvar_tys(); @@ -689,9 +687,7 @@ pub trait PrettyPrinter<'tcx>: } } } else { - // Cross-crate closure types should only be - // visible in codegen bug reports, I imagine. - p!(write("@{:?}", did)); + p!(write("@{}", self.tcx().def_path_str(did))); if substs.as_closure().is_valid() { let upvar_tys = substs.as_closure().upvar_tys(); diff --git a/src/librustc_passes/dead.rs b/src/librustc_passes/dead.rs index e3dd4ddee06ca..c07087db607cc 100644 --- a/src/librustc_passes/dead.rs +++ b/src/librustc_passes/dead.rs @@ -255,7 +255,9 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> { hir::ExprKind::Field(ref lhs, ..) => { self.handle_field_access(&lhs, expr.hir_id); } - hir::ExprKind::Struct(_, ref fields, _) => { + hir::ExprKind::Struct(ref qpath, ref fields, _) => { + let res = self.tables.qpath_res(qpath, expr.hir_id); + self.handle_res(res); if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).kind { self.mark_as_used_if_union(adt, fields); } diff --git a/src/test/ui/async-await/issues/issue-67893.rs b/src/test/ui/async-await/issues/issue-67893.rs index d52303ac1cec6..9679e3807b629 100644 --- a/src/test/ui/async-await/issues/issue-67893.rs +++ b/src/test/ui/async-await/issues/issue-67893.rs @@ -1,7 +1,5 @@ // aux-build: issue_67893.rs // edition:2018 -// dont-check-compiler-stderr -// FIXME(#71222): Add above flag because of the difference of stderrs on some env. extern crate issue_67893; diff --git a/src/test/ui/async-await/issues/issue-67893.stderr b/src/test/ui/async-await/issues/issue-67893.stderr new file mode 100644 index 0000000000000..343a35a1663ac --- /dev/null +++ b/src/test/ui/async-await/issues/issue-67893.stderr @@ -0,0 +1,24 @@ +error[E0277]: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely + --> $DIR/issue-67893.rs:9:5 + | +LL | fn g(_: impl Send) {} + | ---- required by this bound in `g` +... +LL | g(issue_67893::run()) + | ^ `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely + | + ::: $DIR/auxiliary/issue_67893.rs:7:20 + | +LL | pub async fn run() { + | - within this `impl std::future::Future` + | + = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, ()>` + = note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc>, &'r std::sync::Mutex<()>, std::result::Result, std::sync::PoisonError>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}` + = note: required because it appears within the type `[static generator@issue_67893::run::{{closure}}#0 for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc>, &'r std::sync::Mutex<()>, std::result::Result, std::sync::PoisonError>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}]` + = note: required because it appears within the type `std::future::from_generator::GenFuture<[static generator@issue_67893::run::{{closure}}#0 for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc>, &'r std::sync::Mutex<()>, std::result::Result, std::sync::PoisonError>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}]>` + = note: required because it appears within the type `impl std::future::Future` + = note: required because it appears within the type `impl std::future::Future` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/consts/array-literal-index-oob.rs b/src/test/ui/consts/array-literal-index-oob.rs index 492afa9372c62..f36ebf38db4fe 100644 --- a/src/test/ui/consts/array-literal-index-oob.rs +++ b/src/test/ui/consts/array-literal-index-oob.rs @@ -1,5 +1,5 @@ // build-pass -// ignore-pass (emit codegen-time warnings and verify that they are indeed warnings and not errors) +// ignore-pass (test emits codegen-time warnings and verifies that they are not errors) #![warn(const_err, unconditional_panic)] diff --git a/src/test/ui/consts/const-eval/promoted_errors.rs b/src/test/ui/consts/const-eval/promoted_errors.rs index 3ab6ce28478c3..142ce75eebc80 100644 --- a/src/test/ui/consts/const-eval/promoted_errors.rs +++ b/src/test/ui/consts/const-eval/promoted_errors.rs @@ -4,7 +4,7 @@ //[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O // build-pass -// ignore-pass (emit codegen-time warnings and verify that they are indeed warnings and not errors) +// ignore-pass (test emits codegen-time warnings and verifies that they are not errors) #![warn(const_err, arithmetic_overflow, unconditional_panic)] diff --git a/src/test/ui/consts/miri_unleashed/inline_asm.rs b/src/test/ui/consts/miri_unleashed/inline_asm.rs new file mode 100644 index 0000000000000..f56131025627b --- /dev/null +++ b/src/test/ui/consts/miri_unleashed/inline_asm.rs @@ -0,0 +1,14 @@ +// compile-flags: -Zunleash-the-miri-inside-of-you +// only-x86_64 +#![feature(llvm_asm)] +#![allow(const_err)] + +fn main() {} + +// Make sure we catch executing inline assembly. +static TEST_BAD: () = { + unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); } + //~^ ERROR could not evaluate static initializer + //~| NOTE in this expansion of llvm_asm! + //~| NOTE inline assembly is not supported +}; diff --git a/src/test/ui/consts/miri_unleashed/inline_asm.stderr b/src/test/ui/consts/miri_unleashed/inline_asm.stderr new file mode 100644 index 0000000000000..3cbdd326c8233 --- /dev/null +++ b/src/test/ui/consts/miri_unleashed/inline_asm.stderr @@ -0,0 +1,11 @@ +error[E0080]: could not evaluate static initializer + --> $DIR/inline_asm.rs:10:14 + | +LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inline assembly is not supported + | + = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/lint/dead-code/lint-dead-code-5.rs b/src/test/ui/lint/dead-code/lint-dead-code-5.rs index 764a23e4e49e9..b477c97c5457b 100644 --- a/src/test/ui/lint/dead-code/lint-dead-code-5.rs +++ b/src/test/ui/lint/dead-code/lint-dead-code-5.rs @@ -13,6 +13,23 @@ enum Enum2 { Variant5 { _x: isize }, //~ ERROR: variant is never constructed: `Variant5` Variant6(isize), //~ ERROR: variant is never constructed: `Variant6` _Variant7, + Variant8 { _field: bool }, + Variant9, + Variant10(usize) +} + +impl Enum2 { + fn new_variant8() -> Enum2 { + Self::Variant8 { _field: true } + } + + fn new_variant9() -> Enum2 { + Self::Variant9 + } + + fn new_variant10() -> Enum2 { + Self::Variant10(10) + } } enum Enum3 { //~ ERROR: enum is never used @@ -27,4 +44,7 @@ fn main() { Enum1::Variant2 => () } let x = Enum2::Variant3(true); + let _ = Enum2::new_variant8(); + let _ = Enum2::new_variant9(); + let _ = Enum2::new_variant10(); } diff --git a/src/test/ui/lint/dead-code/lint-dead-code-5.stderr b/src/test/ui/lint/dead-code/lint-dead-code-5.stderr index c0de469102077..519add826273f 100644 --- a/src/test/ui/lint/dead-code/lint-dead-code-5.stderr +++ b/src/test/ui/lint/dead-code/lint-dead-code-5.stderr @@ -23,7 +23,7 @@ LL | Variant6(isize), | ^^^^^^^^^^^^^^^ error: enum is never used: `Enum3` - --> $DIR/lint-dead-code-5.rs:18:6 + --> $DIR/lint-dead-code-5.rs:35:6 | LL | enum Enum3 { | ^^^^^ diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.rs b/src/test/ui/lint/lint-exceeding-bitshifts.rs index 5d0cfd3ab7880..47e934baf25f7 100644 --- a/src/test/ui/lint/lint-exceeding-bitshifts.rs +++ b/src/test/ui/lint/lint-exceeding-bitshifts.rs @@ -2,8 +2,8 @@ //[noopt]compile-flags: -C opt-level=0 //[opt]compile-flags: -O //[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O - // build-pass +// ignore-pass (test emits codegen-time warnings and verifies that they are not errors) #![crate_type="lib"] #![warn(arithmetic_overflow, const_err)]