diff options
| author | bors <bors@rust-lang.org> | 2024-01-30 17:01:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-30 17:01:18 +0000 |
| commit | f3d71c9249072413f014b378bb5ea79c8a7dc9a7 (patch) | |
| tree | 6d35d2fb0886ceb2aa7858c88f7694ba2f1e9801 /src/tools | |
| parent | 5ad7454f7503b6af2800bf4a7c875962cb03f913 (diff) | |
| parent | 27bc49656462c48f3b98ac1d8ce2b06d446e5ad3 (diff) | |
| download | rust-f3d71c9249072413f014b378bb5ea79c8a7dc9a7.tar.gz rust-f3d71c9249072413f014b378bb5ea79c8a7dc9a7.zip | |
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
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/transmute/utils.rs | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/tools/clippy/clippy_lints/src/transmute/utils.rs b/src/tools/clippy/clippy_lints/src/transmute/utils.rs index 1cf6cf8548a..7a7bb9f9c94 100644 --- a/src/tools/clippy/clippy_lints/src/transmute/utils.rs +++ b/src/tools/clippy/clippy_lints/src/transmute/utils.rs @@ -37,12 +37,6 @@ pub(super) fn check_cast<'tcx>( let inherited = Inherited::new(cx.tcx, local_def_id); let fn_ctxt = FnCtxt::new(&inherited, cx.param_env, local_def_id); - // If we already have errors, we can't be sure we can pointer cast. - assert!( - !fn_ctxt.errors_reported_since_creation(), - "Newly created FnCtxt contained errors" - ); - if let Ok(check) = cast::CastCheck::new( &fn_ctxt, e, @@ -53,17 +47,7 @@ pub(super) fn check_cast<'tcx>( DUMMY_SP, hir::Constness::NotConst, ) { - let res = check.do_check(&fn_ctxt); - - // do_check's documentation says that it might return Ok and create - // errors in the fcx instead of returning Err in some cases. Those cases - // should be filtered out before getting here. - assert!( - !fn_ctxt.errors_reported_since_creation(), - "`fn_ctxt` contained errors after cast check!" - ); - - res.ok() + check.do_check(&fn_ctxt).ok() } else { None } |
