Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 1254fe9

Browse files
committed
Remove {Method,Trait}Def::is_unsafe.
They are always `false`.
1 parent d13fa0d commit 1254fe9

File tree

12 files changed

+2
-37
lines changed

12 files changed

+2
-37
lines changed

compiler/rustc_builtin_macros/src/deriving/bounds.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub fn expand_deriving_copy(
1919
path: path_std!(marker::Copy),
2020
additional_bounds: Vec::new(),
2121
generics: Bounds::empty(),
22-
is_unsafe: false,
2322
supports_unions: true,
2423
methods: Vec::new(),
2524
associated_types: Vec::new(),

compiler/rustc_builtin_macros/src/deriving/clone.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub fn expand_deriving_clone(
8181
path: path_std!(clone::Clone),
8282
additional_bounds: bounds,
8383
generics: Bounds::empty(),
84-
is_unsafe: false,
8584
supports_unions: true,
8685
methods: vec![MethodDef {
8786
name: sym::clone,
@@ -90,7 +89,6 @@ pub fn expand_deriving_clone(
9089
args: Vec::new(),
9190
ret_ty: Self_,
9291
attributes: attrs,
93-
is_unsafe: false,
9492
unify_fieldless_variants: false,
9593
combine_substructure: substructure,
9694
}],

compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pub fn expand_deriving_eq(
2727
path: path_std!(cmp::Eq),
2828
additional_bounds: Vec::new(),
2929
generics: Bounds::empty(),
30-
is_unsafe: false,
3130
supports_unions: true,
3231
methods: vec![MethodDef {
3332
name: sym::assert_receiver_is_total_eq,
@@ -36,7 +35,6 @@ pub fn expand_deriving_eq(
3635
args: vec![],
3736
ret_ty: nil_ty(),
3837
attributes: attrs,
39-
is_unsafe: false,
4038
unify_fieldless_variants: true,
4139
combine_substructure: combine_substructure(Box::new(|a, b, c| {
4240
cs_total_eq_assert(a, b, c)

compiler/rustc_builtin_macros/src/deriving/cmp/ord.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ pub fn expand_deriving_ord(
2323
path: path_std!(cmp::Ord),
2424
additional_bounds: Vec::new(),
2525
generics: Bounds::empty(),
26-
is_unsafe: false,
2726
supports_unions: false,
2827
methods: vec![MethodDef {
2928
name: sym::cmp,
@@ -32,7 +31,6 @@ pub fn expand_deriving_ord(
3231
args: vec![(borrowed_self(), sym::other)],
3332
ret_ty: Literal(path_std!(cmp::Ordering)),
3433
attributes: attrs,
35-
is_unsafe: false,
3634
unify_fieldless_variants: true,
3735
combine_substructure: combine_substructure(Box::new(|a, b, c| cs_cmp(a, b, c))),
3836
}],

compiler/rustc_builtin_macros/src/deriving/cmp/partial_eq.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ pub fn expand_deriving_partial_eq(
7373
args: vec![(borrowed_self(), sym::other)],
7474
ret_ty: Literal(path_local!(bool)),
7575
attributes: attrs,
76-
is_unsafe: false,
7776
unify_fieldless_variants: true,
7877
combine_substructure: combine_substructure(Box::new(|a, b, c| $f(a, b, c))),
7978
}
@@ -102,7 +101,6 @@ pub fn expand_deriving_partial_eq(
102101
path: path_std!(cmp::PartialEq),
103102
additional_bounds: Vec::new(),
104103
generics: Bounds::empty(),
105-
is_unsafe: false,
106104
supports_unions: false,
107105
methods,
108106
associated_types: Vec::new(),

compiler/rustc_builtin_macros/src/deriving/cmp/partial_ord.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ pub fn expand_deriving_partial_ord(
3333
args: vec![(borrowed_self(), sym::other)],
3434
ret_ty,
3535
attributes: attrs,
36-
is_unsafe: false,
3736
unify_fieldless_variants: true,
3837
combine_substructure: combine_substructure(Box::new(|cx, span, substr| {
3938
cs_partial_cmp(cx, span, substr)
@@ -46,7 +45,6 @@ pub fn expand_deriving_partial_ord(
4645
path: path_std!(cmp::PartialOrd),
4746
additional_bounds: vec![],
4847
generics: Bounds::empty(),
49-
is_unsafe: false,
5048
supports_unions: false,
5149
methods: vec![partial_cmp_def],
5250
associated_types: Vec::new(),

compiler/rustc_builtin_macros/src/deriving/debug.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pub fn expand_deriving_debug(
2525
path: path_std!(fmt::Debug),
2626
additional_bounds: Vec::new(),
2727
generics: Bounds::empty(),
28-
is_unsafe: false,
2928
supports_unions: false,
3029
methods: vec![MethodDef {
3130
name: sym::fmt,
@@ -34,7 +33,6 @@ pub fn expand_deriving_debug(
3433
args: vec![(fmtr, sym::f)],
3534
ret_ty: Literal(path_std!(fmt::Result)),
3635
attributes: Vec::new(),
37-
is_unsafe: false,
3836
unify_fieldless_variants: false,
3937
combine_substructure: combine_substructure(Box::new(|a, b, c| {
4038
show_substructure(a, b, c)

compiler/rustc_builtin_macros/src/deriving/decodable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub fn expand_deriving_rustc_decodable(
2626
path: Path::new_(vec![krate, sym::Decodable], None, vec![], PathKind::Global),
2727
additional_bounds: Vec::new(),
2828
generics: Bounds::empty(),
29-
is_unsafe: false,
3029
supports_unions: false,
3130
methods: vec![MethodDef {
3231
name: sym::decode,
@@ -56,7 +55,6 @@ pub fn expand_deriving_rustc_decodable(
5655
PathKind::Std,
5756
)),
5857
attributes: Vec::new(),
59-
is_unsafe: false,
6058
unify_fieldless_variants: false,
6159
combine_substructure: combine_substructure(Box::new(|a, b, c| {
6260
decodable_substructure(a, b, c, krate)

compiler/rustc_builtin_macros/src/deriving/default.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ pub fn expand_deriving_default(
3030
path: Path::new(vec![kw::Default, sym::Default]),
3131
additional_bounds: Vec::new(),
3232
generics: Bounds::empty(),
33-
is_unsafe: false,
3433
supports_unions: false,
3534
methods: vec![MethodDef {
3635
name: kw::Default,
@@ -39,7 +38,6 @@ pub fn expand_deriving_default(
3938
args: Vec::new(),
4039
ret_ty: Self_,
4140
attributes: attrs,
42-
is_unsafe: false,
4341
unify_fieldless_variants: false,
4442
combine_substructure: combine_substructure(Box::new(|cx, trait_span, substr| {
4543
match substr.fields {

compiler/rustc_builtin_macros/src/deriving/encodable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ pub fn expand_deriving_rustc_encodable(
111111
path: Path::new_(vec![krate, sym::Encodable], None, vec![], PathKind::Global),
112112
additional_bounds: Vec::new(),
113113
generics: Bounds::empty(),
114-
is_unsafe: false,
115114
supports_unions: false,
116115
methods: vec![MethodDef {
117116
name: sym::encode,
@@ -141,7 +140,6 @@ pub fn expand_deriving_rustc_encodable(
141140
PathKind::Std,
142141
)),
143142
attributes: Vec::new(),
144-
is_unsafe: false,
145143
unify_fieldless_variants: false,
146144
combine_substructure: combine_substructure(Box::new(|a, b, c| {
147145
encodable_substructure(a, b, c, krate)

0 commit comments

Comments
 (0)