Skip to content

Commit 21ec892

Browse files
committed
Auto merge of #120496 - GuillaumeGomez:rollup-fmu9jre, r=GuillaumeGomez
Rollup of 11 pull requests Successful merges: - #117906 (Improve display of crate name when hovered) - #118533 (Suppress unhelpful diagnostics for unresolved top level attributes) - #120293 (Deduplicate more sized errors on call exprs) - #120295 (Remove `raw_os_nonzero` feature.) - #120310 (adapt test for v0 symbol mangling) - #120342 (Remove various `has_errors` or `err_count` uses) - #120434 (Revert outdated version of "Add the wasm32-wasi-preview2 target") - #120445 (Fix some `Arc` allocator leaks) - #120475 (Improve error message when `cargo build` is used to build the compiler) - #120476 (Remove some unnecessary check logic for lang items in HIR typeck) - #120485 (add missing potential_query_instability for keys and values in hashmap) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 88a2642 + fbd712f commit 21ec892

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

clippy_lints/src/transmute/utils.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,6 @@ pub(super) fn check_cast<'tcx>(
3737
let inherited = Inherited::new(cx.tcx, local_def_id);
3838
let fn_ctxt = FnCtxt::new(&inherited, cx.param_env, local_def_id);
3939

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-
4640
if let Ok(check) = cast::CastCheck::new(
4741
&fn_ctxt,
4842
e,
@@ -53,17 +47,7 @@ pub(super) fn check_cast<'tcx>(
5347
DUMMY_SP,
5448
hir::Constness::NotConst,
5549
) {
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()
6751
} else {
6852
None
6953
}

0 commit comments

Comments
 (0)