Skip to content

Commit a9c6020

Browse files
committed
cleanud up some tests
1 parent 8072811 commit a9c6020

21 files changed

+105
-147
lines changed

compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::mem;
22

33
use rustc_errors::{Diag, DiagArgName, DiagArgValue, DiagMessage, IntoDiagArg};
44
use rustc_middle::mir::AssertKind;
5-
use rustc_middle::mir::interpret::{Provenance, ReportedErrorInfo};
5+
use rustc_middle::mir::interpret::{Provenance, ReportedErrorInfo, UnsupportedOpInfo};
66
use rustc_middle::query::TyCtxtAt;
77
use rustc_middle::ty::layout::LayoutError;
88
use rustc_middle::ty::{ConstInt, TyCtxt};
@@ -167,7 +167,7 @@ where
167167
// anyway (e.g. due to size overflow). And we allow OOM as that can happen any time.
168168
let allowed_in_infallible = matches!(
169169
error,
170-
InterpErrorKind::ResourceExhaustion(_) | InterpErrorKind::InvalidProgram(_)
170+
InterpErrorKind::ResourceExhaustion(_) | InterpErrorKind::InvalidProgram(_) | InterpErrorKind::Unsupported(UnsupportedOpInfo::ReadPointerAsInt(_))
171171
);
172172

173173
error.add_args(&mut err);

src/tools/cargo

Submodule cargo updated 60 files
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//! Smoke test: dereferencing boxed zero-sized types (ZSTs) should not crash.
2+
//!
3+
//! Originally a regression test of github.com/rust-lang/rust/issues/13360
4+
//! but repurposed for a smoke test.
5+
6+
//@ run-pass
7+
8+
pub fn main() {
9+
let _: () = *Box::new(());
10+
}

tests/ui/exclusive-drop-and-copy.rs renamed to tests/ui/derives/copy-drop-mutually-exclusive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// issue #20126
1+
//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive
22
33
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
44
struct Foo;

tests/ui/exclusive-drop-and-copy.stderr renamed to tests/ui/derives/copy-drop-mutually-exclusive.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
2-
--> $DIR/exclusive-drop-and-copy.rs:3:10
2+
--> $DIR/copy-drop-mutually-exclusive.rs:3:10
33
|
44
LL | #[derive(Copy, Clone)]
55
| ^^^^ `Copy` not allowed on types with destructors
66

77
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
8-
--> $DIR/exclusive-drop-and-copy.rs:10:10
8+
--> $DIR/copy-drop-mutually-exclusive.rs:10:10
99
|
1010
LL | #[derive(Copy, Clone)]
1111
| ^^^^ `Copy` not allowed on types with destructors

tests/ui/empty-allocation-rvalue-non-null.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/ui/empty-type-parameter-list.rs

Lines changed: 0 additions & 24 deletions
This file was deleted.

tests/ui/error-should-say-copy-not-pod.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/ui/error-should-say-copy-not-pod.stderr

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/ui/explicit-i-suffix.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)