Skip to content

Commit 2170479

Browse files
committed
Rename middle::ty::ctxt to TyCtxt
1 parent 6017e75 commit 2170479

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

clean/inline.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use rustc_front::hir;
1919
use rustc::middle::cstore::{self, CrateStore};
2020
use rustc::middle::def::Def;
2121
use rustc::middle::def_id::DefId;
22-
use rustc::middle::ty;
22+
use rustc::middle::ty::{self, TyCtxt};
2323
use rustc::middle::subst;
2424
use rustc::middle::stability;
2525
use rustc::middle::const_eval;
@@ -67,7 +67,7 @@ pub fn try_inline(cx: &DocContext, id: ast::NodeId, into: Option<ast::Name>)
6767
})
6868
}
6969

70-
fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
70+
fn try_inline_def(cx: &DocContext, tcx: &TyCtxt,
7171
def: Def) -> Option<Vec<clean::Item>> {
7272
let mut ret = Vec::new();
7373
let did = def.def_id();
@@ -128,7 +128,7 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
128128
Some(ret)
129129
}
130130

131-
pub fn load_attrs(cx: &DocContext, tcx: &ty::ctxt,
131+
pub fn load_attrs(cx: &DocContext, tcx: &TyCtxt,
132132
did: DefId) -> Vec<clean::Attribute> {
133133
tcx.get_attrs(did).iter().map(|a| a.clean(cx)).collect()
134134
}
@@ -148,7 +148,7 @@ pub fn record_extern_fqn(cx: &DocContext, did: DefId, kind: clean::TypeKind) {
148148
}
149149
}
150150

