Skip to content

Commit

Permalink
Auto merge of #65087 - Centril:rollup-skxq0zr, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 5 pull requests

Successful merges:

 - #64749 (Fix most remaining Polonius test differences)
 - #64817 (Replace ClosureSubsts with SubstsRef)
 - #64874 (Simplify ExprUseVisitor)
 - #65026 (metadata: Some crate loading cleanup)
 - #65073 (Remove `borrowck_graphviz_postflow` from test)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Oct 4, 2019
2 parents 31d75c4 + aacc89a commit 9e35a28
Show file tree
Hide file tree
Showing 96 changed files with 528 additions and 2,145 deletions.
4 changes: 2 additions & 2 deletions src/librustc/infer/error_reporting/need_type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {

let ty_msg = match local_visitor.found_ty {
Some(ty::TyS { kind: ty::Closure(def_id, substs), .. }) => {
let fn_sig = substs.closure_sig(*def_id, self.tcx);
let fn_sig = substs.as_closure().sig(*def_id, self.tcx);
let args = closure_args(&fn_sig);
let ret = fn_sig.output().skip_binder().to_string();
format!(" for the closure `fn({}) -> {}`", args, ret)
Expand Down Expand Up @@ -255,7 +255,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {

let suffix = match local_visitor.found_ty {
Some(ty::TyS { kind: ty::Closure(def_id, substs), .. }) => {
let fn_sig = substs.closure_sig(*def_id, self.tcx);
let fn_sig = substs.as_closure().sig(*def_id, self.tcx);
let ret = fn_sig.output().skip_binder().to_string();

if let Some(ExprKind::Closure(_, decl, body_id, ..)) = local_visitor.found_closure {
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1504,9 +1504,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn closure_kind(
&self,
closure_def_id: DefId,
closure_substs: ty::ClosureSubsts<'tcx>,
closure_substs: SubstsRef<'tcx>,
) -> Option<ty::ClosureKind> {
let closure_kind_ty = closure_substs.closure_kind_ty(closure_def_id, self.tcx);
let closure_kind_ty = closure_substs.as_closure().kind_ty(closure_def_id, self.tcx);
let closure_kind_ty = self.shallow_resolve(closure_kind_ty);
closure_kind_ty.to_opt_closure_kind()
}
Expand All @@ -1518,9 +1518,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
pub fn closure_sig(
&self,
def_id: DefId,
substs: ty::ClosureSubsts<'tcx>,
substs: SubstsRef<'tcx>,
) -> ty::PolyFnSig<'tcx> {
let closure_sig_ty = substs.closure_sig_ty(def_id, self.tcx);
let closure_sig_ty = substs.as_closure().sig_ty(def_id, self.tcx);
let closure_sig_ty = self.shallow_resolve(closure_sig_ty);
closure_sig_ty.fn_sig(self.tcx)
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/infer/opaque_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,11 @@ where
ty::Closure(def_id, ref substs) => {
// Skip lifetime parameters of the enclosing item(s)

for upvar_ty in substs.upvar_tys(def_id, self.tcx) {
for upvar_ty in substs.as_closure().upvar_tys(def_id, self.tcx) {
upvar_ty.visit_with(self);
}

substs.closure_sig_ty(def_id, self.tcx).visit_with(self);
substs.as_closure().sig_ty(def_id, self.tcx).visit_with(self);
}

ty::Generator(def_id, ref substs, _) => {
Expand Down Expand Up @@ -886,7 +886,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {

let generics = self.tcx.generics_of(def_id);
let substs =
self.tcx.mk_substs(substs.substs.iter().enumerate().map(|(index, &kind)| {
self.tcx.mk_substs(substs.iter().enumerate().map(|(index, &kind)| {
if index < generics.parent_count {
// Accommodate missing regions in the parent kinds...
self.fold_kind_mapping_missing_regions_to_empty(kind)
Expand All @@ -896,7 +896,7 @@ impl TypeFolder<'tcx> for ReverseMapper<'tcx> {
}
}));

self.tcx.mk_closure(def_id, ty::ClosureSubsts { substs })
self.tcx.mk_closure(def_id, substs)
}

ty::Generator(def_id, substs, movability) => {
Expand Down
4 changes: 1 addition & 3 deletions src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ pub enum ExternCrateSource {
/// such ids
DefId,
),
// Crate is loaded by `use`.
Use,
/// Crate is implicitly loaded by an absolute path.
/// Crate is implicitly loaded by a path resolving through extern prelude.
Path,
}

Expand Down
Loading

0 comments on commit 9e35a28

Please sign in to comment.