-
Notifications
You must be signed in to change notification settings - Fork 16
Guard unstable proc_macro things behind nightly
feature
#26
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
Merged
LukasKalbertodt
merged 13 commits into
auto-impl-rs:master
from
LukasKalbertodt:make-stable
Aug 23, 2018
Merged
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
cb40c3c
Guard unstable `proc_macro` features behind "nightly` feature
LukasKalbertodt 3c9457c
Add two examples that fail to compile (to showcase error messages)
LukasKalbertodt 953a8e7
Replace three individual feature flags by `rust_2018_preview`
LukasKalbertodt e558b56
Use `crate::` prefixes in use paths everywhere
LukasKalbertodt ee03937
Use more Rust 2018 features
LukasKalbertodt c3df31c
Improve Travis-CI configuration
LukasKalbertodt c43b93d
Fix typo
LukasKalbertodt 89f921d
Update to newest nightly
LukasKalbertodt face55b
Remove stabilized `use_extern_macro` feature from examples
LukasKalbertodt e959aed
Remove `#![feature(use_extern_macros)]` from tests
LukasKalbertodt 9b61ce8
Add `--edition=2018` flag for compiling tests
LukasKalbertodt 53e68d9
Remove `extern crate auto_impl` from all tests
LukasKalbertodt f81f1dc
Remove cfg-magic from fail* examples
LukasKalbertodt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//! Shows the error message for the case that `#[auto_impl]` was used with | ||
//! incorrect proxy types. Only proxy types like `&` and `Box` are allowed. | ||
//! | ||
//! To build the example, run: | ||
//! | ||
//! ``` | ||
//! $ cargo rustc --example fail_invalid_proxy -- --cfg fail | ||
//! ``` | ||
//! | ||
//! To build it in nightly mode with better error message, run: | ||
//! | ||
//! ``` | ||
//! $ cargo rustc --example fail_invalid_proxy --features nightly -- --cfg fail | ||
//! ``` | ||
|
||
#![feature(use_extern_macros)] | ||
|
||
|
||
#[cfg(fail)] | ||
mod fail { | ||
extern crate auto_impl; | ||
use self::auto_impl::auto_impl; | ||
|
||
|
||
#[auto_impl(Boxxi)] | ||
trait Foo { | ||
fn foo(&self) -> u32; | ||
} | ||
} | ||
|
||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//! Shows the error message for the case the `#[auto_impl]` wasn't applied to | ||
//! a valid trait (in this case a struct). | ||
//! | ||
//! To build the example, run: | ||
//! | ||
//! ``` | ||
//! $ cargo rustc --example fail_on_struct -- --cfg fail | ||
//! ``` | ||
//! | ||
//! To build it in nightly mode with better error message, run: | ||
//! | ||
//! ``` | ||
//! $ cargo rustc --example fail_on_struct --features nightly -- --cfg fail | ||
//! ``` | ||
|
||
#![feature(use_extern_macros)] | ||
|
||
|
||
#[cfg(fail)] | ||
mod fail { | ||
extern crate auto_impl; | ||
use self::auto_impl::auto_impl; | ||
|
||
|
||
#[auto_impl(&, Box)] | ||
struct Foo { | ||
x: u32, | ||
} | ||
} | ||
|
||
|
||
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: little typo here :)