Skip to content

Commit

Permalink
Remove usage of #[static_assert]
Browse files Browse the repository at this point in the history
It’s probably going away: rust-lang/rfcs#1096
  • Loading branch information
SimonSapin committed May 11, 2015
1 parent c5912f9 commit 46176c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#![crate_name="string_cache_plugin"]
#![crate_type="dylib"]

#![feature(plugin_registrar, quote, box_syntax, static_assert)]
#![feature(plugin_registrar, quote, box_syntax)]
#![feature(rustc_private, slice_patterns)]
#![deny(warnings)]
#![allow(unused_imports)] // for quotes
Expand Down
9 changes: 4 additions & 5 deletions shared/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! the macros crate and the run-time library, in order to guarantee
//! consistency.
#![feature(core, static_assert)]
#![feature(core)]
#![deny(warnings)]

use std::{mem, raw, intrinsics};
Expand Down Expand Up @@ -42,10 +42,10 @@ pub enum UnpackedAtom {

const STATIC_SHIFT_BITS: usize = 32;

#[cfg(target_endian = "little")] // Not implemented yet for big-endian
#[inline(always)]
unsafe fn inline_atom_slice(x: &u64) -> raw::Slice<u8> {
#[static_assert]
const _IS_LITTLE_ENDIAN: bool = cfg!(target_endian = "little");
const _IS_LITTLE_ENDIAN: bool = cfg!();

let x: *const u64 = x;
raw::Slice {
Expand Down Expand Up @@ -82,8 +82,7 @@ impl UnpackedAtom {

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

match (data & 0xf) as u8 {
DYNAMIC_TAG => Dynamic(data as *mut ()),
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#![crate_name = "string_cache"]
#![crate_type = "rlib"]

#![feature(plugin, unsafe_no_drop_flag, static_assert)]
#![feature(plugin, unsafe_no_drop_flag)]
#![feature(core, collections, alloc, hash)]
#![deny(warnings)]
#![cfg_attr(test, feature(test))]
Expand Down

0 comments on commit 46176c6

Please sign in to comment.