diff options
| author | Ryan1729 <Ryan1729@gmail.com> | 2020-08-03 19:00:38 -0600 |
|---|---|---|
| committer | Ryan1729 <Ryan1729@gmail.com> | 2020-08-06 04:24:25 -0600 |
| commit | ab93133e83048f0b583e5ce3ff3794f4e1d425aa (patch) | |
| tree | d3fc0bfb9ad926641800dac91309fe569c19ba7d | |
| parent | 7a818c096c42df787468b9550a1814121a7b1080 (diff) | |
| download | rust-ab93133e83048f0b583e5ce3ff3794f4e1d425aa.tar.gz rust-ab93133e83048f0b583e5ce3ff3794f4e1d425aa.zip | |
address some review comments
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/transmute.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tools/clippy/clippy_lints/src/transmute.rs b/src/tools/clippy/clippy_lints/src/transmute.rs index 269d2f00353..b6747c73f70 100644 --- a/src/tools/clippy/clippy_lints/src/transmute.rs +++ b/src/tools/clippy/clippy_lints/src/transmute.rs @@ -718,15 +718,12 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx> Inherited::build(cx.tcx, local_def_id).enter(|inherited| { let fn_ctxt = FnCtxt::new( &inherited, - // TODO should we try to get the correct ParamEnv? - ty::ParamEnv::empty(), + cx.param_env, hir_id ); // If we already have errors, we can't be sure we can pointer cast. - if fn_ctxt.errors_reported_since_creation() { - return None; - } + assert!(!fn_ctxt.errors_reported_since_creation()); if let Ok(check) = CastCheck::new( &fn_ctxt, @@ -746,4 +743,4 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx> None } }) -} \ No newline at end of file +} |
