Skip to content

Commit 35437c7

Browse files
committed
Fixes after a rebase
1 parent 8f0e73e commit 35437c7

File tree

11 files changed

+18
-20
lines changed

11 files changed

+18
-20
lines changed

src/librustc/middle/traits/project.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ use super::util;
2626
use middle::def_id::DefId;
2727
use middle::infer::{self, TypeOrigin};
2828
use middle::subst::Subst;
29-
use middle::ty::{self, ToPredicate, RegionEscape, HasTypeFlags, ToPolyTraitRef, Ty, TyCtxt};
29+
use middle::ty::{self, ToPredicate, ToPolyTraitRef, Ty, TyCtxt};
3030
use middle::ty::fold::{TypeFoldable, TypeFolder};
31-
use rustc_front::hir;
3231
use syntax::parse::token;
3332
use syntax::ast;
3433
use util::common::FN_OUTPUT_NAME;

src/librustc/middle/traits/specialize/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use middle::infer::{self, InferCtxt, TypeOrigin};
2626
use middle::region;
2727
use middle::subst::{Subst, Substs};
2828
use middle::traits::ProjectionMode;
29-
use middle::ty;
29+
use middle::ty::{self, TyCtxt};
3030
use syntax::codemap::DUMMY_SP;
3131

3232
pub mod specialization_graph;
@@ -119,7 +119,7 @@ pub fn translate_substs<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
119119
/// Specialization is determined by the sets of types to which the impls apply;
120120
/// impl1 specializes impl2 if it applies to a subset of the types impl2 applies
121121
/// to.
122-
pub fn specializes(tcx: &ty::ctxt, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
122+
pub fn specializes(tcx: &TyCtxt, impl1_def_id: DefId, impl2_def_id: DefId) -> bool {
123123
// The feature gate should prevent introducing new specializations, but not
124124
// taking advantage of upstream ones.
125125
if !tcx.sess.features.borrow().specialization &&

src/librustc/middle/traits/specialize/specialization_graph.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use middle::cstore::CrateStore;
1717
use middle::def_id::DefId;
1818
use middle::infer;
1919
use middle::traits::{self, ProjectionMode};
20-
use middle::ty::{self, ImplOrTraitItem, TraitDef, TypeFoldable};
20+
use middle::ty::{self, TyCtxt, ImplOrTraitItem, TraitDef, TypeFoldable};
2121
use syntax::ast::Name;
2222
use util::nodemap::DefIdMap;
2323

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

179179
/// Iterate over the items defined directly by the given (impl or trait) node.
180-
pub fn items<'a, 'tcx>(&self, tcx: &'a ty::ctxt<'tcx>) -> NodeItems<'a, 'tcx> {
180+
pub fn items<'a, 'tcx>(&self, tcx: &'a TyCtxt<'tcx>) -> NodeItems<'a, 'tcx> {
181181
match *self {
182182
Node::Impl(impl_def_id) => {
183183
NodeItems::Impl {
@@ -207,7 +207,7 @@ impl Node {
207207
/// An iterator over the items defined within a trait or impl.
208208
pub enum NodeItems<'a, 'tcx: 'a> {
209209
Impl {
210-
tcx: &'a ty::ctxt<'tcx>,
210+
tcx: &'a TyCtxt<'tcx>,
211211
items: cell::Ref<'a, Vec<ty::ImplOrTraitItemId>>,
212212
idx: usize,
213213
},
@@ -319,7 +319,7 @@ impl<'a, 'tcx> Iterator for ConstDefs<'a, 'tcx> {
319319
impl<'a, 'tcx> Ancestors<'a, 'tcx> {
320320
/// Search the items from the given ancestors, returning each type definition
321321
/// with the given name.
322-
pub fn type_defs(self, tcx: &'a ty::ctxt<'tcx>, name: Name) -> TypeDefs<'a, 'tcx> {
322+
pub fn type_defs(self, tcx: &'a TyCtxt<'tcx>, name: Name) -> TypeDefs<'a, 'tcx> {
323323
let iter = self.flat_map(move |node| {
324324
node.items(tcx)
325325
.filter_map(move |item| {
@@ -340,7 +340,7 @@ impl<'a, 'tcx> Ancestors<'a, 'tcx> {
340340

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

362362
/// Search the items from the given ancestors, returning each const
363363
/// definition with the given name.
364-
pub fn const_defs(self, tcx: &'a ty::ctxt<'tcx>, name: Name) -> ConstDefs<'a, 'tcx> {
364+
pub fn const_defs(self, tcx: &'a TyCtxt<'tcx>, name: Name) -> ConstDefs<'a, 'tcx> {
365365
let iter = self.flat_map(move |node| {
366366
node.items(tcx)
367367
.filter_map(move |item| {

src/librustc/middle/ty/trait_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl<'tcx> TraitDef<'tcx> {
192192
/// overlap information if the impl overlaps but does not specialize an
193193
/// existing impl.
194194
pub fn add_impl_for_specialization<'a>(&self,
195-
tcx: &'a ctxt<'tcx>,
195+
tcx: &'a TyCtxt<'tcx>,
196196
impl_def_id: DefId)
197197
-> Result<(), traits::Overlap<'a, 'tcx>> {
198198
assert!(impl_def_id.is_local());

src/librustc_metadata/decoder.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use middle::lang_items;
3434
use middle::subst;
3535
use middle::ty::{ImplContainer, TraitContainer};
3636
use middle::ty::{self, Ty, TyCtxt, TypeFoldable, VariantKind};
37-
use middle::traits;
3837

3938
use rustc_const_eval::ConstInt;
4039

src/librustc_metadata/encoder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use middle::def_id::{CRATE_DEF_INDEX, DefId};
2525
use middle::dependency_format::Linkage;
2626
use middle::stability;
2727
use middle::subst;
28+
use middle::traits::specialization_graph;
2829
use middle::ty::{self, Ty, TyCtxt};
2930
use middle::ty::util::IntTypeExt;
3031

src/librustc_mir/mir_map.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ use rustc::mir::mir_map::MirMap;
2828
use rustc::middle::infer;
2929
use rustc::middle::region::CodeExtentData;
3030
use rustc::middle::traits::ProjectionMode;
31+
use rustc::middle::ty::{self, Ty, TyCtxt};
3132
use rustc::util::common::ErrorReported;
3233
use rustc::util::nodemap::NodeMap;
3334
use rustc_front::hir;

src/librustc_trans/trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ pub struct ImplMethod<'tcx> {
478478
}
479479

480480
/// Locates the applicable definition of a method, given its name.
481-
pub fn get_impl_method<'tcx>(tcx: &ty::ctxt<'tcx>,
481+
pub fn get_impl_method<'tcx>(tcx: &TyCtxt<'tcx>,
482482
impl_def_id: DefId,
483483
substs: Substs<'tcx>,
484484
name: Name)

src/librustc_typeck/check/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ fn check_method_body<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
864864
check_bare_fn(ccx, &sig.decl, body, id, span, fty, param_env);
865865
}
866866

867-
fn report_forbidden_specialization(tcx: &ty::ctxt,
867+
fn report_forbidden_specialization(tcx: &TyCtxt,
868868
impl_item: &hir::ImplItem,
869869
parent_impl: DefId)
870870
{
@@ -887,7 +887,7 @@ fn report_forbidden_specialization(tcx: &ty::ctxt,
887887
err.emit();
888888
}
889889

890-
fn check_specialization_validity<'tcx>(tcx: &ty::ctxt<'tcx>, trait_def: &ty::TraitDef<'tcx>,
890+
fn check_specialization_validity<'tcx>(tcx: &TyCtxt<'tcx>, trait_def: &ty::TraitDef<'tcx>,
891891
impl_id: DefId, impl_item: &hir::ImplItem)
892892
{
893893
let ancestors = trait_def.ancestors(impl_id);

src/librustc_typeck/coherence/overlap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use middle::cstore::CrateStore;
1616
use middle::traits;
1717
use middle::ty::{self, TyCtxt};
18-
use middle::infer;
1918
use syntax::ast;
2019
use rustc::dep_graph::DepNode;
2120
use rustc_front::hir;

src/libsyntax/feature_gate.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,10 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Option<u32>, Status
247247
("inclusive_range_syntax", "1.7.0", Some(28237), Active),
248248

249249
// `expr?`
250-
("question_mark", "1.9.0", Some(31436), Active)
250+
("question_mark", "1.9.0", Some(31436), Active),
251251

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

0 commit comments

Comments
 (0)