Skip to content

Commit dbf8b6b

Browse files
committedApr 19, 2020
Auto merge of rust-lang#71331 - Dylan-DPC:rollup-5rn1isc, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - rust-lang#71026 (Fix false "never constructed" warnings for `Self::` variant paths) - rust-lang#71310 (Do not show DefId in diagnostics) - rust-lang#71317 (miri-unleash test for llvm_asm) - rust-lang#71324 (Fix some tests failing in `--pass check` mode) Failed merges: r? @ghost
2 parents ad48d52 + 9fc2443 commit dbf8b6b

File tree

11 files changed

+78
-13
lines changed

11 files changed

+78
-13
lines changed
 

‎src/librustc_middle/ty/print/pretty.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,7 @@ pub trait PrettyPrinter<'tcx>:
639639
}
640640
}
641641
} else {
642-
// Cross-crate closure types should only be
643-
// visible in codegen bug reports, I imagine.
644-
p!(write("@{:?}", did));
642+
p!(write("@{}", self.tcx().def_path_str(did)));
645643

646644
if substs.as_generator().is_valid() {
647645
let upvar_tys = substs.as_generator().upvar_tys();
@@ -689,9 +687,7 @@ pub trait PrettyPrinter<'tcx>:
689687
}
690688
}
691689
} else {
692-
// Cross-crate closure types should only be
693-
// visible in codegen bug reports, I imagine.
694-
p!(write("@{:?}", did));
690+
p!(write("@{}", self.tcx().def_path_str(did)));
695691

696692
if substs.as_closure().is_valid() {
697693
let upvar_tys = substs.as_closure().upvar_tys();

‎src/librustc_passes/dead.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
255255
hir::ExprKind::Field(ref lhs, ..) => {
256256
self.handle_field_access(&lhs, expr.hir_id);
257257
}
258-
hir::ExprKind::Struct(_, ref fields, _) => {
258+
hir::ExprKind::Struct(ref qpath, ref fields, _) => {
259+
let res = self.tables.qpath_res(qpath, expr.hir_id);
260+
self.handle_res(res);
259261
if let ty::Adt(ref adt, _) = self.tables.expr_ty(expr).kind {
260262
self.mark_as_used_if_union(adt, fields);
261263
}

‎src/test/ui/async-await/issues/issue-67893.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// aux-build: issue_67893.rs
22
// edition:2018
3-
// dont-check-compiler-stderr
4-
// FIXME(#71222): Add above flag because of the difference of stderrs on some env.
53

64
extern crate issue_67893;
75

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
error[E0277]: `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
2+
--> $DIR/issue-67893.rs:9:5
3+
|
4+
LL | fn g(_: impl Send) {}
5+
| ---- required by this bound in `g`
6+
...
7+
LL | g(issue_67893::run())
8+
| ^ `std::sync::MutexGuard<'_, ()>` cannot be sent between threads safely
9+
|
10+
::: $DIR/auxiliary/issue_67893.rs:7:20
11+
|
12+
LL | pub async fn run() {
13+
| - within this `impl std::future::Future`
14+
|
15+
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::sync::MutexGuard<'_, ()>`
16+
= note: required because it appears within the type `for<'r, 's, 't0, 't1, 't2, 't3> {std::future::ResumeTy, std::sync::Arc<std::sync::Mutex<()>>, &'r std::sync::Mutex<()>, std::result::Result<std::sync::MutexGuard<'s, ()>, std::sync::PoisonError<std::sync::MutexGuard<'t0, ()>>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}`
17+
= 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<std::sync::Mutex<()>>, &'r std::sync::Mutex<()>, std::result::Result<std::sync::MutexGuard<'s, ()>, std::sync::PoisonError<std::sync::MutexGuard<'t0, ()>>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}]`
18+
= 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<std::sync::Mutex<()>>, &'r std::sync::Mutex<()>, std::result::Result<std::sync::MutexGuard<'s, ()>, std::sync::PoisonError<std::sync::MutexGuard<'t0, ()>>>, &'t1 std::sync::MutexGuard<'t2, ()>, std::sync::MutexGuard<'t3, ()>, (), impl std::future::Future}]>`
19+
= note: required because it appears within the type `impl std::future::Future`
20+
= note: required because it appears within the type `impl std::future::Future`
21+
22+
error: aborting due to previous error
23+
24+
For more information about this error, try `rustc --explain E0277`.

‎src/test/ui/consts/array-literal-index-oob.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// build-pass
2-
// ignore-pass (emit codegen-time warnings and verify that they are indeed warnings and not errors)
2+
// ignore-pass (test emits codegen-time warnings and verifies that they are not errors)
33

44
#![warn(const_err, unconditional_panic)]
55

‎src/test/ui/consts/const-eval/promoted_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
55

66
// build-pass
7-
// ignore-pass (emit codegen-time warnings and verify that they are indeed warnings and not errors)
7+
// ignore-pass (test emits codegen-time warnings and verifies that they are not errors)
88

99
#![warn(const_err, arithmetic_overflow, unconditional_panic)]
1010

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// compile-flags: -Zunleash-the-miri-inside-of-you
2+
// only-x86_64
3+
#![feature(llvm_asm)]
4+
#![allow(const_err)]
5+
6+
fn main() {}
7+
8+
// Make sure we catch executing inline assembly.
9+
static TEST_BAD: () = {
10+
unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
11+
//~^ ERROR could not evaluate static initializer
12+
//~| NOTE in this expansion of llvm_asm!
13+
//~| NOTE inline assembly is not supported
14+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0080]: could not evaluate static initializer
2+
--> $DIR/inline_asm.rs:10:14
3+
|
4+
LL | unsafe { llvm_asm!("xor %eax, %eax" ::: "eax"); }
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inline assembly is not supported
6+
|
7+
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0080`.

‎src/test/ui/lint/dead-code/lint-dead-code-5.rs

+20
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ enum Enum2 {
1313
Variant5 { _x: isize }, //~ ERROR: variant is never constructed: `Variant5`
1414
Variant6(isize), //~ ERROR: variant is never constructed: `Variant6`
1515
_Variant7,
16+
Variant8 { _field: bool },
17+
Variant9,
18+
Variant10(usize)
19+
}
20+
21+
impl Enum2 {
22+
fn new_variant8() -> Enum2 {
23+
Self::Variant8 { _field: true }
24+
}
25+
26+
fn new_variant9() -> Enum2 {
27+
Self::Variant9
28+
}
29+
30+
fn new_variant10() -> Enum2 {
31+
Self::Variant10(10)
32+
}
1633
}
1734

1835
enum Enum3 { //~ ERROR: enum is never used
@@ -27,4 +44,7 @@ fn main() {
2744
Enum1::Variant2 => ()
2845
}
2946
let x = Enum2::Variant3(true);
47+
let _ = Enum2::new_variant8();
48+
let _ = Enum2::new_variant9();
49+
let _ = Enum2::new_variant10();
3050
}

‎src/test/ui/lint/dead-code/lint-dead-code-5.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | Variant6(isize),
2323
| ^^^^^^^^^^^^^^^
2424

2525
error: enum is never used: `Enum3`
26-
--> $DIR/lint-dead-code-5.rs:18:6
26+
--> $DIR/lint-dead-code-5.rs:35:6
2727
|
2828
LL | enum Enum3 {
2929
| ^^^^^

‎src/test/ui/lint/lint-exceeding-bitshifts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
//[noopt]compile-flags: -C opt-level=0
33
//[opt]compile-flags: -O
44
//[opt_with_overflow_checks]compile-flags: -C overflow-checks=on -O
5-
65
// build-pass
6+
// ignore-pass (test emits codegen-time warnings and verifies that they are not errors)
77

88
#![crate_type="lib"]
99
#![warn(arithmetic_overflow, const_err)]

0 commit comments

Comments
 (0)
Please sign in to comment.