Remove extern crate proc_macro from docs

This commit is contained in:
David Tolnay 2020-06-09 20:44:37 -07:00
parent fc21110dd3
commit 8a2a0d6fc6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
10 changed files with 18 additions and 28 deletions

View File

@ -88,8 +88,6 @@ proc-macro = true
``` ```
```rust ```rust
extern crate proc_macro;
use proc_macro::TokenStream; use proc_macro::TokenStream;
use quote::quote; use quote::quote;
use syn::{parse_macro_input, DeriveInput}; use syn::{parse_macro_input, DeriveInput};

View File

@ -1,5 +1,3 @@
extern crate proc_macro;
use proc_macro::TokenStream; use proc_macro::TokenStream;
use quote::quote; use quote::quote;
use syn::File; use syn::File;

View File

@ -1,5 +1,3 @@
extern crate proc_macro;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::{quote, quote_spanned}; use quote::{quote, quote_spanned};
use syn::spanned::Spanned; use syn::spanned::Spanned;

View File

@ -1,9 +1,7 @@
#![recursion_limit = "128"] #![recursion_limit = "128"]
#![feature(proc_macro_diagnostic)] #![feature(proc_macro_diagnostic)]
extern crate proc_macro; use proc_macro::TokenStream;
use self::proc_macro::TokenStream;
use quote::{quote, quote_spanned}; use quote::{quote, quote_spanned};
use syn::parse::{Parse, ParseStream, Result}; use syn::parse::{Parse, ParseStream, Result};
use syn::spanned::Spanned; use syn::spanned::Spanned;

View File

@ -1,6 +1,4 @@
extern crate proc_macro; use proc_macro::TokenStream;
use self::proc_macro::TokenStream;
use quote::{quote, ToTokens}; use quote::{quote, ToTokens};
use std::collections::HashSet as Set; use std::collections::HashSet as Set;
use syn::fold::{self, Fold}; use syn::fold::{self, Fold};

View File

@ -470,8 +470,8 @@ ast_enum_of_structs! {
/// as type `AttributeArgs`. /// as type `AttributeArgs`.
/// ///
/// ``` /// ```
/// extern crate proc_macro; /// # extern crate proc_macro;
/// /// #
/// use proc_macro::TokenStream; /// use proc_macro::TokenStream;
/// use syn::{parse_macro_input, AttributeArgs, ItemFn}; /// use syn::{parse_macro_input, AttributeArgs, ItemFn};
/// ///

View File

@ -31,8 +31,8 @@ pub type Result<T> = std::result::Result<T, Error>;
/// conversion to `compile_error!` automatically. /// conversion to `compile_error!` automatically.
/// ///
/// ``` /// ```
/// extern crate proc_macro; /// # extern crate proc_macro;
/// /// #
/// use proc_macro::TokenStream; /// use proc_macro::TokenStream;
/// use syn::{parse_macro_input, AttributeArgs, ItemFn}; /// use syn::{parse_macro_input, AttributeArgs, ItemFn};
/// ///

View File

@ -70,8 +70,8 @@
//! ``` //! ```
//! //!
//! ``` //! ```
//! extern crate proc_macro; //! # extern crate proc_macro;
//! //! #
//! use proc_macro::TokenStream; //! use proc_macro::TokenStream;
//! use quote::quote; //! use quote::quote;
//! use syn::{parse_macro_input, DeriveInput}; //! use syn::{parse_macro_input, DeriveInput};
@ -820,8 +820,8 @@ pub use crate::error::{Error, Result};
/// # Examples /// # Examples
/// ///
/// ``` /// ```
/// extern crate proc_macro; /// # extern crate proc_macro;
/// /// #
/// use proc_macro::TokenStream; /// use proc_macro::TokenStream;
/// use quote::quote; /// use quote::quote;
/// use syn::DeriveInput; /// use syn::DeriveInput;

View File

@ -26,8 +26,8 @@
//! [`parse_macro_input!`]: ../macro.parse_macro_input.html //! [`parse_macro_input!`]: ../macro.parse_macro_input.html
//! //!
//! ``` //! ```
//! extern crate proc_macro; //! # extern crate proc_macro;
//! //! #
//! use proc_macro::TokenStream; //! use proc_macro::TokenStream;
//! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token}; //! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token};
//! use syn::parse::{Parse, ParseStream}; //! use syn::parse::{Parse, ParseStream};
@ -153,8 +153,8 @@
//! [`Parser`]: trait.Parser.html //! [`Parser`]: trait.Parser.html
//! //!
//! ``` //! ```
//! extern crate proc_macro; //! # extern crate proc_macro;
//! //! #
//! use proc_macro::TokenStream; //! use proc_macro::TokenStream;
//! use syn::parse::Parser; //! use syn::parse::Parser;
//! use syn::punctuated::Punctuated; //! use syn::punctuated::Punctuated;
@ -1217,8 +1217,8 @@ pub(crate) fn parse_stream<F: Parser>(f: F, input: ParseStream) -> Result<F::Out
/// provided any attribute args. /// provided any attribute args.
/// ///
/// ``` /// ```
/// extern crate proc_macro; /// # extern crate proc_macro;
/// /// #
/// use proc_macro::TokenStream; /// use proc_macro::TokenStream;
/// use syn::parse_macro_input; /// use syn::parse_macro_input;
/// use syn::parse::Nothing; /// use syn::parse::Nothing;

View File

@ -16,8 +16,8 @@
/// #\[proc_macro_attribute\] attribute. /// #\[proc_macro_attribute\] attribute.
/// ///
/// ``` /// ```
/// extern crate proc_macro; /// # extern crate proc_macro;
/// /// #
/// use proc_macro::TokenStream; /// use proc_macro::TokenStream;
/// use syn::{parse_macro_input, Result}; /// use syn::{parse_macro_input, Result};
/// use syn::parse::{Parse, ParseStream}; /// use syn::parse::{Parse, ParseStream};