From 88fa5c6a45a533a78c698a22f4b16002a3bc9fc3 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 19 May 2019 13:59:44 +0300 Subject: Improve type size assertions Now they - Tell what the new size is, when it changes - Do not require passing an identifier --- src/libsyntax/parse/token.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 049fb6cb78b..068fc41c87a 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -19,7 +19,7 @@ use log::info; use std::fmt; use std::mem; #[cfg(target_arch = "x86_64")] -use rustc_data_structures::static_assert; +use rustc_data_structures::static_assert_size; use rustc_data_structures::sync::Lrc; #[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] @@ -74,7 +74,7 @@ pub enum Lit { } #[cfg(target_arch = "x86_64")] -static_assert!(MEM_SIZE_OF_LIT: mem::size_of::() == 8); +static_assert_size!(Lit, 8); impl Lit { crate fn literal_name(&self) -> &'static str { @@ -220,7 +220,7 @@ pub enum Token { // `Token` is used a lot. Make sure it doesn't unintentionally get bigger. #[cfg(target_arch = "x86_64")] -static_assert!(MEM_SIZE_OF_STATEMENT: mem::size_of::() == 16); +static_assert_size!(Token, 16); impl Token { /// Recovers a `Token` from an `ast::Ident`. This creates a raw identifier if necessary. -- cgit 1.4.1-3-g733a5