Bug 1437561 - Drop lazy_static v0.1.16. r?jgraham draft
authorAndreas Tolfsen <ato@sny.no>
Mon, 12 Feb 2018 16:08:45 +0000
changeset 754874 f2a3523be51d835cd0d893f8834407bb1d0e884b
parent 754873 eccc22518ed1c5a2e42934a0cf0ee7ff70e031f7
push id99023
push userbmo:ato@sny.no
push dateWed, 14 Feb 2018 13:31:33 +0000
reviewersjgraham
bugs1437561
milestone60.0a1
Bug 1437561 - Drop lazy_static v0.1.16. r?jgraham MozReview-Commit-ID: HsLYjersd4g
third_party/rust/lazy_static-0.1.16/.cargo-checksum.json
third_party/rust/lazy_static-0.1.16/.travis.yml
third_party/rust/lazy_static-0.1.16/Cargo.toml
third_party/rust/lazy_static-0.1.16/LICENSE
third_party/rust/lazy_static-0.1.16/README.md
third_party/rust/lazy_static-0.1.16/src/lib.rs
third_party/rust/lazy_static-0.1.16/src/liblib.so
third_party/rust/lazy_static-0.1.16/tests/test.rs
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/.cargo-checksum.json
+++ /dev/null
@@ -1,1 +0,0 @@
-{"files":{".travis.yml":"eea0007a95867df1d3c5b8701b893bfda2773c95f3cd2e4e44d159c4ef834cdd","Cargo.toml":"e50632bb46a33d96af38ec11201ea2371cab8992cae328fd20e3a6bc1e323f06","LICENSE":"79d26c3d855d83d92837c49a868339ec7c2ef7d2a19d7a779ebb4c30d160d90a","README.md":"932d081be16cf7b787400973604712c80b2bc119764c7b742c53cf093cd056fa","src/lib.rs":"0ee6b5a09c6781a9a420cc9ac66790a47b7303aea74093c26d6758a20c248917","src/liblib.so":"34037b491a9d4c55de6f630d47b43ea9ea384d8b915c5bae58495a0982d9f99f","tests/test.rs":"72d312e97491667dee4082d9880df23496d2cd8aa01ff2f9af22cdc6df2c8216"},"package":"cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417"}
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/.travis.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-language: rust
-rust:
-- nightly
-- beta
-- stable
-before_script:
-- |
-  pip install 'travis-cargo<0.2' --user &&
-  export PATH=$HOME/.local/bin:$PATH
-script:
-- |
-  travis-cargo build &&
-  travis-cargo test &&
-  travis-cargo bench &&
-  travis-cargo --only stable doc
-after_success:
-- travis-cargo --only stable doc-upload
-env:
-  global:
-  - TRAVIS_CARGO_NIGHTLY_FEATURE=nightly
-  - secure: YXu24LptjeYirjWYjWGsMT2m3mB7LvQATE6TVo7VEUXv8GYoy2ORIHD83PeImxC93MmZ01QeUezRzuCW51ZcK92VnNSBttlF60SvIX18VsJrV92tsAhievFstqYQ+fB8DIuQ8noU0jPz7GpI+R9dlTRSImAqWOnVIghA+Wzz7Js=
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/Cargo.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[package]
-name = "lazy_static"
-version = "0.1.16"
-authors = ["Marvin Löbel <loebel.marvin@gmail.com>"]
-license = "MIT"
-
-description = "A macro for declaring lazily evaluated statics in Rust."
-readme = "README.md"
-documentation = "http://rust-lang-nursery.github.io/lazy-static.rs/lazy_static/index.html"
-
-repository = "https://github.com/rust-lang-nursery/lazy-static.rs"
-keywords = ["macro", "lazy", "static"]
-
-[features]
-nightly = []
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Marvin Löbel
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
\ No newline at end of file
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/README.md
+++ /dev/null
@@ -1,81 +0,0 @@
-lazy-static.rs
-==============
-
-[![Travis-CI Status](https://travis-ci.org/rust-lang-nursery/lazy-static.rs.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/lazy-static.rs)
-
-A macro for declaring lazily evaluated statics in Rust.
-
-Using this macro, it is possible to have `static`s that require code to be
-executed at runtime in order to be initialized.
-This includes anything requiring heap allocations, like vectors or hash maps,
-as well as anything that requires function calls to be computed.
-
-# Syntax
-
-```rust
-lazy_static! {
-    [pub] static ref NAME_1: TYPE_1 = EXPR_1;
-    [pub] static ref NAME_2: TYPE_2 = EXPR_2;
-    ...
-    [pub] static ref NAME_N: TYPE_N = EXPR_N;
-}
-```
-
-# Semantic
-
-For a given `static ref NAME: TYPE = EXPR;`, the macro generates a
-unique type that implements `Deref<TYPE>` and stores it in a static with name `NAME`.
-
-On first deref, `EXPR` gets evaluated and stored internally, such that all further derefs
-can return a reference to the same object.
-
-Like regular `static mut`s, this macro only works for types that fulfill the `Sync`
-trait.
-
-# Getting Started
-
-[lazy-static.rs is available on crates.io](https://crates.io/crates/lazy_static).
-Add the following dependency to your Cargo manifest to get the latest version of the 0.1 branch:
-
-```toml
-[dependencies]
-lazy_static = "0.1.*"
-```
-
-To always get the latest version, add this git repository to your
-Cargo manifest:
-
-```toml
-[dependencies.lazy_static]
-git = "https://github.com/rust-lang-nursery/lazy-static.rs"
-```
-# Example
-
-Using the macro:
-
-```rust
-#[macro_use]
-extern crate lazy_static;
-
-use std::collections::HashMap;
-
-lazy_static! {
-    static ref HASHMAP: HashMap<u32, &'static str> = {
-        let mut m = HashMap::new();
-        m.insert(0, "foo");
-        m.insert(1, "bar");
-        m.insert(2, "baz");
-        m
-    };
-    static ref COUNT: usize = HASHMAP.len();
-    static ref NUMBER: u32 = times_two(21);
-}
-
-fn times_two(n: u32) -> u32 { n * 2 }
-
-fn main() {
-    println!("The map has {} entries.", *COUNT);
-    println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap());
-    println!("An expensive calculation on a static results in: {}.", *NUMBER);
-}
-```
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/src/lib.rs
+++ /dev/null
@@ -1,157 +0,0 @@
-/*!
-A macro for declaring lazily evaluated statics.
-
-Using this macro, it is possible to have `static`s that require code to be
-executed at runtime in order to be initialized.
-This includes anything requiring heap allocations, like vectors or hash maps,
-as well as anything that requires function calls to be computed.
-
-# Syntax
-
-```ignore
-lazy_static! {
-    [pub] static ref NAME_1: TYPE_1 = EXPR_1;
-    [pub] static ref NAME_2: TYPE_2 = EXPR_2;
-    ...
-    [pub] static ref NAME_N: TYPE_N = EXPR_N;
-}
-```
-
-Metadata (such as doc comments) is allowed on each ref.
-
-# Semantic
-
-For a given `static ref NAME: TYPE = EXPR;`, the macro generates a unique type that
-implements `Deref<TYPE>` and stores it in a static with name `NAME`. (Metadata ends up
-attaching to this type.)
-
-On first deref, `EXPR` gets evaluated and stored internally, such that all further derefs
-can return a reference to the same object.
-
-Like regular `static mut`s, this macro only works for types that fulfill the `Sync`
-trait.
-
-# Example
-
-Using the macro:
-
-```rust
-#[macro_use]
-extern crate lazy_static;
-
-use std::collections::HashMap;
-
-lazy_static! {
-    static ref HASHMAP: HashMap<u32, &'static str> = {
-        let mut m = HashMap::new();
-        m.insert(0, "foo");
-        m.insert(1, "bar");
-        m.insert(2, "baz");
-        m
-    };
-    static ref COUNT: usize = HASHMAP.len();
-    static ref NUMBER: u32 = times_two(21);
-}
-
-fn times_two(n: u32) -> u32 { n * 2 }
-
-fn main() {
-    println!("The map has {} entries.", *COUNT);
-    println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap());
-    println!("A expensive calculation on a static results in: {}.", *NUMBER);
-}
-```
-
-# Implementation details
-
-The `Deref` implementation uses a hidden static variable that is guarded by a atomic check on each access. On stable Rust, the macro may need to allocate each static on the heap.
-
-*/
-
-#![cfg_attr(feature="nightly", feature(const_fn, core_intrinsics))]
-#![crate_type = "dylib"]
-
-#[macro_export]
-macro_rules! lazy_static {
-    ($(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
-        lazy_static!(PRIV, $(#[$attr])* static ref $N : $T = $e; $($t)*);
-    };
-    ($(#[$attr:meta])* pub static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
-        lazy_static!(PUB, $(#[$attr])* static ref $N : $T = $e; $($t)*);
-    };
-    ($VIS:ident, $(#[$attr:meta])* static ref $N:ident : $T:ty = $e:expr; $($t:tt)*) => {
-        lazy_static!(MAKE TY, $VIS, $(#[$attr])*, $N);
-        impl ::std::ops::Deref for $N {
-            type Target = $T;
-            fn deref<'a>(&'a self) -> &'a $T {
-                #[inline(always)]
-                fn __static_ref_initialize() -> $T { $e }
-
-                unsafe {
-                    use std::sync::{Once, ONCE_INIT};
-
-                    #[inline(always)]
-                    fn require_sync<T: Sync>(_: &T) { }
-
-                    #[inline(always)]
-                    #[cfg(feature="nightly")]
-                    unsafe fn __stability() -> &'static $T {
-                        use std::cell::UnsafeCell;
-
-                        struct SyncCell(UnsafeCell<Option<$T>>);
-                        unsafe impl Sync for SyncCell {}
-
-                        static DATA: SyncCell = SyncCell(UnsafeCell::new(None));
-                        static ONCE: Once = ONCE_INIT;
-                        ONCE.call_once(|| {
-                            *DATA.0.get() = Some(__static_ref_initialize());
-                        });
-                        match *DATA.0.get() {
-                            Some(ref x) => x,
-                            None => ::std::intrinsics::unreachable(),
-                        }
-                    }
-
-                    #[inline(always)]
-                    #[cfg(not(feature="nightly"))]
-                    unsafe fn __stability() -> &'static $T {
-                        use std::mem::transmute;
-                        use std::boxed::Box;
-
-                        static mut DATA: *const $T = 0 as *const $T;
-                        static mut ONCE: Once = ONCE_INIT;
-                        ONCE.call_once(|| {
-                            DATA = transmute::<Box<$T>, *const $T>(
-                                Box::new(__static_ref_initialize()));
-                        });
-                        &*DATA
-                    }
-
-                    let static_ref = __stability();
-                    require_sync(static_ref);
-                    static_ref
-                }
-            }
-        }
-        lazy_static!($($t)*);
-    };
-    (MAKE TY, PUB, $(#[$attr:meta])*, $N:ident) => {
-        #[allow(missing_copy_implementations)]
-        #[allow(non_camel_case_types)]
-        #[allow(dead_code)]
-        $(#[$attr])*
-        pub struct $N {__private_field: ()}
-        #[doc(hidden)]
-        pub static $N: $N = $N {__private_field: ()};
-    };
-    (MAKE TY, PRIV, $(#[$attr:meta])*, $N:ident) => {
-        #[allow(missing_copy_implementations)]
-        #[allow(non_camel_case_types)]
-        #[allow(dead_code)]
-        $(#[$attr])*
-        struct $N {__private_field: ()}
-        #[doc(hidden)]
-        static $N: $N = $N {__private_field: ()};
-    };
-    () => ()
-}
deleted file mode 100755
index cc69ddaf91a19920afb9747cfb0284537b744646..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/third_party/rust/lazy_static-0.1.16/tests/test.rs
+++ /dev/null
@@ -1,116 +0,0 @@
-#![cfg_attr(feature="nightly", feature(const_fn, core_intrinsics))]
-
-#[macro_use]
-extern crate lazy_static;
-use std::collections::HashMap;
-
-lazy_static! {
-    /// Documentation!
-    pub static ref NUMBER: u32 = times_two(3);
-
-    static ref ARRAY_BOXES: [Box<u32>; 3] = [Box::new(1), Box::new(2), Box::new(3)];
-
-    /// More documentation!
-    #[allow(unused_variables)]
-    #[derive(Copy, Clone, Debug)]
-    pub static ref STRING: String = "hello".to_string();
-
-    static ref HASHMAP: HashMap<u32, &'static str> = {
-        let mut m = HashMap::new();
-        m.insert(0, "abc");
-        m.insert(1, "def");
-        m.insert(2, "ghi");
-        m
-    };
-
-    // This should not compile if the unsafe is removed.
-    static ref UNSAFE: u32 = unsafe {
-        std::mem::transmute::<i32, u32>(-1)
-    };
-
-    // This *should* triggger warn(dead_code) by design.
-    static ref UNUSED: () = ();
-
-}
-
-fn times_two(n: u32) -> u32 {
-    n * 2
-}
-
-#[test]
-fn test_basic() {
-    assert_eq!(&**STRING, "hello");
-    assert_eq!(*NUMBER, 6);
-    assert!(HASHMAP.get(&1).is_some());
-    assert!(HASHMAP.get(&3).is_none());
-    assert_eq!(&*ARRAY_BOXES, &[Box::new(1), Box::new(2), Box::new(3)]);
-    assert_eq!(*UNSAFE, std::u32::MAX);
-}
-
-#[test]
-fn test_repeat() {
-    assert_eq!(*NUMBER, 6);
-    assert_eq!(*NUMBER, 6);
-    assert_eq!(*NUMBER, 6);
-}
-
-#[test]
-fn test_meta() {
-    // this would not compile if STRING were not marked #[derive(Copy, Clone)]
-    let copy_of_string = STRING;
-    // just to make sure it was copied
-    assert!(&STRING as *const _ != &copy_of_string as *const _);
-
-    // this would not compile if STRING were not marked #[derive(Debug)]
-    assert_eq!(format!("{:?}", STRING), "STRING { __private_field: () }".to_string());
-}
-
-mod visibility {
-    lazy_static! {
-        pub static ref FOO: Box<u32> = Box::new(0);
-        static ref BAR: Box<u32> = Box::new(98);
-    }
-
-    #[test]
-    fn sub_test() {
-        assert_eq!(**FOO, 0);
-        assert_eq!(**BAR, 98);
-    }
-}
-
-#[test]
-fn test_visibility() {
-    assert_eq!(*visibility::FOO, Box::new(0));
-}
-
-// This should not cause a warning about a missing Copy implementation
-lazy_static! {
-    pub static ref VAR: i32 = { 0 };
-}
-
-#[derive(Copy, Clone, Debug, PartialEq)]
-struct X;
-struct Once(X);
-const ONCE_INIT: Once = Once(X);
-static DATA: X = X;
-static ONCE: X = X;
-fn require_sync() -> X { X }
-fn transmute() -> X { X }
-fn __static_ref_initialize() -> X { X }
-fn test(_: Vec<X>) -> X { X }
-
-// All these names should not be shadowed
-lazy_static! {
-    static ref ITEM_NAME_TEST: X = {
-        test(vec![X, Once(X).0, ONCE_INIT.0, DATA, ONCE,
-                  require_sync(), transmute(),
-                  // Except this, which will sadly be shadowed by internals:
-                  // __static_ref_initialize()
-                  ])
-    };
-}
-
-#[test]
-fn item_name_shadowing() {
-    assert_eq!(*ITEM_NAME_TEST, X);
-}