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 upPossible regression at nightly-2016-06-15 for include_str! macro #34431
Comments
brson
added
the
regression-from-stable-to-nightly
label
Jun 23, 2016
This comment has been minimized.
This comment has been minimized.
|
Edit: Apparently not, testing with that commit reverted did not fix the problem. |
This comment has been minimized.
This comment has been minimized.
|
I can confirm that reverting 4259fba fixes the problem. cc @jseyfried The following code reproduces the issue:
#![crate_type = "lib"]
#[macro_use]
mod foo;
load_data!("data.txt");
macro_rules! load_data { ($file:expr) => {
static DATA: &'static str = include_str!($file);
}} |
This comment has been minimized.
This comment has been minimized.
|
@TimNN Thanks for the cc and the minimal example! This was caused by #33749. I think this is a bug-fix -- That being said, if this is causing significant breakage in practice, we should fix it (not that hard) or do a warning cycle (also not that hard). Maybe we could do a crater run to determine breakage? cc @nrc |
This comment has been minimized.
This comment has been minimized.
|
@jseyfried: Will the new behaviour ever work with macros imported from extern crates? I imagine not, since the extern crate's sources will not necessarily be available. |
This comment has been minimized.
This comment has been minimized.
|
@TimNN Good point, macros from extern crates that use Perhaps we should just keep the old behaviour -- the new behaviour may not be enough of an improvement to justify potential breakage or a warning cycle. |
jseyfried
referenced this issue
Jun 24, 2016
Merged
Revert a change to the relative path for macro-expanded `include!`s #34450
This comment has been minimized.
This comment has been minimized.
|
A mild ergonomic improvement seems far from what I'd want to see to justify breaking significant amounts of code in the real world, regardless of the existence of a warning period. |
This comment has been minimized.
This comment has been minimized.
|
@stacker agreed -- we would only consider the change if crater found virtually no breakage. |
This comment has been minimized.
This comment has been minimized.
|
I think this is the correct semantics, anywhere to file an issue for macros 2.0? |
This comment has been minimized.
This comment has been minimized.
|
For the extern crate perhaps something like scheme's |
This comment has been minimized.
This comment has been minimized.
|
Maybe comment on one if @nrc''s RFCs -- probably RFC 1584. |
This comment has been minimized.
This comment has been minimized.
|
Hmm, I'll have to look into |
kbknapp commentedJun 23, 2016
•
edited
I have an example which internally uses
include_str!to pull in the contents of a file in the same directory. This example fails to buid on all nightlies after 2016-06-14 (ab0b87458), yet passes onab0b87458and all prior (including stable).The error message I get is:
The only commit that seems even somewhat related is
4259fba7e6?