151-
pub fn build_external_trait(cx: &DocContext, tcx: &ty::ctxt,
151+
pub fn build_external_trait(cx: &DocContext, tcx: &TyCtxt,
152152
did: DefId) -> clean::Trait {
153153
let def = tcx.lookup_trait_def(did);
154154
let trait_items = tcx.trait_items(did).clean(cx);
@@ -164,7 +164,7 @@ pub fn build_external_trait(cx: &DocContext, tcx: &ty::ctxt,
164164
}
165165
}
166166

167-
fn build_external_function(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::Function {
167+
fn build_external_function(cx: &DocContext, tcx: &TyCtxt, did: DefId) -> clean::Function {
168168
let t = tcx.lookup_item_type(did);
169169
let (decl, style, abi) = match t.ty.sty {
170170
ty::TyBareFn(_, ref f) => ((did, &f.sig).clean(cx), f.unsafety, f.abi),
@@ -187,7 +187,7 @@ fn build_external_function(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean
187187
}
188188
}
189189

190-
fn build_struct(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::Struct {
190+
fn build_struct(cx: &DocContext, tcx: &TyCtxt, did: DefId) -> clean::Struct {
191191
let t = tcx.lookup_item_type(did);
192192
let predicates = tcx.lookup_predicates(did);
193193
let variant = tcx.lookup_adt_def(did).struct_variant();
@@ -205,7 +205,7 @@ fn build_struct(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::Struct {
205205
}
206206
}
207207

208-
fn build_type(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::ItemEnum {
208+
fn build_type(cx: &DocContext, tcx: &TyCtxt, did: DefId) -> clean::ItemEnum {
209209
let t = tcx.lookup_item_type(did);
210210
let predicates = tcx.lookup_predicates(did);
211211
match t.ty.sty {
@@ -225,7 +225,7 @@ fn build_type(cx: &DocContext, tcx: &ty::ctxt, did: DefId) -> clean::ItemEnum {
225225
}, false)
226226
}
227227

228-
pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
228+
pub fn build_impls(cx: &DocContext, tcx: &TyCtxt,
229229
did: DefId) -> Vec<clean::Item> {
230230
tcx.populate_inherent_implementations_for_type_if_necessary(did);
231231
let mut impls = Vec::new();
@@ -252,7 +252,7 @@ pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
252252
populate_impls(cx, tcx, item.def, &mut impls);
253253
}
254254

255-
fn populate_impls(cx: &DocContext, tcx: &ty::ctxt,
255+
fn populate_impls(cx: &DocContext, tcx: &TyCtxt,
256256
def: cstore::DefLike,
257257
impls: &mut Vec<clean::Item>) {
258258
match def {
@@ -276,7 +276,7 @@ pub fn build_impls(cx: &DocContext, tcx: &ty::ctxt,
276276
}
277277

278278
pub fn build_impl(cx: &DocContext,
279-
tcx: &ty::ctxt,
279+
tcx: &TyCtxt,
280280
did: DefId,
281281
ret: &mut Vec<clean::Item>) {
282282
if !cx.inlined.borrow_mut().as_mut().unwrap().insert(did) {
@@ -442,7 +442,7 @@ fn is_doc_hidden(a: &clean::Attribute) -> bool {
442442
}
443443
}
444444

445-
fn build_module(cx: &DocContext, tcx: &ty::ctxt,
445+
fn build_module(cx: &DocContext, tcx: &TyCtxt,
446446
did: DefId) -> clean::Module {
447447
let mut items = Vec::new();
448448
fill_in(cx, tcx, did, &mut items);
@@ -451,7 +451,7 @@ fn build_module(cx: &DocContext, tcx: &ty::ctxt,
451451
is_crate: false,
452452
};
453453

454-
fn fill_in(cx: &DocContext, tcx: &ty::ctxt, did: DefId,
454+
fn fill_in(cx: &DocContext, tcx: &TyCtxt, did: DefId,
455455
items: &mut Vec<clean::Item>) {
456456
// If we're reexporting a reexport it may actually reexport something in
457457
// two namespaces, so the target may be listed twice. Make sure we only
@@ -478,7 +478,7 @@ fn build_module(cx: &DocContext, tcx: &ty::ctxt,
478478
}
479479
}
480480

481-
fn build_const(cx: &DocContext, tcx: &ty::ctxt,
481+
fn build_const(cx: &DocContext, tcx: &TyCtxt,
482482
did: DefId) -> clean::Constant {
483483
use rustc::middle::const_eval;
484484
use rustc_front::print::pprust;
@@ -496,7 +496,7 @@ fn build_const(cx: &DocContext, tcx: &ty::ctxt,
496496
}
497497
}
498498

499-
fn build_static(cx: &DocContext, tcx: &ty::ctxt,
499+
fn build_static(cx: &DocContext, tcx: &TyCtxt,
500500
did: DefId,
501501
mutable: bool) -> clean::Static {
502502
clean::Static {

clean/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ pub struct PolyTrait {
14081408
}
14091409

14101410
/// A representation of a Type suitable for hyperlinking purposes. Ideally one can get the original
1411-
/// type out of the AST/ty::ctxt given one of these, if more information is needed. Most importantly
1411+
/// type out of the AST/TyCtxt given one of these, if more information is needed. Most importantly
14121412
/// it does not preserve mutability or boxes.
14131413
#[derive(Clone, RustcEncodable, RustcDecodable, PartialEq, Debug)]
14141414
pub enum Type {

core.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use rustc::dep_graph::DepGraph;
1515
use rustc::session::{self, config};
1616
use rustc::middle::def_id::DefId;
1717
use rustc::middle::privacy::AccessLevels;
18-
use rustc::middle::ty;
18+
use rustc::middle::ty::{self, TyCtxt};
1919
use rustc::front::map as hir_map;
2020
use rustc::lint;
2121
use rustc_trans::back::link;
@@ -41,7 +41,7 @@ pub use rustc::session::search_paths::SearchPaths;
4141

4242
/// Are we generating documentation (`Typed`) or tests (`NotTyped`)?
4343
pub enum MaybeTyped<'a, 'tcx: 'a> {
44-
Typed(&'a ty::ctxt<'tcx>),
44+
Typed(&'a TyCtxt<'tcx>),
4545
NotTyped(&'a session::Session)
4646
}
4747

@@ -68,14 +68,14 @@ impl<'b, 'tcx> DocContext<'b, 'tcx> {
6868
}
6969
}
7070

71-
pub fn tcx_opt<'a>(&'a self) -> Option<&'a ty::ctxt<'tcx>> {
71+
pub fn tcx_opt<'a>(&'a self) -> Option<&'a TyCtxt<'tcx>> {
7272
match self.maybe_typed {
7373
Typed(tcx) => Some(tcx),
7474
NotTyped(_) => None
7575
}
7676
}
7777

78-
pub fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx> {
78+
pub fn tcx<'a>(&'a self) -> &'a TyCtxt<'tcx> {
7979
let tcx_opt = self.tcx_opt();
8080
tcx_opt.expect("tcx not present")
8181
}

0 commit comments

Comments
 (0)