Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 87f7291

Browse files
committed
Update example code to 2018 edition
1 parent 96f0014 commit 87f7291

File tree

10 files changed

+8
-24
lines changed

10 files changed

+8
-24
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ rust:
66
- nightly
77
- beta
88
- stable
9-
- 1.30.0
9+
- 1.31.0
1010

1111
script:
1212
- cargo run --manifest-path example/Cargo.toml
@@ -17,3 +17,7 @@ matrix:
1717
name: Minimal versions
1818
before_script:
1919
- cargo update -Z minimal-versions --manifest-path example/Cargo.toml
20+
- rust: 1.30.0
21+
name: 2015 edition
22+
script:
23+
- cargo check

README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ macros.
3232

3333
```rust
3434
extern crate proc_macro;
35-
extern crate proc_macro_hack;
36-
extern crate quote;
37-
extern crate syn;
3835

3936
use proc_macro::TokenStream;
4037
use proc_macro_hack::proc_macro_hack;
@@ -63,9 +60,6 @@ procedural macro from the implementation crate. The re-export also carries a
6360
\#\[proc_macro_hack\] attribute.
6461

6562
```rust
66-
extern crate demo_hack_impl;
67-
extern crate proc_macro_hack;
68-
6963
use proc_macro_hack::proc_macro_hack;
7064

7165
/// Add one to an expression.
@@ -96,7 +90,6 @@ implementation crate), then use your procedural macros as usual.
9690
[> example of a downstream crate][example]
9791

9892
```rust
99-
extern crate demo_hack;
10093
use demo_hack::add_one;
10194

10295
fn main() {

demo-hack-impl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["David Tolnay <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Demo of proc-macro-hack"
77
repository = "https://github.com/dtolnay/proc-macro-hack"
8+
edition = "2018"
89

910
[lib]
1011
proc-macro = true

demo-hack-impl/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
extern crate proc_macro;
2-
extern crate proc_macro_hack;
3-
extern crate quote;
4-
extern crate syn;
52

63
use proc_macro::TokenStream;
74
use proc_macro_hack::proc_macro_hack;

demo-hack/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ authors = ["David Tolnay <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "Demo of proc-macro-hack"
77
repository = "https://github.com/dtolnay/proc-macro-hack"
8+
edition = "2018"
89

910
[dependencies]
1011
proc-macro-hack = { version = "0.5", path = ".." }

demo-hack/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
extern crate demo_hack_impl;
2-
extern crate proc_macro_hack;
3-
41
use proc_macro_hack::proc_macro_hack;
52

63
/// Add one to an expression.

example/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "example"
33
version = "0.0.0"
44
authors = ["David Tolnay <[email protected]>"]
5+
edition = "2018"
56
publish = false
67

78
[dependencies]

example/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
extern crate demo_hack;
21
use demo_hack::add_one;
32

43
fn main() {

nested/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
//! ```rust
2323
//! // After
2424
//! # const IGNORE: &str = stringify! {
25-
//! extern crate proc_macro_nested;
26-
//!
2725
//! #[proc_macro_hack(support_nested)]
2826
//! pub use demo_hack_impl::add_one;
2927
//! # }

src/lib.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
//!
2525
//! ```rust
2626
//! extern crate proc_macro;
27-
//! extern crate proc_macro_hack;
28-
//! extern crate quote;
29-
//! extern crate syn;
3027
//!
3128
//! use proc_macro::TokenStream;
3229
//! use proc_macro_hack::proc_macro_hack;
@@ -59,9 +56,6 @@
5956
//! \#\[proc_macro_hack\] attribute.
6057
//!
6158
//! ```rust
62-
//! extern crate demo_hack_impl;
63-
//! extern crate proc_macro_hack;
64-
//!
6559
//! use proc_macro_hack::proc_macro_hack;
6660
//!
6761
//! /// Add one to an expression.
@@ -94,7 +88,6 @@
9488
//! [> example of a downstream crate][example]
9589
//!
9690
//! ```rust
97-
//! extern crate demo_hack;
9891
//! use demo_hack::add_one;
9992
//!
10093
//! fn main() {

0 commit comments

Comments
 (0)