Skip to content

Commit e7c42f0

Browse files
committed
Tiny cleanup to size assertions
1 parent 56237d7 commit e7c42f0

File tree

4 files changed

+4
-13
lines changed

4 files changed

+4
-13
lines changed

src/librustc_errors/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ use Level::*;
1515

1616
use emitter::{Emitter, EmitterWriter, is_case_difference};
1717
use registry::Registry;
18-
#[cfg(target_arch = "x86_64")]
19-
use rustc_data_structures::static_assert_size;
2018
use rustc_data_structures::sync::{self, Lrc, Lock};
2119
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
2220
use rustc_data_structures::stable_hasher::StableHasher;
@@ -54,7 +52,7 @@ pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;
5452
// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
5553
// (See also the comment on `DiagnosticBuilderInner`.)
5654
#[cfg(target_arch = "x86_64")]
57-
static_assert_size!(PResult<'_, bool>, 16);
55+
rustc_data_structures::static_assert_size!(PResult<'_, bool>, 16);
5856

5957
/// Indicates the confidence in the correctness of a suggestion.
6058
///

src/libsyntax/ast.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ use rustc_data_structures::thin_vec::ThinVec;
3838
use rustc_index::vec::Idx;
3939
use rustc_serialize::{self, Decoder, Encoder};
4040

41-
#[cfg(target_arch = "x86_64")]
42-
use rustc_data_structures::static_assert_size;
43-
4441
use std::fmt;
4542

4643
#[cfg(test)]
@@ -1028,7 +1025,7 @@ pub struct Expr {
10281025

10291026
// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
10301027
#[cfg(target_arch = "x86_64")]
1031-
static_assert_size!(Expr, 96);
1028+
rustc_data_structures::static_assert_size!(Expr, 96);
10321029

10331030
impl Expr {
10341031
/// Returns `true` if this expression would be valid somewhere that expects a value;

src/libsyntax/token.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use syntax_pos::{self, Span, DUMMY_SP};
1414

1515
use std::fmt;
1616
use std::mem;
17-
#[cfg(target_arch = "x86_64")]
18-
use rustc_data_structures::static_assert_size;
1917
use rustc_data_structures::sync::Lrc;
2018

2119
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
@@ -261,7 +259,7 @@ pub enum TokenKind {
261259

262260
// `TokenKind` is used a lot. Make sure it doesn't unintentionally get bigger.
263261
#[cfg(target_arch = "x86_64")]
264-
static_assert_size!(TokenKind, 16);
262+
rustc_data_structures::static_assert_size!(TokenKind, 16);
265263

266264
#[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug)]
267265
pub struct Token {

src/libsyntax/tokenstream.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use crate::token::{self, DelimToken, Token, TokenKind};
1717

1818
use syntax_pos::{Span, DUMMY_SP};
19-
#[cfg(target_arch = "x86_64")]
20-
use rustc_data_structures::static_assert_size;
2119
use rustc_data_structures::sync::Lrc;
2220
use smallvec::{SmallVec, smallvec};
2321

@@ -129,7 +127,7 @@ pub type TreeAndJoint = (TokenTree, IsJoint);
129127

130128
// `TokenStream` is used a lot. Make sure it doesn't unintentionally get bigger.
131129
#[cfg(target_arch = "x86_64")]
132-
static_assert_size!(TokenStream, 8);
130+
rustc_data_structures::static_assert_size!(TokenStream, 8);
133131

134132
#[derive(Clone, Copy, Debug, PartialEq, RustcEncodable, RustcDecodable)]
135133
pub enum IsJoint {

0 commit comments

Comments
 (0)