Skip to content

Rollup of 5 pull requests #65087

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8ab82c1
introduce from_ref helper for replacement
csmoe Sep 26, 2019
eab060f
clean ClosureSubsts in rustc::ty
csmoe Sep 26, 2019
1f8e1d8
remove ClosureSubsts with SubstsRef
csmoe Sep 26, 2019
455945f
Remove HIR based const qualification
matthewjasper Sep 28, 2019
b4ad612
Remove unused parts of ExprUseVisitor
matthewjasper Sep 28, 2019
08a60ac
Calculate liveness for the same locals with and without -Zpolonius
matthewjasper Sep 21, 2019
2180c24
Make lifetimes in constants live at the point of use
matthewjasper Sep 24, 2019
9b91bef
generate ClosureSubsts from SubstsRef
csmoe Sep 26, 2019
4d9b4b4
Remove `borrowck_graphviz_postflow` from test
ecstatic-morse Oct 2, 2019
b507971
metadata: Remove `CrateMetadata::imported_name`
petrochenkov Sep 29, 2019
acd102a
metadata: Do not pass crate name after renaming to `register_crate`
petrochenkov Sep 29, 2019
33c9ada
metadata: Remove `locator::Context::ident`
petrochenkov Sep 29, 2019
92386a7
metadata: Simplify interface of `resolve_crate`
petrochenkov Sep 29, 2019
f13adc5
metadata: Remove `CrateMetadata::host_lib`
petrochenkov Oct 1, 2019
0f96ba9
metadata: Remove `CrateMetadata::name`
petrochenkov Oct 2, 2019
68aadcb
metadata: Remove unused `Option` from `fn dlsym_proc_macros`
petrochenkov Oct 2, 2019
1cda591
Bless test
ecstatic-morse Oct 3, 2019
314fbf4
Rollup merge of #64749 - matthewjasper:liveness-opt, r=nikomatsakis
Centril Oct 4, 2019
17e1f23
Rollup merge of #64817 - csmoe:closure, r=nikomatsakis
Centril Oct 4, 2019
cb4145e
Rollup merge of #64874 - matthewjasper:simplify-euv, r=eddyb
Centril Oct 4, 2019
a16c637
Rollup merge of #65026 - petrochenkov:ice1, r=eddyb
Centril Oct 4, 2019
aacc89a
Rollup merge of #65073 - ecstatic-morse:issue-65071, r=petrochenkov
Centril Oct 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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