Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upStabilize `use_extern_macros` #50911
Conversation
rust-highfive
assigned
cramertj
May 20, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
label
May 20, 2018
petrochenkov
added
S-waiting-on-crater
and removed
S-waiting-on-review
labels
May 20, 2018
This comment has been minimized.
This comment has been minimized.
|
r? @kennytm |
rust-highfive
assigned
kennytm
and unassigned
cramertj
May 20, 2018
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
May 20, 2018
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
cc @rust-lang/infra Crater run (check only) requested. |
This comment has been minimized.
This comment has been minimized.
|
Crater run (check only) started. |
aturon
referenced this pull request
May 22, 2018
Closed
Tracking issue for RFC 1566: Procedural macros #38356
This comment has been minimized.
This comment has been minimized.
|
Hi @kennytm (crater requester, PR reviewer)! Crater results are at: http://cargobomb-reports.s3.amazonaws.com/pr-50911/index.html. 'Blacklisted' crates (spurious failures etc) can be found here. If you see any spurious failures not on the list, please make a PR against that file. (interested observers: Crater is a tool for testing the impact of changes on the crates.io ecosystem. You can find out more at the repo if you're curious) |
pietroalbini
added
S-waiting-on-review
and removed
S-waiting-on-crater
labels
May 24, 2018
This comment has been minimized.
This comment has been minimized.
|
6 regressions.
Relevant source code in npbot-1.0.0[dependencies]
structopt = "0.2.5"#[macro_use]
extern crate quicli;
// ...
use structopt::StructOpt;
use quicli::prelude::*;
// ...
#[derive(StructOpt)]
pub(crate) struct Opt {
#[structopt(short = "d", long = "debug", help = "only use the local, println!() sink")]
debug: bool,
#[structopt(long = "verbose", short = "v", parse(from_occurrences))]
verbose: u8,
// for the SoundTouch source
#[structopt(long = "soundtouch-host")]
soundtouch_host: Option<String>,
// for the last.fm source
#[structopt(long = "lastfm-api-key")]
lastfm_api_key: Option<String>,
#[structopt(long = "lastfm-username")]
lastfm_username: Option<String>,
}Note the lack of Error log
|
kennytm
added
S-waiting-on-author
and removed
S-waiting-on-review
labels
May 24, 2018
This comment has been minimized.
This comment has been minimized.
|
I'll look what happens with |
petrochenkov
reviewed
May 27, 2018
| MacroBinding::Global(binding) | ||
| } else { | ||
| return None; | ||
| }; | ||
|
|
||
| if !self.use_extern_macros { | ||
| if let Some(scope) = possible_time_travel { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
It looks like So the error should be something like "cannot determine resolution for the derive macro However, due to a scary hole in our macro resolution checking such dummy expansions can happen silently without generating any errors. |
petrochenkov
referenced this pull request
May 29, 2018
Merged
resolve: Make sure indeterminate and inconsistent macro resolutions always generate errors #51145
This comment has been minimized.
This comment has been minimized.
|
Fixed in #51145 |
petrochenkov
force-pushed the
petrochenkov:macuse
branch
from
66dfde1
to
df02c89
May 30, 2018
petrochenkov
changed the title
[Do not merge] Stabilize `use_extern_macros`
Stabilize `use_extern_macros`
May 30, 2018
This comment has been minimized.
This comment has been minimized.
rust-highfive
unassigned
kennytm
May 30, 2018
This comment has been minimized.
This comment has been minimized.
|
|
bors
merged commit 674a5db
into
rust-lang:master
Aug 17, 2018
This comment has been minimized.
This comment has been minimized.
|
Thanks so much for helping this over the finish line @petrochenkov! |
This was referenced Aug 19, 2018
bors
added a commit
that referenced
this pull request
Aug 21, 2018
LukasKalbertodt
referenced this pull request
Aug 22, 2018
Merged
Guard unstable proc_macro things behind `nightly` feature #26
This was referenced Aug 22, 2018
This was referenced Sep 2, 2018
bors
added a commit
that referenced
this pull request
Sep 3, 2018
petrochenkov
referenced this pull request
Sep 10, 2018
Merged
Feature gate non-builtin attributes in inner attribute position #54093
bors
added a commit
that referenced
this pull request
Sep 10, 2018
bors
added a commit
that referenced
this pull request
Sep 11, 2018
petrochenkov
referenced this pull request
Sep 16, 2018
Merged
Temporarily prohibit proc macro attributes placed after derives #54277
bors
added a commit
that referenced
this pull request
Sep 17, 2018
bupknar
referenced this pull request
Oct 26, 2018
Closed
Rust 1.30: importing derive macro with `use` works or fails depending on whether unrelated dependency is present #55386
This comment has been minimized.
This comment has been minimized.
softprops
commented
Oct 26, 2018
|
The 1.30.0 release notes for Where can I find more documentation on this feature? So far I've tried local_inner_macros in two cases where a crate's macros depended on anothers and it didn't work in either case. |
This comment has been minimized.
This comment has been minimized.
|
@softprops It will be available at https://rust-lang-nursery.github.io/edition-guide/rust-2018/macros/macro-changes.html when merged. |
This comment has been minimized.
This comment has been minimized.
softprops
commented
Oct 26, 2018
|
@petrochenkov thanks! I'll take a look and report back if it looks like what I'm trying to do, re-export transitive dependency crates macros` is actually what this new feature supports. |
This comment has been minimized.
This comment has been minimized.
softprops
commented
Oct 26, 2018
•
|
@petrochenkov l need to do a bit more testing but I worked it out, at least enough to get a fork of rust crowbar to compile. I still need to test a crate that uses that fork before I can call this It may not be clear to new rust users that for foreign macros, you'll also need namespace the macro's path. In my case I just needed to prefix crowbars use of cpython's macros with |
This comment has been minimized.
This comment has been minimized.
softprops
commented
Oct 26, 2018
|
found a potential bug but I'm not sure if its by design when experimenting with the with extern crate crowbar;
crowbar::lambda!(...)however with extern crate crowbar;
crowbar::lambda!(...)
interestingly though I can do the following with extern crate crowbar;
use crowbar::lambda;
lambda!(...)this feels a bit inconsistent in the way the newer system attempts to line up with what you can do with path references for non macro items. |
This comment has been minimized.
This comment has been minimized.
|
@softprops This way the first iteration |
This comment has been minimized.
This comment has been minimized.
softprops
commented
Oct 26, 2018
|
@petrochenkov 100%. that was it. thanks! |
petrochenkov commentedMay 20, 2018
•
edited
Closes #35896