-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Possible regression at nightly-2016-06-15 for include_str! macro #34431
Comments
Edit: Apparently not, testing with that commit reverted did not fix the problem. |
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);
}} |
@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 |
@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. |
@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. |
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. |
@stacker agreed -- we would only consider the change if crater found virtually no breakage. |
I think this is the correct semantics, anywhere to file an issue for macros 2.0? |
For the extern crate perhaps something like scheme's |
Maybe comment on one if @nrc''s RFCs -- probably RFC 1584. |
Hmm, I'll have to look into |
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 onab0b87458
and all prior (including stable).The error message I get is:
The only commit that seems even somewhat related is
4259fba7e6
?The text was updated successfully, but these errors were encountered: