File tree 1 file changed +1
-17
lines changed
clippy_lints/src/transmute
1 file changed +1
-17
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,6 @@ pub(super) fn check_cast<'tcx>(
37
37
let inherited = Inherited :: new ( cx. tcx , local_def_id) ;
38
38
let fn_ctxt = FnCtxt :: new ( & inherited, cx. param_env , local_def_id) ;
39
39
40
- // If we already have errors, we can't be sure we can pointer cast.
41
- assert ! (
42
- !fn_ctxt. errors_reported_since_creation( ) ,
43
- "Newly created FnCtxt contained errors"
44
- ) ;
45
-
46
40
if let Ok ( check) = cast:: CastCheck :: new (
47
41
& fn_ctxt,
48
42
e,
@@ -53,17 +47,7 @@ pub(super) fn check_cast<'tcx>(
53
47
DUMMY_SP ,
54
48
hir:: Constness :: NotConst ,
55
49
) {
56
- let res = check. do_check ( & fn_ctxt) ;
57
-
58
- // do_check's documentation says that it might return Ok and create
59
- // errors in the fcx instead of returning Err in some cases. Those cases
60
- // should be filtered out before getting here.
61
- assert ! (
62
- !fn_ctxt. errors_reported_since_creation( ) ,
63
- "`fn_ctxt` contained errors after cast check!"
64
- ) ;
65
-
66
- res. ok ( )
50
+ check. do_check ( & fn_ctxt) . ok ( )
67
51
} else {
68
52
None
69
53
}
You can’t perform that action at this time.
0 commit comments