Skip to content

Commit 7a82927

Browse files
committed
Rename ty_param_bound to generic_bound
1 parent 4343c20 commit 7a82927

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/librustc_privacy/lib.rs

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

1040-
fn check_ty_param_bound(&mut self, bound: &hir::GenericBound) {
1040+
fn check_generic_bound(&mut self, bound: &hir::GenericBound) {
10411041
if let hir::GenericBound::Trait(ref trait_ref, _) = *bound {
10421042
if self.path_is_private_type(&trait_ref.trait_ref.path) {
10431043
self.old_error_set.insert(trait_ref.trait_ref.ref_id);
@@ -1100,7 +1100,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
11001100
}
11011101

11021102
for bound in bounds.iter() {
1103-
self.check_ty_param_bound(bound)
1103+
self.check_generic_bound(bound)
11041104
}
11051105
}
11061106

@@ -1271,15 +1271,15 @@ impl<'a, 'tcx> Visitor<'tcx> for ObsoleteVisiblePrivateTypesVisitor<'a, 'tcx> {
12711271
GenericParamKind::Lifetime { .. } => {}
12721272
GenericParamKind::Type { .. } => {
12731273
for bound in &param.bounds {
1274-
self.check_ty_param_bound(bound);
1274+
self.check_generic_bound(bound);
12751275
}
12761276
}
12771277
});
12781278
for predicate in &generics.where_clause.predicates {
12791279
match predicate {
12801280
&hir::WherePredicate::BoundPredicate(ref bound_pred) => {
12811281
for bound in bound_pred.bounds.iter() {
1282-
self.check_ty_param_bound(bound)
1282+
self.check_generic_bound(bound)
12831283
}
12841284
}
12851285
&hir::WherePredicate::RegionPredicate(_) => {}

src/libsyntax/parse/parser.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,21 +1509,21 @@ impl<'a> Parser<'a> {
15091509
}
15101510
} else if self.eat_keyword(keywords::Impl) {
15111511
// Always parse bounds greedily for better error recovery.
1512-
let bounds = self.parse_ty_param_bounds()?;
1512+
let bounds = self.parse_generic_bounds()?;
15131513
impl_dyn_multi = bounds.len() > 1 || self.prev_token_kind == PrevTokenKind::Plus;
15141514
TyKind::ImplTrait(bounds)
15151515
} else if self.check_keyword(keywords::Dyn) &&
15161516
self.look_ahead(1, |t| t.can_begin_bound() &&
15171517
!can_continue_type_after_non_fn_ident(t)) {
15181518
self.bump(); // `dyn`
15191519
// Always parse bounds greedily for better error recovery.
1520-
let bounds = self.parse_ty_param_bounds()?;
1520+
let bounds = self.parse_generic_bounds()?;
15211521
impl_dyn_multi = bounds.len() > 1 || self.prev_token_kind == PrevTokenKind::Plus;
15221522
TyKind::TraitObject(bounds, TraitObjectSyntax::Dyn)
15231523
} else if self.check(&token::Question) ||
15241524
self.check_lifetime() && self.look_ahead(1, |t| t.is_like_plus()) {
15251525
// Bound list (trait object type)
1526-
TyKind::TraitObject(self.parse_ty_param_bounds_common(allow_plus)?,
1526+
TyKind::TraitObject(self.parse_generic_bounds_common(allow_plus)?,
15271527
TraitObjectSyntax::None)
15281528
} else if self.eat_lt() {
15291529
// Qualified path
@@ -1569,7 +1569,7 @@ impl<'a> Parser<'a> {
15691569
let mut bounds = vec![GenericBound::Trait(poly_trait_ref, TraitBoundModifier::None)];
15701570
if parse_plus {
15711571
self.eat_plus(); // `+`, or `+=` gets split and `+` is discarded
1572-
bounds.append(&mut self.parse_ty_param_bounds()?);
1572+
bounds.append(&mut self.parse_generic_bounds()?);
15731573
}
15741574
Ok(TyKind::TraitObject(bounds, TraitObjectSyntax::None))
15751575
}
@@ -1594,7 +1594,7 @@ impl<'a> Parser<'a> {
15941594
}
15951595

15961596
self.bump(); // `+`
1597-
let bounds = self.parse_ty_param_bounds()?;
1597+
let bounds = self.parse_generic_bounds()?;
15981598
let sum_span = ty.span.to(self.prev_span);
15991599

16001600
let mut err = struct_span_err!(self.sess.span_diagnostic, sum_span, E0178,
@@ -4735,7 +4735,7 @@ impl<'a> Parser<'a> {
47354735
// LT_BOUND = LIFETIME (e.g. `'a`)
47364736
// TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
47374737
// TY_BOUND_NOPAREN = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
4738-
fn parse_ty_param_bounds_common(&mut self, allow_plus: bool) -> PResult<'a, GenericBounds> {
4738+
fn parse_generic_bounds_common(&mut self, allow_plus: bool) -> PResult<'a, GenericBounds> {
47394739
let mut bounds = Vec::new();
47404740
loop {
47414741
// This needs to be syncronized with `Token::can_begin_bound`.
@@ -4784,8 +4784,8 @@ impl<'a> Parser<'a> {
47844784
return Ok(bounds);
47854785
}
47864786

4787-
fn parse_ty_param_bounds(&mut self) -> PResult<'a, GenericBounds> {
4788-
self.parse_ty_param_bounds_common(true)
4787+
fn parse_generic_bounds(&mut self) -> PResult<'a, GenericBounds> {
4788+
self.parse_generic_bounds_common(true)
47894789
}
47904790

47914791
// Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
@@ -4810,7 +4810,7 @@ impl<'a> Parser<'a> {
48104810

48114811
// Parse optional colon and param bounds.
48124812
let bounds = if self.eat(&token::Colon) {
4813-
self.parse_ty_param_bounds()?
4813+
self.parse_generic_bounds()?
48144814
} else {
48154815
Vec::new()
48164816
};
@@ -4841,7 +4841,7 @@ impl<'a> Parser<'a> {
48414841

48424842
// Parse optional colon and param bounds.
48434843
let bounds = if self.eat(&token::Colon) {
4844-
self.parse_ty_param_bounds()?
4844+
self.parse_generic_bounds()?
48454845
} else {
48464846
Vec::new()
48474847
};
@@ -5036,7 +5036,7 @@ impl<'a> Parser<'a> {
50365036
// or with mandatory equality sign and the second type.
50375037
let ty = self.parse_ty()?;
50385038
if self.eat(&token::Colon) {
5039-
let bounds = self.parse_ty_param_bounds()?;
5039+
let bounds = self.parse_generic_bounds()?;
50405040
where_clause.predicates.push(ast::WherePredicate::BoundPredicate(
50415041
ast::WhereBoundPredicate {
50425042
span: lo.to(self.prev_span),
@@ -5536,14 +5536,14 @@ impl<'a> Parser<'a> {
55365536

55375537
// Parse optional colon and supertrait bounds.
55385538
let bounds = if self.eat(&token::Colon) {
5539-
self.parse_ty_param_bounds()?
5539+
self.parse_generic_bounds()?
55405540
} else {
55415541
Vec::new()
55425542
};
55435543

55445544
if self.eat(&token::Eq) {
55455545
// it's a trait alias
5546-
let bounds = self.parse_ty_param_bounds()?;
5546+
let bounds = self.parse_generic_bounds()?;
55475547
tps.where_clause = self.parse_where_clause()?;
55485548
self.expect(&token::Semi)?;
55495549
if unsafety != Unsafety::Normal {

0 commit comments

Comments
 (0)