Skip to content

Commit bcbecbc

Browse files
committed
---
yaml --- r: 233836 b: refs/heads/beta c: 7bb0d0d h: refs/heads/master v: v3
1 parent 2d23a2e commit bcbecbc

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: ec6c3dbae571c856d5de8b9c12183ea8c9708c25
26+
refs/heads/beta: 7bb0d0d74ca23cb871fd058a3fc6d935b7e47ae7
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_trans/trans/adt.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,12 @@ pub fn represent_type<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
177177
repr
178178
}
179179

180-
macro_rules! repeat_u8_as_u32 {
181-
($name:expr) => { (($name as u32) << 24 |
182-
($name as u32) << 16 |
183-
($name as u32) << 8 |
184-
($name as u32)) }
180+
const fn repeat_u8_as_u32(val: u8) -> u32 {
181+
(val as u32) << 24 | (val as u32) << 16 | (val as u32) << 8 | val as u32
185182
}
186-
macro_rules! repeat_u8_as_u64 {
187-
($name:expr) => { ((repeat_u8_as_u32!($name) as u64) << 32 |
188-
(repeat_u8_as_u32!($name) as u64)) }
183+
184+
const fn repeat_u8_as_u64(val: u8) -> u64 {
185+
(repeat_u8_as_u32(val) as u64) << 32 | repeat_u8_as_u32(val) as u64
189186
}
190187

191188
/// `DTOR_NEEDED_HINT` is a stack-local hint that just means
@@ -203,8 +200,8 @@ pub const DTOR_NEEDED_HINT: u8 = 0x3d;
203200
pub const DTOR_MOVED_HINT: u8 = 0x2d;
204201

205202
pub const DTOR_NEEDED: u8 = 0xd4;
206-
pub const DTOR_NEEDED_U32: u32 = repeat_u8_as_u32!(DTOR_NEEDED);
207-
pub const DTOR_NEEDED_U64: u64 = repeat_u8_as_u64!(DTOR_NEEDED);
203+
pub const DTOR_NEEDED_U32: u32 = repeat_u8_as_u32(DTOR_NEEDED);
204+
pub const DTOR_NEEDED_U64: u64 = repeat_u8_as_u64(DTOR_NEEDED);
208205
#[allow(dead_code)]
209206
pub fn dtor_needed_usize(ccx: &CrateContext) -> usize {
210207
match &ccx.tcx().sess.target.target.target_pointer_width[..] {
@@ -215,8 +212,8 @@ pub fn dtor_needed_usize(ccx: &CrateContext) -> usize {
215212
}
216213

217214
pub const DTOR_DONE: u8 = 0x1d;
218-
pub const DTOR_DONE_U32: u32 = repeat_u8_as_u32!(DTOR_DONE);
219-
pub const DTOR_DONE_U64: u64 = repeat_u8_as_u64!(DTOR_DONE);
215+
pub const DTOR_DONE_U32: u32 = repeat_u8_as_u32(DTOR_DONE);
216+
pub const DTOR_DONE_U64: u64 = repeat_u8_as_u64(DTOR_DONE);
220217
#[allow(dead_code)]
221218
pub fn dtor_done_usize(ccx: &CrateContext) -> usize {
222219
match &ccx.tcx().sess.target.target.target_pointer_width[..] {

branches/beta/src/libsyntax/ast.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,8 +1372,6 @@ pub struct TypeBinding {
13721372
pub span: Span,
13731373
}
13741374

1375-
1376-
// NB PartialEq method appears below.
13771375
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)]
13781376
pub struct Ty {
13791377
pub id: NodeId,

0 commit comments

Comments
 (0)