-
Notifications
You must be signed in to change notification settings - Fork 39
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
include_dir generates function calls that need promotion, leading to issues with Rust 1.79+ #99
Comments
This was odd. I tried running the crate's tests with 1.79 and I've made the fix anyway. Let's see if it resolves things for other people. |
Thanks for the quick fix!
Yeah, rust-lang/rust#121557 is rather odd, making it tricky to write a good test. This still works fine: pub static ASSETS_DIR: Option<include_dir::Dir<'_>> = Some(include_dir::include_dir!("$CARGO_MANIFEST_DIR/assets")); but putting the |
Apparently, this crate generates code like
It then relies on the part in
&[...]
to be const-promoted. However, const-promotion of arbitrary function calls is problematic, and in Rust 1.79 it has been limited to only occur in straight-line code, causing compilation failures for some users of this crate.The intended way to obtain
'static
references to things computed byconst fn
is to make this explicitlyconst
-- either viaconst { ... }
blocks, or (when support for older versions of Rust is required), via explicitconst
items:Would be good to get this crate updated to avoid problems related to promotion of function calls. :)
The text was updated successfully, but these errors were encountered: