diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-01-25 12:06:01 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-01-25 12:06:01 +0000 |
| commit | f6f0e04e9b9583fd3ba5a381d33894ebaa01d83f (patch) | |
| tree | ac655b8d722b6fe6d622a096a8e2cae8581b1ae8 /src | |
| parent | f68741b637c27ce2e7273207d3593759ba698a64 (diff) | |
| download | rust-f6f0e04e9b9583fd3ba5a381d33894ebaa01d83f.tar.gz rust-f6f0e04e9b9583fd3ba5a381d33894ebaa01d83f.zip | |
Remove an unused error count check
Diffstat (limited to 'src')
| -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 } |
