Skip to content

Commit bccff14

Browse files
committed
Simplify LifetimeBounds.
The `lifetimes` field is always empty. This commit removes it, and renames the type as `Bounds`.
1 parent 8e92f4f commit bccff14

File tree

13 files changed

+34
-52
lines changed

13 files changed

+34
-52
lines changed

src/librustc_builtin_macros/deriving/bounds.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn expand_deriving_copy(
1818
attributes: Vec::new(),
1919
path: path_std!(marker::Copy),
2020
additional_bounds: Vec::new(),
21-
generics: LifetimeBounds::empty(),
21+
generics: Bounds::empty(),
2222
is_unsafe: false,
2323
supports_unions: true,
2424
methods: Vec::new(),

src/librustc_builtin_macros/deriving/clone.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ pub fn expand_deriving_clone(
8080
attributes: Vec::new(),
8181
path: path_std!(clone::Clone),
8282
additional_bounds: bounds,
83-
generics: LifetimeBounds::empty(),
83+
generics: Bounds::empty(),
8484
is_unsafe: false,
8585
supports_unions: true,
8686
methods: vec![MethodDef {
8787
name: sym::clone,
88-
generics: LifetimeBounds::empty(),
88+
generics: Bounds::empty(),
8989
explicit_self: borrowed_explicit_self(),
9090
args: Vec::new(),
9191
ret_ty: Self_,

src/librustc_builtin_macros/deriving/cmp/eq.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ pub fn expand_deriving_eq(
2424
attributes: Vec::new(),
2525
path: path_std!(cmp::Eq),
2626
additional_bounds: Vec::new(),
27-
generics: LifetimeBounds::empty(),
27+
generics: Bounds::empty(),
2828
is_unsafe: false,
2929
supports_unions: true,
3030
methods: vec![MethodDef {
3131
name: sym::assert_receiver_is_total_eq,
32-
generics: LifetimeBounds::empty(),
32+
generics: Bounds::empty(),
3333
explicit_self: borrowed_explicit_self(),
3434
args: vec![],
3535
ret_ty: nil_ty(),
@@ -43,13 +43,7 @@ pub fn expand_deriving_eq(
4343
associated_types: Vec::new(),
4444
};
4545

46-
super::inject_impl_of_structural_trait(
47-
cx,
48-
span,
49-
item,
50-
path_std!(marker::StructuralEq),
51-
push,
52-
);
46+
super::inject_impl_of_structural_trait(cx, span, item, path_std!(marker::StructuralEq), push);
5347

5448
trait_def.expand_ext(cx, mitem, item, push, true)
5549
}

src/librustc_builtin_macros/deriving/cmp/ord.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ pub fn expand_deriving_ord(
2222
attributes: Vec::new(),
2323
path: path_std!(cmp::Ord),
2424
additional_bounds: Vec::new(),
25-
generics: LifetimeBounds::empty(),
25+
generics: Bounds::empty(),
2626
is_unsafe: false,
2727
supports_unions: false,
2828
methods: vec![MethodDef {
2929
name: sym::cmp,
30-
generics: LifetimeBounds::empty(),
30+
generics: Bounds::empty(),
3131
explicit_self: borrowed_explicit_self(),
3232
args: vec![(borrowed_self(), "other")],
3333
ret_ty: Literal(path_std!(cmp::Ordering)),

src/librustc_builtin_macros/deriving/cmp/partial_eq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub fn expand_deriving_partial_eq(
6969
let attrs = vec![cx.attribute(inline)];
7070
MethodDef {
7171
name: $name,
72-
generics: LifetimeBounds::empty(),
72+
generics: Bounds::empty(),
7373
explicit_self: borrowed_explicit_self(),
7474
args: vec![(borrowed_self(), "other")],
7575
ret_ty: Literal(path_local!(bool)),
@@ -102,7 +102,7 @@ pub fn expand_deriving_partial_eq(
102102
attributes: Vec::new(),
103103
path: path_std!(cmp::PartialEq),
104104
additional_bounds: Vec::new(),
105-
generics: LifetimeBounds::empty(),
105+
generics: Bounds::empty(),
106106
is_unsafe: false,
107107
supports_unions: false,
108108
methods,

src/librustc_builtin_macros/deriving/cmp/partial_ord.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn expand_deriving_partial_ord(
2323
let attrs = vec![cx.attribute(inline)];
2424
MethodDef {
2525
name: $name,
26-
generics: LifetimeBounds::empty(),
26+
generics: Bounds::empty(),
2727
explicit_self: borrowed_explicit_self(),
2828
args: vec![(borrowed_self(), "other")],
2929
ret_ty: Literal(path_local!(bool)),
@@ -50,7 +50,7 @@ pub fn expand_deriving_partial_ord(
5050

5151
let partial_cmp_def = MethodDef {
5252
name: sym::partial_cmp,
53-
generics: LifetimeBounds::empty(),
53+
generics: Bounds::empty(),
5454
explicit_self: borrowed_explicit_self(),
5555
args: vec![(borrowed_self(), "other")],
5656
ret_ty,
@@ -82,7 +82,7 @@ pub fn expand_deriving_partial_ord(
8282
attributes: vec![],
8383
path: path_std!(cmp::PartialOrd),
8484
additional_bounds: vec![],
85-
generics: LifetimeBounds::empty(),
85+
generics: Bounds::empty(),
8686
is_unsafe: false,
8787
supports_unions: false,
8888
methods,

src/librustc_builtin_macros/deriving/debug.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ pub fn expand_deriving_debug(
2525
attributes: Vec::new(),
2626
path: path_std!(fmt::Debug),
2727
additional_bounds: Vec::new(),
28-
generics: LifetimeBounds::empty(),
28+
generics: Bounds::empty(),
2929
is_unsafe: false,
3030
supports_unions: false,
3131
methods: vec![MethodDef {
3232
name: sym::fmt,
33-
generics: LifetimeBounds::empty(),
33+
generics: Bounds::empty(),
3434
explicit_self: borrowed_explicit_self(),
3535
args: vec![(fmtr, "f")],
3636
ret_ty: Literal(path_std!(fmt::Result)),

src/librustc_builtin_macros/deriving/decodable.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ pub fn expand_deriving_rustc_decodable(
2626
attributes: Vec::new(),
2727
path: Path::new_(vec![krate, "Decodable"], None, vec![], PathKind::Global),
2828
additional_bounds: Vec::new(),
29-
generics: LifetimeBounds::empty(),
29+
generics: Bounds::empty(),
3030
is_unsafe: false,
3131
supports_unions: false,
3232
methods: vec![MethodDef {
3333
name: sym::decode,
34-
generics: LifetimeBounds {
35-
lifetimes: Vec::new(),
34+
generics: Bounds {
3635
bounds: vec![(
3736
typaram,
3837
vec![Path::new_(vec![krate, "Decoder"], None, vec![], PathKind::Global)],

src/librustc_builtin_macros/deriving/default.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ pub fn expand_deriving_default(
2323
attributes: Vec::new(),
2424
path: path_std!(default::Default),
2525
additional_bounds: Vec::new(),
26-
generics: LifetimeBounds::empty(),
26+
generics: Bounds::empty(),
2727
is_unsafe: false,
2828
supports_unions: false,
2929
methods: vec![MethodDef {
3030
name: kw::Default,
31-
generics: LifetimeBounds::empty(),
31+
generics: Bounds::empty(),
3232
explicit_self: None,
3333
args: Vec::new(),
3434
ret_ty: Self_,

src/librustc_builtin_macros/deriving/encodable.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,12 @@ pub fn expand_deriving_rustc_encodable(
110110
attributes: Vec::new(),
111111
path: Path::new_(vec![krate, "Encodable"], None, vec![], PathKind::Global),
112112
additional_bounds: Vec::new(),
113-
generics: LifetimeBounds::empty(),
113+
generics: Bounds::empty(),
114114
is_unsafe: false,
115115
supports_unions: false,
116116
methods: vec![MethodDef {
117117
name: sym::encode,
118-
generics: LifetimeBounds {
119-
lifetimes: Vec::new(),
118+
generics: Bounds {
120119
bounds: vec![(
121120
typaram,
122121
vec![Path::new_(vec![krate, "Encoder"], None, vec![], PathKind::Global)],

0 commit comments

Comments
 (0)