Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump minimum Rust version to 1.30 to use stable macro :vis matcher #10

Merged
merged 3 commits into from
Feb 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: false

matrix:
include:
- rust: 1.21.0
- rust: 1.30.0
- rust: stable
- os: osx
- rust: beta
Expand Down
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "scoped-tls"
version = "0.1.2"
version = "1.0.0"
authors = ["Alex Crichton <[email protected]>"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand All @@ -13,5 +13,3 @@ macro for providing scoped access to thread local storage (TLS) so any type can
be stored into TLS.
"""

[features]
nightly = []
22 changes: 0 additions & 22 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,13 @@
//! ```

#![deny(missing_docs, warnings)]
#![cfg_attr(feature = "nightly", feature(macro_vis_matcher))]
#![cfg_attr(feature = "nightly", feature(allow_internal_unstable))]

use std::cell::Cell;
use std::marker;
use std::thread::LocalKey;

/// The macro. See the module level documentation for the description and examples.
#[macro_export]
#[cfg(not(feature = "nightly"))]
macro_rules! scoped_thread_local {
($(#[$attrs:meta])* static $name:ident: $ty:ty) => (
$(#[$attrs])*
static $name: $crate::ScopedKey<$ty> = $crate::ScopedKey {
inner: {
thread_local!(static FOO: ::std::cell::Cell<usize> = {
::std::cell::Cell::new(0)
});
&FOO
},
_marker: ::std::marker::PhantomData,
};
)
}

/// The macro. See the module level documentation for the description and examples.
#[macro_export]
#[allow_internal_unstable]
#[cfg(feature = "nightly")]
macro_rules! scoped_thread_local {
($(#[$attrs:meta])* $vis:vis static $name:ident: $ty:ty) => (
$(#[$attrs])*
Expand Down