Skip to content

Commit 4b10cb2

Browse files
authored
Rollup merge of rust-lang#123103 - compiler-errors:inherited-is-a-weird-name, r=oli-obk
Rename `Inherited` -> `TypeckRootCtxt` `Inherited` is a confusing name. Rename it to `TypeckRootCtxt`. I don't think this needs a type MCP or anything since it's not nearly as pervasive as `FnCtxt` , for example. r? `@lcnr` `@oli-obk`
2 parents 57627d2 + a6a1f78 commit 4b10cb2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/methods/unnecessary_to_owned.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_errors::Applicability;
1212
use rustc_hir::def::{DefKind, Res};
1313
use rustc_hir::def_id::DefId;
1414
use rustc_hir::{BorrowKind, Expr, ExprKind, ItemKind, LangItem, Node};
15-
use rustc_hir_typeck::{FnCtxt, Inherited};
15+
use rustc_hir_typeck::{FnCtxt, TypeckRootCtxt};
1616
use rustc_infer::infer::TyCtxtInferExt;
1717
use rustc_lint::LateContext;
1818
use rustc_middle::mir::Mutability;
@@ -438,8 +438,8 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
438438
Node::Item(item) => {
439439
if let ItemKind::Fn(_, _, body_id) = &item.kind
440440
&& let output_ty = return_ty(cx, item.owner_id)
441-
&& let inherited = Inherited::new(cx.tcx, item.owner_id.def_id)
442-
&& let fn_ctxt = FnCtxt::new(&inherited, cx.param_env, item.owner_id.def_id)
441+
&& let root_ctxt = TypeckRootCtxt::new(cx.tcx, item.owner_id.def_id)
442+
&& let fn_ctxt = FnCtxt::new(&root_ctxt, cx.param_env, item.owner_id.def_id)
443443
&& fn_ctxt.can_coerce(ty, output_ty)
444444
{
445445
if has_lifetime(output_ty) && has_lifetime(ty) {

clippy_lints/src/transmute/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use rustc_hir as hir;
22
use rustc_hir::Expr;
3-
use rustc_hir_typeck::{cast, FnCtxt, Inherited};
3+
use rustc_hir_typeck::{cast, FnCtxt, TypeckRootCtxt};
44
use rustc_lint::LateContext;
55
use rustc_middle::ty::cast::CastKind;
66
use rustc_middle::ty::Ty;
@@ -34,8 +34,8 @@ pub(super) fn check_cast<'tcx>(
3434
let hir_id = e.hir_id;
3535
let local_def_id = hir_id.owner.def_id;
3636

37-
let inherited = Inherited::new(cx.tcx, local_def_id);
38-
let fn_ctxt = FnCtxt::new(&inherited, cx.param_env, local_def_id);
37+
let root_ctxt = TypeckRootCtxt::new(cx.tcx, local_def_id);
38+
let fn_ctxt = FnCtxt::new(&root_ctxt, cx.param_env, local_def_id);
3939

4040
if let Ok(check) = cast::CastCheck::new(
4141
&fn_ctxt,

0 commit comments

Comments
 (0)