Skip to content

Commit 9e35a28

Browse files
committed
Auto merge of rust-lang#65087 - Centril:rollup-skxq0zr, r=Centril
Rollup of 5 pull requests Successful merges: - rust-lang#64749 (Fix most remaining Polonius test differences) - rust-lang#64817 (Replace ClosureSubsts with SubstsRef) - rust-lang#64874 (Simplify ExprUseVisitor) - rust-lang#65026 (metadata: Some crate loading cleanup) - rust-lang#65073 (Remove `borrowck_graphviz_postflow` from test) Failed merges: r? @ghost
2 parents 31d75c4 + aacc89a commit 9e35a28

File tree

96 files changed

+528
-2145
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+528
-2145
lines changed

src/librustc/infer/error_reporting/need_type_info.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
220220

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

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

261261
if let Some(ExprKind::Closure(_, decl, body_id, ..)) = local_visitor.found_closure {

src/librustc/infer/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1504,9 +1504,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
15041504
pub fn closure_kind(
15051505
&self,
15061506
closure_def_id: DefId,
1507-
closure_substs: ty::ClosureSubsts<'tcx>,
1507+
closure_substs: SubstsRef<'tcx>,
15081508
) -> Option<ty::ClosureKind> {
1509-
let closure_kind_ty = closure_substs.closure_kind_ty(closure_def_id, self.tcx);
1509+
let closure_kind_ty = closure_substs.as_closure().kind_ty(closure_def_id, self.tcx);
15101510
let closure_kind_ty = self.shallow_resolve(closure_kind_ty);
15111511
closure_kind_ty.to_opt_closure_kind()
15121512
}
@@ -1518,9 +1518,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
15181518
pub fn closure_sig(
15191519
&self,
15201520
def_id: DefId,
1521-
substs: ty::ClosureSubsts<'tcx>,
1521+
substs: SubstsRef<'tcx>,
15221522
) -> ty::PolyFnSig<'tcx> {
1523-
let closure_sig_ty = substs.closure_sig_ty(def_id, self.tcx);
1523+
let closure_sig_ty = substs.as_closure().sig_ty(def_id, self.tcx);
15241524
let closure_sig_ty = self.shallow_resolve(closure_sig_ty);
15251525
closure_sig_ty.fn_sig(self.tcx)
15261526
}

src/librustc/infer/opaque_types/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -722,11 +722,11 @@ where
722722
ty::Closure(def_id, ref substs) => {
723723
// Skip lifetime parameters of the enclosing item(s)
724724

725-
for upvar_ty in substs.upvar_tys(def_id, self.tcx) {
725+
for upvar_ty in substs.as_closure().upvar_tys(def_id, self.tcx) {
726726
upvar_ty.visit_with(self);
727727
}
728728

729-
substs.closure_sig_ty(def_id, self.tcx).visit_with(self);
729+
substs.as_closure().sig_ty(def_id, self.tcx).visit_with(self);
730730
}
731731

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

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

899-
self.tcx.mk_closure(def_id, ty::ClosureSubsts { substs })
899+
self.tcx.mk_closure(def_id, substs)
900900
}
901901

902902
ty::Generator(def_id, substs, movability) => {

src/librustc/middle/cstore.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@ pub enum ExternCrateSource {
148148
/// such ids
149149
DefId,
150150
),
151-
// Crate is loaded by `use`.
152-
Use,
153-
/// Crate is implicitly loaded by an absolute path.
151+
/// Crate is implicitly loaded by a path resolving through extern prelude.
154152
Path,
155153
}
156154

0 commit comments

Comments
 (0)