summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_hir_analysis/src/check/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_hir_analysis/src/check/mod.rs')
-rw-r--r--compiler/rustc_hir_analysis/src/check/mod.rs25
1 files changed, 13 insertions, 12 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs
index ce2da7cb1..4cf358732 100644
--- a/compiler/rustc_hir_analysis/src/check/mod.rs
+++ b/compiler/rustc_hir_analysis/src/check/mod.rs
@@ -38,7 +38,7 @@ can be broken down into several distinct phases:
While type checking a function, the intermediate types for the
expressions, blocks, and so forth contained within the function are
-stored in `fcx.node_types` and `fcx.node_substs`. These types
+stored in `fcx.node_types` and `fcx.node_args`. These types
may contain unresolved type variables. After type checking is
complete, the functions in the writeback module are used to take the
types from this table, resolve them, and then write them into their
@@ -65,6 +65,7 @@ a type parameter).
mod check;
mod compare_impl_item;
pub mod dropck;
+mod entry;
pub mod intrinsic;
pub mod intrinsicck;
mod region;
@@ -80,7 +81,7 @@ use rustc_hir::intravisit::Visitor;
use rustc_index::bit_set::BitSet;
use rustc_middle::query::Providers;
use rustc_middle::ty::{self, Ty, TyCtxt};
-use rustc_middle::ty::{InternalSubsts, SubstsRef};
+use rustc_middle::ty::{GenericArgs, GenericArgsRef};
use rustc_session::parse::feature_err;
use rustc_span::source_map::DUMMY_SP;
use rustc_span::symbol::{kw, Ident};
@@ -188,7 +189,7 @@ fn missing_items_err(
full_impl_span: Span,
) {
let missing_items =
- missing_items.iter().filter(|trait_item| trait_item.opt_rpitit_info.is_none());
+ missing_items.iter().filter(|trait_item| !trait_item.is_impl_trait_in_trait());
let missing_items_msg = missing_items
.clone()
@@ -211,9 +212,9 @@ fn missing_items_err(
let snippet = suggestion_signature(
tcx,
trait_item,
- tcx.impl_trait_ref(impl_def_id).unwrap().subst_identity(),
+ tcx.impl_trait_ref(impl_def_id).unwrap().instantiate_identity(),
);
- let code = format!("{}{}\n{}", padding, snippet, padding);
+ let code = format!("{padding}{snippet}\n{padding}");
if let Some(span) = tcx.hir().span_if_local(trait_item.def_id) {
missing_trait_item_label
.push(errors::MissingTraitItemLabel { span, item: trait_item.name });
@@ -408,7 +409,7 @@ fn fn_sig_suggestion<'tcx>(
let asyncness = if tcx.asyncness(assoc.def_id).is_async() {
output = if let ty::Alias(_, alias_ty) = *output.kind() {
tcx.explicit_item_bounds(alias_ty.def_id)
- .subst_iter_copied(tcx, alias_ty.substs)
+ .iter_instantiated_copied(tcx, alias_ty.args)
.find_map(|(bound, _)| bound.as_projection_clause()?.no_bound_vars()?.term.ty())
.unwrap_or_else(|| {
span_bug!(
@@ -461,10 +462,10 @@ fn suggestion_signature<'tcx>(
assoc: ty::AssocItem,
impl_trait_ref: ty::TraitRef<'tcx>,
) -> String {
- let substs = ty::InternalSubsts::identity_for_item(tcx, assoc.def_id).rebase_onto(
+ let args = ty::GenericArgs::identity_for_item(tcx, assoc.def_id).rebase_onto(
tcx,
assoc.container_id(tcx),
- impl_trait_ref.with_self_ty(tcx, tcx.types.self_param).substs,
+ impl_trait_ref.with_self_ty(tcx, tcx.types.self_param).args,
);
match assoc.kind {
@@ -472,21 +473,21 @@ fn suggestion_signature<'tcx>(
tcx,
tcx.liberate_late_bound_regions(
assoc.def_id,
- tcx.fn_sig(assoc.def_id).subst(tcx, substs),
+ tcx.fn_sig(assoc.def_id).instantiate(tcx, args),
),
assoc.ident(tcx),
- tcx.predicates_of(assoc.def_id).instantiate_own(tcx, substs),
+ tcx.predicates_of(assoc.def_id).instantiate_own(tcx, args),
assoc,
),
ty::AssocKind::Type => {
let (generics, where_clauses) = bounds_from_generic_predicates(
tcx,
- tcx.predicates_of(assoc.def_id).instantiate_own(tcx, substs),
+ tcx.predicates_of(assoc.def_id).instantiate_own(tcx, args),
);
format!("type {}{generics} = /* Type */{where_clauses};", assoc.name)
}
ty::AssocKind::Const => {
- let ty = tcx.type_of(assoc.def_id).subst_identity();
+ let ty = tcx.type_of(assoc.def_id).instantiate_identity();
let val = ty_kind_suggestion(ty).unwrap_or("todo!()");
format!("const {}: {} = {};", assoc.name, ty, val)
}