Skip to content

Commit

Permalink
Fixes after a rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
aturon committed Mar 14, 2016
1 parent 8f0e73e commit 35437c7
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 20 deletions.
3 changes: 1 addition & 2 deletions src/librustc/middle/traits/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ use super::util;
use middle::def_id::DefId;
use middle::infer::{self, TypeOrigin};
use middle::subst::Subst;
use middle::ty::{self, ToPredicate, RegionEscape, HasTypeFlags, ToPolyTraitRef, Ty, TyCtxt};
use middle::ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt};
use middle::ty::fold::{TypeFoldable, TypeFolder};
use rustc_front::hir;
use syntax::parse::token;
use syntax::ast;
use util::common::FN_OUTPUT_NAME;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/traits/specialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use middle::infer::{self, InferCtxt, TypeOrigin};
use middle::region;
use middle::subst::{Subst, Substs};
use middle::traits::ProjectionMode;
use middle::ty;
use middle::ty::{self, TyCtxt};
use syntax::codemap::DUMMY_SP;

pub mod specialization_graph;
Expand Down Expand Up @@ -119,7 +119,7 @@ pub fn translate_substs<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
/// Specialization is determined by the sets of types to which the impls apply;
/// impl1 specializes impl2 if it applies to a subset of the types impl2 applies
/// to.
pub fn specializes(tcx: &ty::ctxt, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
pub fn specializes(tcx: &TyCtxt, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
// The feature gate should prevent introducing new specializations, but not
// taking advantage of upstream ones.
if !tcx.sess.features.borrow().specialization &&
Expand Down
14 changes: 7 additions & 7 deletions src/librustc/middle/traits/specialize/specialization_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use middle::cstore::CrateStore;
use middle::def_id::DefId;
use middle::infer;
use middle::traits::{self, ProjectionMode};
use middle::ty::{self, ImplOrTraitItem, TraitDef, TypeFoldable};
use middle::ty::{self, TyCtxt, ImplOrTraitItem, TraitDef, TypeFoldable};
use syntax::ast::Name;
use util::nodemap::DefIdMap;

Expand Down Expand Up @@ -57,7 +57,7 @@ impl Graph {
/// conflicts with it (has overlap, but neither specializes the other),
/// information about the area of overlap is returned in the `Err`.
pub fn insert<'a, 'tcx>(&mut self,
tcx: &'a ty::ctxt<'tcx>,
tcx: &'a TyCtxt<'tcx>,
impl_def_id: DefId)
-> Result<(), Overlap<'a, 'tcx>> {
assert!(impl_def_id.is_local());
Expand Down Expand Up @@ -177,7 +177,7 @@ impl Node {
}

/// Iterate over the items defined directly by the given (impl or trait) node.
pub fn items<'a, 'tcx>(&self, tcx: &'a ty::ctxt<'tcx>) -> NodeItems<'a, 'tcx> {
pub fn items<'a, 'tcx>(&self, tcx: &'a TyCtxt<'tcx>) -> NodeItems<'a, 'tcx> {
match *self {
Node::Impl(impl_def_id) => {
NodeItems::Impl {
Expand Down Expand Up @@ -207,7 +207,7 @@ impl Node {
/// An iterator over the items defined within a trait or impl.
pub enum NodeItems<'a, 'tcx: 'a> {
Impl {
tcx: &'a ty::ctxt<'tcx>,
tcx: &'a TyCtxt<'tcx>,
items: cell::Ref<'a, Vec<ty::ImplOrTraitItemId>>,
idx: usize,
},
Expand Down Expand Up @@ -319,7 +319,7 @@ impl<'a, 'tcx> Iterator for ConstDefs<'a, 'tcx> {
impl<'a, 'tcx> Ancestors<'a, 'tcx> {
/// Search the items from the given ancestors, returning each type definition
/// with the given name.
pub fn type_defs(self, tcx: &'a ty::ctxt<'tcx>, name: Name) -> TypeDefs<'a, 'tcx> {
pub fn type_defs(self, tcx: &'a TyCtxt<'tcx>, name: Name) -> TypeDefs<'a, 'tcx> {
let iter = self.flat_map(move |node| {
node.items(tcx)
.filter_map(move |item| {
Expand All @@ -340,7 +340,7 @@ impl<'a, 'tcx> Ancestors<'a, 'tcx> {

/// Search the items from the given ancestors, returning each fn definition
/// with the given name.
pub fn fn_defs(self, tcx: &'a ty::ctxt<'tcx>, name: Name) -> FnDefs<'a, 'tcx> {
pub fn fn_defs(self, tcx: &'a TyCtxt<'tcx>, name: Name) -> FnDefs<'a, 'tcx> {
let iter = self.flat_map(move |node| {
node.items(tcx)
.filter_map(move |item| {
Expand All @@ -361,7 +361,7 @@ impl<'a, 'tcx> Ancestors<'a, 'tcx> {

/// Search the items from the given ancestors, returning each const
/// definition with the given name.
pub fn const_defs(self, tcx: &'a ty::ctxt<'tcx>, name: Name) -> ConstDefs<'a, 'tcx> {
pub fn const_defs(self, tcx: &'a TyCtxt<'tcx>, name: Name) -> ConstDefs<'a, 'tcx> {
let iter = self.flat_map(move |node| {
node.items(tcx)
.filter_map(move |item| {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/ty/trait_def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<'tcx> TraitDef<'tcx> {
/// overlap information if the impl overlaps but does not specialize an
/// existing impl.
pub fn add_impl_for_specialization<'a>(&self,
tcx: &'a ctxt<'tcx>,
tcx: &'a TyCtxt<'tcx>,
impl_def_id: DefId)
-> Result<(), traits::Overlap<'a, 'tcx>> {
assert!(impl_def_id.is_local());
Expand Down
1 change: 0 additions & 1 deletion src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ use middle::lang_items;
use middle::subst;
use middle::ty::{ImplContainer, TraitContainer};
use middle::ty::{self, Ty, TyCtxt, TypeFoldable, VariantKind};
use middle::traits;

use rustc_const_eval::ConstInt;

Expand Down
1 change: 1 addition & 0 deletions src/librustc_metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use middle::def_id::{CRATE_DEF_INDEX, DefId};
use middle::dependency_format::Linkage;
use middle::stability;
use middle::subst;
use middle::traits::specialization_graph;
use middle::ty::{self, Ty, TyCtxt};
use middle::ty::util::IntTypeExt;

Expand Down
1 change: 1 addition & 0 deletions src/librustc_mir/mir_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use rustc::mir::mir_map::MirMap;
use rustc::middle::infer;
use rustc::middle::region::CodeExtentData;
use rustc::middle::traits::ProjectionMode;
use rustc::middle::ty::{self, Ty, TyCtxt};
use rustc::util::common::ErrorReported;
use rustc::util::nodemap::NodeMap;
use rustc_front::hir;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/trans/meth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ pub struct ImplMethod<'tcx> {
}

/// Locates the applicable definition of a method, given its name.
pub fn get_impl_method<'tcx>(tcx: &ty::ctxt<'tcx>,
pub fn get_impl_method<'tcx>(tcx: &TyCtxt<'tcx>,
impl_def_id: DefId,
substs: Substs<'tcx>,
name: Name)
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ fn check_method_body<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
check_bare_fn(ccx, &sig.decl, body, id, span, fty, param_env);
}

fn report_forbidden_specialization(tcx: &ty::ctxt,
fn report_forbidden_specialization(tcx: &TyCtxt,
impl_item: &hir::ImplItem,
parent_impl: DefId)
{
Expand All @@ -887,7 +887,7 @@ fn report_forbidden_specialization(tcx: &ty::ctxt,
err.emit();
}

fn check_specialization_validity<'tcx>(tcx: &ty::ctxt<'tcx>, trait_def: &ty::TraitDef<'tcx>,
fn check_specialization_validity<'tcx>(tcx: &TyCtxt<'tcx>, trait_def: &ty::TraitDef<'tcx>,
impl_id: DefId, impl_item: &hir::ImplItem)
{
let ancestors = trait_def.ancestors(impl_id);
Expand Down
1 change: 0 additions & 1 deletion src/librustc_typeck/coherence/overlap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use middle::cstore::CrateStore;
use middle::traits;
use middle::ty::{self, TyCtxt};
use middle::infer;
use syntax::ast;
use rustc::dep_graph::DepNode;
use rustc_front::hir;
Expand Down
5 changes: 2 additions & 3 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,10 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status
("inclusive_range_syntax", "1.7.0", Some(28237), Active),

// `expr?`
("question_mark", "1.9.0", Some(31436), Active)
("question_mark", "1.9.0", Some(31436), Active),

// impl specialization (RFC 1210)
// TODO: update with issue number (once it exists), before landing
("specialization", "1.7.0", None, Active),
("specialization", "1.7.0", Some(31844), Active),
];
// (changing above list without updating src/doc/reference.md makes @cmr sad)

Expand Down

0 comments on commit 35437c7

Please sign in to comment.