Skip to content

Commit 49da403

Browse files
committed
Remove usage of #[static_assert]
It’s probably going away: rust-lang/rfcs#1096
1 parent c5912f9 commit 49da403

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

plugin/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#![crate_name="string_cache_plugin"]
1111
#![crate_type="dylib"]
1212

13-
#![feature(plugin_registrar, quote, box_syntax, static_assert)]
13+
#![feature(plugin_registrar, quote, box_syntax)]
1414
#![feature(rustc_private, slice_patterns)]
1515
#![deny(warnings)]
1616
#![allow(unused_imports)] // for quotes

shared/lib.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! the macros crate and the run-time library, in order to guarantee
1212
//! consistency.
1313
14-
#![feature(core, static_assert)]
14+
#![feature(core)]
1515
#![deny(warnings)]
1616

1717
use std::{mem, raw, intrinsics};
@@ -42,11 +42,9 @@ pub enum UnpackedAtom {
4242

4343
const STATIC_SHIFT_BITS: usize = 32;
4444

45+
#[cfg(target_endian = "little")] // Not implemented yet for big-endian
4546
#[inline(always)]
4647
unsafe fn inline_atom_slice(x: &u64) -> raw::Slice<u8> {
47-
#[static_assert]
48-
const _IS_LITTLE_ENDIAN: bool = cfg!(target_endian = "little");
49-
5048
let x: *const u64 = x;
5149
raw::Slice {
5250
data: (x as *const u8).offset(1),
@@ -82,8 +80,7 @@ impl UnpackedAtom {
8280

8381
#[inline(always)]
8482
pub unsafe fn from_packed(data: u64) -> UnpackedAtom {
85-
#[static_assert]
86-
const _DYNAMIC_IS_UNTAGGED: bool = DYNAMIC_TAG == 0;
83+
debug_assert!(DYNAMIC_TAG == 0); // Dynamic is untagged
8784

8885
match (data & 0xf) as u8 {
8986
DYNAMIC_TAG => Dynamic(data as *mut ()),

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#![crate_name = "string_cache"]
1111
#![crate_type = "rlib"]
1212

13-
#![feature(plugin, unsafe_no_drop_flag, static_assert)]
13+
#![feature(plugin, unsafe_no_drop_flag)]
1414
#![feature(core, collections, alloc, hash)]
1515
#![deny(warnings)]
1616
#![cfg_attr(test, feature(test))]

0 commit comments

Comments
 (0)