Remove proc_macro_hygiene feature

This commit is contained in:
David Tolnay 2018-11-18 00:35:28 -08:00
parent 54f35aae28
commit 893566118d
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
8 changed files with 9 additions and 25 deletions

View File

@ -5,13 +5,6 @@
This crate provides the `html!` macro for building HTML documents inside your This crate provides the `html!` macro for building HTML documents inside your
Rust code using roughly [JSX] compatible syntax. Rust code using roughly [JSX] compatible syntax.
## Nightly Warning!
This crate currently needs nightly rustc, and in order to use it you'll need to
add `#![feature(proc_macro_hygiene)]` to the top of your crate. The compiler
will tell you to do this if you forget. When this feature stabilises, the crate
should work on stable rustc without issues.
## Quick Preview ## Quick Preview
```rust ```rust

View File

@ -1,5 +1,3 @@
#![feature(proc_macro_hygiene)]
extern crate stdweb; extern crate stdweb;
extern crate typed_html; extern crate typed_html;
extern crate typed_html_macros; extern crate typed_html_macros;

View File

@ -18,6 +18,7 @@ proc-macro = true
lalrpop-util = "0.16.1" lalrpop-util = "0.16.1"
ansi_term = "0.11.0" ansi_term = "0.11.0"
proc-macro2 = { version = "0.4.24", features = ["nightly"] } proc-macro2 = { version = "0.4.24", features = ["nightly"] }
proc-macro-hack = "0.5.1"
quote = "0.6.10" quote = "0.6.10"
[build-dependencies] [build-dependencies]

View File

@ -1,14 +1,15 @@
#![recursion_limit = "128"] #![recursion_limit = "128"]
#![feature(proc_macro_hygiene)]
#![cfg_attr(can_show_location_of_runtime_parse_error, feature(proc_macro_span))] #![cfg_attr(can_show_location_of_runtime_parse_error, feature(proc_macro_span))]
extern crate ansi_term; extern crate ansi_term;
extern crate lalrpop_util; extern crate lalrpop_util;
extern crate proc_macro; extern crate proc_macro;
extern crate proc_macro2; extern crate proc_macro2;
extern crate proc_macro_hack;
extern crate quote; extern crate quote;
use proc_macro::TokenStream; use proc_macro::TokenStream;
use proc_macro_hack::proc_macro_hack;
mod config; mod config;
mod declare; mod declare;
@ -25,7 +26,7 @@ mod span;
/// See the crate documentation for [`typed_html`][typed_html]. /// See the crate documentation for [`typed_html`][typed_html].
/// ///
/// [typed_html]: ../typed_html/index.html /// [typed_html]: ../typed_html/index.html
#[proc_macro] #[proc_macro_hack]
pub fn html(input: TokenStream) -> TokenStream { pub fn html(input: TokenStream) -> TokenStream {
let stream = lexer::unroll_stream(input.into(), false); let stream = lexer::unroll_stream(input.into(), false);
let result = html::expand_html(&stream); let result = html::expand_html(&stream);

View File

@ -23,3 +23,4 @@ language-tags = "0.2.2"
http = "0.1.13" http = "0.1.13"
htmlescape = "0.3.1" htmlescape = "0.3.1"
stdweb = "0.4.10" stdweb = "0.4.10"
proc-macro-hack = "0.5.1"

View File

@ -13,7 +13,6 @@ use htmlescape::encode_minimal;
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// # #![feature(proc_macro_hygiene)]
/// # use typed_html::html; /// # use typed_html::html;
/// # use typed_html::dom::DOMTree; /// # use typed_html::dom::DOMTree;
/// # fn main() { /// # fn main() {

View File

@ -30,7 +30,6 @@ macro_rules! declare_events {
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// # #![feature(proc_macro_hygiene)]
/// # use typed_html::{html, for_events}; /// # use typed_html::{html, for_events};
/// # use typed_html::dom::{DOMTree, VNode}; /// # use typed_html::dom::{DOMTree, VNode};
/// # fn main() { /// # fn main() {

View File

@ -1,17 +1,9 @@
//! This crate provides the `html!` macro for building HTML documents inside your //! This crate provides the `html!` macro for building HTML documents inside your
//! Rust code using roughly [JSX] compatible syntax. //! Rust code using roughly [JSX] compatible syntax.
//! //!
//! # Nightly Warning!
//!
//! This crate currently needs nightly rustc, and in order to use it you'll need to
//! add `#![feature(proc_macro_hygiene)]` to the top of your crate. The compiler
//! will tell you to do this if you forget. When this feature stabilises, the crate
//! should work on stable rustc without issues.
//!
//! # Quick Preview //! # Quick Preview
//! //!
//! ``` //! ```
//! # #![feature(proc_macro_hygiene)]
//! # use typed_html::{html, for_events}; //! # use typed_html::{html, for_events};
//! # use typed_html::dom::{DOMTree, VNode}; //! # use typed_html::dom::{DOMTree, VNode};
//! # use typed_html::types::Metadata; //! # use typed_html::types::Metadata;
@ -95,7 +87,6 @@
//! ## Example //! ## Example
//! //!
//! ``` //! ```
//! # #![feature(proc_macro_hygiene)]
//! # use typed_html::html; //! # use typed_html::html;
//! # use typed_html::dom::DOMTree; //! # use typed_html::dom::DOMTree;
//! # use typed_html::types::{Class, SpacedSet}; //! # use typed_html::types::{Class, SpacedSet};
@ -126,7 +117,6 @@
//! ## Example //! ## Example
//! //!
//! ``` //! ```
//! # #![feature(proc_macro_hygiene)]
//! # use typed_html::{html, text}; //! # use typed_html::{html, text};
//! # use typed_html::dom::DOMTree; //! # use typed_html::dom::DOMTree;
//! # fn main() { //! # fn main() {
@ -154,7 +144,6 @@
//! ensure you're not using any event handlers that can't be printed. //! ensure you're not using any event handlers that can't be printed.
//! //!
//! ``` //! ```
//! # #![feature(proc_macro_hygiene)]
//! # use typed_html::html; //! # use typed_html::html;
//! # use typed_html::dom::DOMTree; //! # use typed_html::dom::DOMTree;
//! # fn main() { //! # fn main() {
@ -208,11 +197,14 @@ pub extern crate htmlescape;
extern crate http; extern crate http;
extern crate language_tags; extern crate language_tags;
extern crate mime; extern crate mime;
extern crate proc_macro_hack;
extern crate stdweb; extern crate stdweb;
extern crate strum; extern crate strum;
extern crate typed_html_macros; extern crate typed_html_macros;
#[doc(inline)] use proc_macro_hack::proc_macro_hack;
#[proc_macro_hack]
pub use typed_html_macros::html; pub use typed_html_macros::html;
pub mod dom; pub mod dom;