File tree 4 files changed +25
-2
lines changed
4 files changed +25
-2
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( unchecked_math) ]
2
+
3
+ fn main ( ) {
4
+ unsafe {
5
+ let _n = 1i8 . unchecked_shl ( 8 ) ;
6
+ //~^ ERROR: overflowing shift by 8 in `unchecked_shl`
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ error: Undefined Behavior: overflowing shift by 8 in `unchecked_shl`
2
+ --> $DIR/unchecked_shl.rs:LL:CC
3
+ |
4
+ LL | let _n = 1i8.unchecked_shl(8);
5
+ | ^^^^^^^^^^^^^^^^^^^^ overflowing shift by 8 in `unchecked_shl`
6
+ |
7
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9
+ = note: BACKTRACE:
10
+ = note: inside `main` at $DIR/unchecked_shl.rs:LL:CC
11
+
12
+ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13
+
14
+ error: aborting due to previous error
15
+
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
error: Undefined Behavior: overflowing shift by 64 in `unchecked_shr`
2
- --> $DIR/overflowing-unchecked-rsh .rs:LL:CC
2
+ --> $DIR/unchecked_shr .rs:LL:CC
3
3
|
4
4
LL | let _n = 1i64.unchecked_shr(64);
5
5
| ^^^^^^^^^^^^^^^^^^^^^^ overflowing shift by 64 in `unchecked_shr`
6
6
|
7
7
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
8
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9
9
= note: BACKTRACE:
10
- = note: inside `main` at $DIR/overflowing-unchecked-rsh .rs:LL:CC
10
+ = note: inside `main` at $DIR/unchecked_shr .rs:LL:CC
11
11
12
12
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13
13
You can’t perform that action at this time.
0 commit comments