Skip to content

Commit

Permalink
Remove extern crate proc_macro from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 10, 2020
1 parent fc21110 commit 8a2a0d6
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 28 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ proc-macro = true
```

```rust
extern crate proc_macro;

use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, DeriveInput};
Expand Down
2 changes: 0 additions & 2 deletions dev/parse.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate proc_macro;

use proc_macro::TokenStream;
use quote::quote;
use syn::File;
Expand Down
2 changes: 0 additions & 2 deletions examples/heapsize/heapsize_derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
extern crate proc_macro;

use proc_macro2::TokenStream;
use quote::{quote, quote_spanned};
use syn::spanned::Spanned;
Expand Down
4 changes: 1 addition & 3 deletions examples/lazy-static/lazy-static/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#![recursion_limit = "128"]
#![feature(proc_macro_diagnostic)]

extern crate proc_macro;
use self::proc_macro::TokenStream;

use proc_macro::TokenStream;
use quote::{quote, quote_spanned};
use syn::parse::{Parse, ParseStream, Result};
use syn::spanned::Spanned;
Expand Down
4 changes: 1 addition & 3 deletions examples/trace-var/trace-var/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
extern crate proc_macro;
use self::proc_macro::TokenStream;

use proc_macro::TokenStream;
use quote::{quote, ToTokens};
use std::collections::HashSet as Set;
use syn::fold::{self, Fold};
Expand Down
4 changes: 2 additions & 2 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ ast_enum_of_structs! {
/// as type `AttributeArgs`.
///
/// ```
/// extern crate proc_macro;
///
/// # extern crate proc_macro;
/// #
/// use proc_macro::TokenStream;
/// use syn::{parse_macro_input, AttributeArgs, ItemFn};
///
Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub type Result<T> = std::result::Result<T, Error>;
/// conversion to `compile_error!` automatically.
///
/// ```
/// extern crate proc_macro;
///
/// # extern crate proc_macro;
/// #
/// use proc_macro::TokenStream;
/// use syn::{parse_macro_input, AttributeArgs, ItemFn};
///
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
//! ```
//!
//! ```
//! extern crate proc_macro;
//!
//! # extern crate proc_macro;
//! #
//! use proc_macro::TokenStream;
//! use quote::quote;
//! use syn::{parse_macro_input, DeriveInput};
Expand Down Expand Up @@ -820,8 +820,8 @@ pub use crate::error::{Error, Result};
/// # Examples
///
/// ```
/// extern crate proc_macro;
///
/// # extern crate proc_macro;
/// #
/// use proc_macro::TokenStream;
/// use quote::quote;
/// use syn::DeriveInput;
Expand Down
12 changes: 6 additions & 6 deletions src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
//! [`parse_macro_input!`]: ../macro.parse_macro_input.html
//!
//! ```
//! extern crate proc_macro;
//!
//! # extern crate proc_macro;
//! #
//! use proc_macro::TokenStream;
//! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
//! use syn::parse::{Parse, ParseStream};
Expand Down Expand Up @@ -153,8 +153,8 @@
//! [`Parser`]: trait.Parser.html
//!
//! ```
//! extern crate proc_macro;
//!
//! # extern crate proc_macro;
//! #
//! use proc_macro::TokenStream;
//! use syn::parse::Parser;
//! use syn::punctuated::Punctuated;
Expand Down Expand Up @@ -1217,8 +1217,8 @@ pub(crate) fn parse_stream<F: Parser>(f: F, input: ParseStream) -> Result<F::Out
/// provided any attribute args.
///
/// ```
/// extern crate proc_macro;
///
/// # extern crate proc_macro;
/// #
/// use proc_macro::TokenStream;
/// use syn::parse_macro_input;
/// use syn::parse::Nothing;
Expand Down
4 changes: 2 additions & 2 deletions src/parse_macro_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
/// #\[proc_macro_attribute\] attribute.
///
/// ```
/// extern crate proc_macro;
///
/// # extern crate proc_macro;
/// #
/// use proc_macro::TokenStream;
/// use syn::{parse_macro_input, Result};
/// use syn::parse::{Parse, ParseStream};
Expand Down

0 comments on commit 8a2a0d6

Please sign in to comment.