Skip to content

Commit

Permalink
Cleanups and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh726 committed Mar 31, 2021
1 parent 0c98dc6 commit 7108918
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 265 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,6 @@ impl<'tcx> TyCtxt<'tcx> {
let closure_ty = self.mk_closure(closure_def_id, closure_substs);
let closure_kind_ty = closure_substs.as_closure().kind_ty();
let closure_kind = closure_kind_ty.to_opt_closure_kind()?;
debug_assert!(!closure_ty.has_escaping_bound_vars());
let env_ty = match closure_kind {
ty::ClosureKind::Fn => self.mk_imm_ref(self.mk_region(env_region), closure_ty),
ty::ClosureKind::FnMut => self.mk_mut_ref(self.mk_region(env_region), closure_ty),
Expand Down
4 changes: 1 addition & 3 deletions compiler/rustc_mir/src/monomorphize/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use rustc_middle::traits;
use rustc_middle::ty::adjustment::CustomCoerceUnsized;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable};
use rustc_middle::ty::{self, Ty, TyCtxt};

use rustc_hir::lang_items::LangItem;

Expand All @@ -15,8 +15,6 @@ fn custom_coerce_unsize_info<'tcx>(
) -> CustomCoerceUnsized {
let def_id = tcx.require_lang_item(LangItem::CoerceUnsized, None);

debug_assert!(!source_ty.has_escaping_bound_vars());
debug_assert!(!target_ty.has_escaping_bound_vars());
let trait_ref = ty::Binder::dummy(ty::TraitRef {
def_id,
substs: tcx.mk_substs_trait(source_ty, &[target_ty.into()]),
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_resolve/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use tracing::debug;

mod diagnostics;
crate mod lifetimes;
crate mod supertraits;

type Res = def::Res<NodeId>;

Expand Down
407 changes: 211 additions & 196 deletions compiler/rustc_resolve/src/late/lifetimes.rs

Large diffs are not rendered by default.

60 changes: 0 additions & 60 deletions compiler/rustc_resolve/src/late/supertraits.rs

This file was deleted.

1 change: 0 additions & 1 deletion compiler/rustc_trait_selection/src/traits/auto_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ impl<'tcx> AutoTraitFinder<'tcx> {
) -> AutoTraitResult<A> {
let tcx = self.tcx;

debug_assert!(!ty.has_escaping_bound_vars());
let trait_ref = ty::TraitRef { def_id: trait_did, substs: tcx.mk_substs_trait(ty, &[]) };

let trait_pred = ty::Binder::dummy(trait_ref);
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_typeck/src/astconv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2186,13 +2186,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
}
}

/// Parses the programmer's textual representation of a type into our
/// internal notion of a type.
pub fn ast_ty_to_ty(&self, ast_ty: &hir::Ty<'_>) -> Ty<'tcx> {
self.ast_ty_to_ty_inner(ast_ty, false)
}

/// Parses the programmer's textual representation of a type into our
/// internal notion of a type.
///
/// Turns a `hir::Ty` into a `Ty`. For diagnostics' purposes we keep track of whether trait
/// objects are borrowed like `&dyn Trait` to avoid emitting redundant errors.
#[tracing::instrument(level = "debug", skip(self))]
Expand Down

0 comments on commit 7108918

Please sign in to comment.