File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 33
33
required : false
34
34
default : true
35
35
description : Execute tests.
36
+ do-miri :
37
+ type : boolean
38
+ required : false
39
+ default : false
40
+ description : Execute tests with miri.
36
41
37
42
jobs :
38
43
check_rust :
80
85
curl -LsSf https://get.nexte.st/latest/linux | tar zxf -
81
86
chmod u+x cargo-nextest
82
87
./cargo-nextest nextest run --features ${{ inputs.features }}
88
+ # Only works with nightly.
89
+ - name : Unit Test with Miri
90
+ if : ${{ inputs.do-miri }}
91
+ run : |
92
+ rustup component add miri
93
+ cargo miri test --features ${{ inputs.features }}
Original file line number Diff line number Diff line change 95
95
do-style-check : true
96
96
do-test : false
97
97
features : unstable
98
+
99
+ miri :
100
+ name : tests with miri
101
+ needs : build_nightly
102
+ uses : ./.github/workflows/_build-rust.yml
103
+ with :
104
+ rust-version : nightly
105
+ do-style-check : false
106
+ do-test : false
107
+ do-miri : true
108
+ features : unstable
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ impl BootLoaderNameTag {
31
31
use core:: { mem, slice, str} ;
32
32
// strlen without null byte
33
33
let strlen = self . size as usize - mem:: size_of :: < BootLoaderNameTag > ( ) ;
34
- let bytes = unsafe { slice:: from_raw_parts ( ( & self . string ) as * const u8 , strlen) } ;
34
+ let cstring = core:: ptr:: addr_of!( self . string) ;
35
+ let bytes = unsafe { slice:: from_raw_parts ( cstring, strlen) } ;
35
36
str:: from_utf8 ( bytes)
36
37
}
37
38
}
You can’t perform that action at this time.
0 commit comments