Skip to content

Commit 4adee91

Browse files
tests
1 parent d92f74e commit 4adee91

12 files changed

+1117
-121
lines changed

tests/ui/transmutability/primitives/bool.stderr renamed to tests/ui/transmutability/primitives/bool.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
2-
--> $DIR/bool.rs:22:35
2+
--> $DIR/bool.rs:24:35
33
|
44
LL | assert::is_transmutable::<u8, bool>();
55
| ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
66
|
77
= help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `bool`
88
note: required by a bound in `is_transmutable`
9-
--> $DIR/bool.rs:12:14
9+
--> $DIR/bool.rs:14:14
1010
|
1111
LL | pub fn is_transmutable<Src, Dst>()
1212
| --------------- required by a bound in this function
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0277]: `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
2+
--> $DIR/bool.rs:24:35
3+
|
4+
LL | assert::is_transmutable::<u8, bool>();
5+
| ^^^^ `u8` cannot be safely transmuted into `bool` in the defining scope of `assert::Context`.
6+
|
7+
= help: the trait `BikeshedIntrinsicFrom<u8, assert::Context, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `bool`
8+
note: required by a bound in `is_transmutable`
9+
--> $DIR/bool.rs:14:14
10+
|
11+
LL | pub fn is_transmutable<Src, Dst>()
12+
| --------------- required by a bound in this function
13+
LL | where
14+
LL | Dst: BikeshedIntrinsicFrom<Src, Context, { Assume::SAFETY }>
15+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable`
16+
17+
error: aborting due to previous error
18+
19+
For more information about this error, try `rustc --explain E0277`.

tests/ui/transmutability/primitives/bool.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
#![crate_type = "lib"]
25
#![feature(transmutability)]
36
#![allow(dead_code)]
47
#![allow(incomplete_features)]
5-
68
mod assert {
79
use std::mem::{Assume, BikeshedIntrinsicFrom};
810
pub struct Context;

tests/ui/transmutability/primitives/numbers.stderr renamed to tests/ui/transmutability/primitives/numbers.current.stderr

+114-114
Large diffs are not rendered by default.

tests/ui/transmutability/primitives/numbers.next.stderr

+915
Large diffs are not rendered by default.

tests/ui/transmutability/primitives/numbers.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
#![crate_type = "lib"]
25
#![feature(transmutability)]
36
#![allow(dead_code)]

tests/ui/transmutability/primitives/unit.stderr renamed to tests/ui/transmutability/primitives/unit.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
2-
--> $DIR/unit.rs:28:35
2+
--> $DIR/unit.rs:31:35
33
|
44
LL | assert::is_transmutable::<(), u8, Context>();
55
| ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
66
|
77
= help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8`
88
note: required by a bound in `is_transmutable`
9-
--> $DIR/unit.rs:12:14
9+
--> $DIR/unit.rs:15:14
1010
|
1111
LL | pub fn is_transmutable<Src, Dst, Context>()
1212
| --------------- required by a bound in this function
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
error[E0277]: `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
2+
--> $DIR/unit.rs:31:35
3+
|
4+
LL | assert::is_transmutable::<(), u8, Context>();
5+
| ^^ `()` cannot be safely transmuted into `u8` in the defining scope of `should_have_correct_size::Context`.
6+
|
7+
= help: the trait `BikeshedIntrinsicFrom<(), should_have_correct_size::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `u8`
8+
note: required by a bound in `is_transmutable`
9+
--> $DIR/unit.rs:15:14
10+
|
11+
LL | pub fn is_transmutable<Src, Dst, Context>()
12+
| --------------- required by a bound in this function
13+
LL | where
14+
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
15+
| ______________^
16+
LL | | Assume::ALIGNMENT
17+
LL | | .and(Assume::LIFETIMES)
18+
LL | | .and(Assume::SAFETY)
19+
LL | | .and(Assume::VALIDITY)
20+
LL | | }>
21+
| |__________^ required by this bound in `is_transmutable`
22+
23+
error: aborting due to previous error
24+
25+
For more information about this error, try `rustc --explain E0277`.

tests/ui/transmutability/primitives/unit.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
//! The unit type, `()`, should be one byte.
25
36
#![crate_type = "lib"]

tests/ui/transmutability/references.stderr renamed to tests/ui/transmutability/references.current.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
2-
--> $DIR/references.rs:26:52
2+
--> $DIR/references.rs:29:52
33
|
44
LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
55
| ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
66
|
77
= help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit`
88
note: required by a bound in `is_maybe_transmutable`
9-
--> $DIR/references.rs:13:14
9+
--> $DIR/references.rs:16:14
1010
|
1111
LL | pub fn is_maybe_transmutable<Src, Dst>()
1212
| --------------------- required by a bound in this function
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error[E0277]: `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
2+
--> $DIR/references.rs:29:52
3+
|
4+
LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>();
5+
| ^^^^^^^^^^^^^ `&'static Unit` cannot be safely transmuted into `&'static Unit` in the defining scope of `assert::Context`.
6+
|
7+
= help: the trait `BikeshedIntrinsicFrom<&'static Unit, assert::Context, Assume { alignment: true, lifetimes: true, safety: true, validity: true }>` is not implemented for `&'static Unit`
8+
note: required by a bound in `is_maybe_transmutable`
9+
--> $DIR/references.rs:16:14
10+
|
11+
LL | pub fn is_maybe_transmutable<Src, Dst>()
12+
| --------------------- required by a bound in this function
13+
LL | where
14+
LL | Dst: BikeshedIntrinsicFrom<Src, Context, {
15+
| ______________^
16+
LL | | Assume {
17+
LL | | alignment: true,
18+
LL | | lifetimes: true,
19+
... |
20+
LL | | }
21+
LL | | }>
22+
| |__________^ required by this bound in `is_maybe_transmutable`
23+
24+
error: aborting due to previous error
25+
26+
For more information about this error, try `rustc --explain E0277`.

tests/ui/transmutability/references.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// revisions: current next
2+
//[next] compile-flags: -Ztrait-solver=next
3+
14
//! Transmutations involving references are not yet supported.
25
36
#![crate_type = "lib"]

0 commit comments

Comments
 (0)