File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,7 @@ fn main() {
30
30
let _x: &i32 = unsafe { mem::transmute(16usize) }; //~ encountered a dangling reference (address $HEX is unallocated)
31
31
}
32
32
" ;
33
- match Comments :: parse ( Path :: new ( "<dummy>" ) , s) {
34
- Ok ( _) => panic ! ( "expected parsing to fail" ) ,
35
- Err ( _) => { }
36
- }
33
+ assert ! ( Comments :: parse( Path :: new( "<dummy>" ) , s) . is_err( ) , "expected parsing to fail" ) ;
37
34
}
38
35
39
36
#[ test]
@@ -55,10 +52,7 @@ fn parse_slash_slash_at_fail() {
55
52
use std::mem;
56
53
57
54
" ;
58
- match Comments :: parse ( Path :: new ( "<dummy>" ) , s) {
59
- Ok ( _) => panic ! ( "expected parsing to fail" ) ,
60
- Err ( _) => { }
61
- }
55
+ assert ! ( Comments :: parse( Path :: new( "<dummy>" ) , s) . is_err( ) , "expected parsing to fail" ) ;
62
56
}
63
57
64
58
#[ test]
@@ -68,8 +62,5 @@ fn missing_colon_fail() {
68
62
use std::mem;
69
63
70
64
" ;
71
- match Comments :: parse ( Path :: new ( "<dummy>" ) , s) {
72
- Ok ( _) => panic ! ( "expected parsing to fail" ) ,
73
- Err ( _) => { }
74
- }
65
+ assert ! ( Comments :: parse( Path :: new( "<dummy>" ) , s) . is_err( ) , "expected parsing to fail" ) ;
75
66
}
You can’t perform that action at this time.
0 commit comments