From b73b45983df820af9b713f98e7a0154ff45739d3 Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Thu, 29 Jan 2015 12:13:31 -0500 Subject: [PATCH 1/5] Set up Travis CI support This was heavily based on servo/html5ever's .travis.yml file. --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..f2acd45 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +sudo: false +env: + global: + - secure: uytPp0Fs+LT3QDEhDM3LJWiLvT2AHbdWnXrPEs+bYshQwt9wST+KQnYLyRfBuGg2ux3pkZwsRUFexvN8pQ3ab4aU2P21Xo98TzdXRwXurNYePgk/3tykEH+JrL52DfjCWB1VsjzzFrP02XU0XtB30qWC/n+fxeMWT7JT2GVh/OE= +language: rust +script: + - cargo build + - cargo test +after_script: + - cd target + - curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh From f3cb67bc217ccb53a7ae8b6290c12cb2c2873180 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 29 Jan 2015 17:17:59 -0800 Subject: [PATCH 2/5] Get rid of doc upload for now This is based on the h5e config, which is also broken -- see servo/html5ever#76. --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index f2acd45..28692ac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,5 @@ sudo: false -env: - global: - - secure: uytPp0Fs+LT3QDEhDM3LJWiLvT2AHbdWnXrPEs+bYshQwt9wST+KQnYLyRfBuGg2ux3pkZwsRUFexvN8pQ3ab4aU2P21Xo98TzdXRwXurNYePgk/3tykEH+JrL52DfjCWB1VsjzzFrP02XU0XtB30qWC/n+fxeMWT7JT2GVh/OE= language: rust script: - cargo build - cargo test -after_script: - - cd target - - curl http://www.rust-ci.org/artifacts/put?t=$RUSTCI_TOKEN | sh From 76a5705a6bc7b208d4e347c8035c70cd1171f8ee Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 29 Jan 2015 17:19:58 -0800 Subject: [PATCH 3/5] Add Travis status to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 36e27e2..616dfcc 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # string-cache +[![Build Status](https://travis-ci.org/servo/string-cache.svg?branch=master)](https://travis-ci.org/servo/string-cache) + A string interning library for Rust, developed as part of the [Servo](https://github.com/servo/servo) project. From aa0482aea5f165b7f360e78338740cded114602b Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Thu, 29 Jan 2015 17:28:10 -0800 Subject: [PATCH 4/5] Upgrade to rustc 1.0.0-dev (c5961ad06 2015-01-28 21:49:38 +0000) Fixes #53. --- macros/src/lib.rs | 3 +-- shared/repr.rs | 7 ++----- src/atom/bench.rs | 3 --- src/atom/mod.rs | 22 ++++++++-------------- src/event.rs | 7 +------ src/lib.rs | 11 +---------- src/namespace.rs | 5 ++--- 7 files changed, 15 insertions(+), 43 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index e625ee2..adacbcd 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -11,11 +11,10 @@ #![crate_type="dylib"] #![feature(plugin_registrar, quote, int_uint, box_syntax)] +#![feature(rustc_private, core, std_misc)] #![deny(warnings)] #![allow(unused_imports)] // for quotes -#![allow(unstable)] -extern crate core; extern crate syntax; extern crate rustc; diff --git a/shared/repr.rs b/shared/repr.rs index 91f2c39..8e69d2e 100644 --- a/shared/repr.rs +++ b/shared/repr.rs @@ -13,11 +13,8 @@ #![allow(dead_code, unused_imports)] -use core::{mem, raw, intrinsics}; -use core::option::Option::{self, Some, None}; -use core::ptr::PtrExt; -use core::slice::{AsSlice, SliceExt}; -use core::slice::bytes; +use std::{mem, raw, intrinsics}; +use std::slice::bytes; pub use self::UnpackedAtom::{Dynamic, Inline, Static}; diff --git a/src/atom/bench.rs b/src/atom/bench.rs index d4f746d..3c61c36 100644 --- a/src/atom/bench.rs +++ b/src/atom/bench.rs @@ -131,8 +131,6 @@ macro_rules! bench_all ( mod $name { #![allow(unused_imports)] - use core::prelude::*; - use collections::vec::Vec; use test::{Bencher, black_box}; use std::string::ToString; use std::iter::repeat; @@ -190,7 +188,6 @@ macro_rules! bench_rand ( ($name:ident, $len:expr) => ( #[bench] fn $name(b: &mut Bencher) { use std::{str, rand}; - use std::slice::{AsSlice, SliceExt}; use std::rand::Rng; let mut gen = rand::weak_rng(); diff --git a/src/atom/mod.rs b/src/atom/mod.rs index adabea7..8d20877 100644 --- a/src/atom/mod.rs +++ b/src/atom/mod.rs @@ -9,20 +9,16 @@ #![allow(non_upper_case_globals)] -use core::prelude::*; - use phf::OrderedSet; use xxhash; -use core::fmt; -use core::iter::RandomAccessIterator; -use core::mem; -use core::ptr; -use core::slice::bytes; -use core::str; -use alloc::heap; -use alloc::boxed::Box; -use collections::string::String; +use std::fmt; +use std::iter::RandomAccessIterator; +use std::mem; +use std::ptr; +use std::slice::bytes; +use std::str; +use std::rt::heap; use std::cmp::Ordering::{self, Equal}; use std::hash::Hash; use std::sync::Mutex; @@ -294,8 +290,6 @@ mod bench; #[cfg(test)] mod tests { - use core::prelude::*; - use std::thread::Thread; use super::Atom; use super::repr::{Static, Inline, Dynamic}; @@ -461,7 +455,7 @@ mod tests { #[test] fn assert_sizes() { // Guard against accidental changes to the sizes of things. - use core::mem; + use std::mem; assert_eq!(8, mem::size_of::()); assert_eq!(48, mem::size_of::()); } diff --git a/src/event.rs b/src/event.rs index 39dcb5d..3f81705 100644 --- a/src/event.rs +++ b/src/event.rs @@ -9,12 +9,7 @@ #![macro_escape] -use core::prelude::*; - -use alloc::boxed::Box; -use collections::MutableSeq; -use collections::vec::Vec; -use collections::string::String; +use std::MutableSeq; use sync::Mutex; #[deriving(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Show, Encodable)] diff --git a/src/lib.rs b/src/lib.rs index 7601fb2..ae1fb02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,21 +11,12 @@ #![crate_type = "rlib"] #![feature(plugin, old_orphan_check)] -#![no_std] +#![feature(core, collections, alloc, hash)] #![deny(warnings)] -#![allow(unstable)] - -#[macro_use] -extern crate core; - -extern crate alloc; -extern crate collections; #[cfg(test)] extern crate test; -extern crate std; - #[plugin] #[no_link] extern crate phf_mac; extern crate phf; diff --git a/src/namespace.rs b/src/namespace.rs index 1c78916..c2d2c14 100644 --- a/src/namespace.rs +++ b/src/namespace.rs @@ -7,9 +7,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![experimental="This may move as string-cache becomes less Web-specific."] - -use core::prelude::*; +#![unstable(feature = "string_cache_namespace", + reason = "This may move as string-cache becomes less Web-specific.")] use atom::Atom; From ce292efaa7b3665c2bce6df8347d685d7c4605ac Mon Sep 17 00:00:00 2001 From: Adam Roben Date: Thu, 29 Jan 2015 12:09:51 -0500 Subject: [PATCH 5/5] Fix warnings during `cargo test` too --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index ae1fb02..f43a61e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,7 @@ #![feature(plugin, old_orphan_check)] #![feature(core, collections, alloc, hash)] #![deny(warnings)] +#![cfg_attr(test, feature(test, std_misc))] #[cfg(test)] extern crate test;