Skip to content

Commit 3720402

Browse files
committed
Rename ty_param_bound to trait_bound
1 parent 95f1866 commit 3720402

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/librustc_privacy/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,9 +1037,8 @@ impl<'a, 'tcx> ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
10371037
self.access_levels.is_public(trait_id)
10381038
}
10391039

1040-
fn check_ty_param_bound(&mut self,
1041-
ty_param_bound: &hir::GenericBound) {
1042-
if let hir::GenericBound::Trait(ref trait_ref, _) = *ty_param_bound {
1040+
fn check_ty_param_bound(&mut self, bound: &hir::GenericBound) {
1041+
if let hir::GenericBound::Trait(ref trait_ref, _) = *bound {
10431042
if self.path_is_private_type(&trait_ref.trait_ref.path) {
10441043
self.old_error_set.insert(trait_ref.trait_ref.ref_id);
10451044
}

src/libsyntax/ext/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub trait AstBuilder {
7373

7474
fn trait_ref(&self, path: ast::Path) -> ast::TraitRef;
7575
fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef;
76-
fn ty_param_bound(&self, path: ast::Path) -> ast::GenericBound;
76+
fn trait_bound(&self, path: ast::Path) -> ast::GenericBound;
7777
fn lifetime(&self, span: Span, ident: ast::Ident) -> ast::Lifetime;
7878
fn lifetime_def(&self,
7979
span: Span,
@@ -464,7 +464,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
464464
}
465465
}
466466

467-
fn ty_param_bound(&self, path: ast::Path) -> ast::GenericBound {
467+
fn trait_bound(&self, path: ast::Path) -> ast::GenericBound {
468468
ast::GenericBound::Trait(self.poly_trait_ref(path.span, path),
469469
ast::TraitBoundModifier::None)
470470
}

src/libsyntax_ext/deriving/generic/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,11 @@ impl<'a> TraitDef<'a> {
558558
// extra restrictions on the generics parameters to the
559559
// type being derived upon
560560
self.additional_bounds.iter().map(|p| {
561-
cx.ty_param_bound(p.to_path(cx, self.span, type_ident, generics))
561+
cx.trait_bound(p.to_path(cx, self.span, type_ident, generics))
562562
}).collect();
563563

564564
// require the current trait
565-
bounds.push(cx.ty_param_bound(trait_path.clone()));
565+
bounds.push(cx.trait_bound(trait_path.clone()));
566566

567567
// also add in any bounds from the declaration
568568
for declared_bound in &param.bounds {
@@ -634,12 +634,12 @@ impl<'a> TraitDef<'a> {
634634
let mut bounds: Vec<_> = self.additional_bounds
635635
.iter()
636636
.map(|p| {
637-
cx.ty_param_bound(p.to_path(cx, self.span, type_ident, generics))
637+
cx.trait_bound(p.to_path(cx, self.span, type_ident, generics))
638638
})
639639
.collect();
640640

641641
// require the current trait
642-
bounds.push(cx.ty_param_bound(trait_path.clone()));
642+
bounds.push(cx.trait_bound(trait_path.clone()));
643643

644644
let predicate = ast::WhereBoundPredicate {
645645
span: self.span,

src/libsyntax_ext/deriving/generic/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fn mk_ty_param(cx: &ExtCtxt,
219219
let bounds = bounds.iter()
220220
.map(|b| {
221221
let path = b.to_path(cx, span, self_ident, self_generics);
222-
cx.ty_param_bound(path)
222+
cx.trait_bound(path)
223223
})
224224
.collect();
225225
cx.typaram(span, cx.ident_of(name), attrs.to_owned(), bounds, None)

0 commit comments

Comments
 (0)