Merged
Conversation
Change `bytes!()` to return
{
static BYTES: &'static [u8] = &[...];
BYTES
}
This gives it the `'static` lifetime, whereas before it had an rvalue
lifetime. Until recently this would have prevented assigning `bytes!()`
to a static, as in
static FOO: &'static [u8] = bytes!(1,2,3);
but rust-lang#14183 fixed it so blocks are now allowed in constant expressions
(with restrictions).
Fixes rust-lang#11641.
bors
added a commit
that referenced
this pull request
May 18, 2014
Change `bytes!()` to return
{
static BYTES: &'static [u8] = &[...];
BYTES
}
This gives it the `'static` lifetime, whereas before it had an rvalue
lifetime. Until recently this would have prevented assigning `bytes!()`
to a static, as in
static FOO: &'static [u8] = bytes!(1,2,3);
but #14183 fixed it so blocks are now allowed in constant expressions
(with restrictions).
Fixes #11641.
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Mar 13, 2023
Evaluate consts in `path_to_const` fix rust-lang#14275
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 5, 2023
MIR episode 4 In lowering, it now supports overloaded and arith assignment binary operators, statics. and constants in patterns. There is now 252 functions that we fail to emit mir for them, and the majority of them are due type mismatches or other deep and unrelated issues (but it isn't done yet, for example slice patterns and destructing assignment is not implemented yet). In evaluating, it now can evaluate associated constants in traits (so now typenum's `U5::ToConst` should work), allocator functions, atomic intrinsics, and some more things. It also provides a (hacky) basis for making progress in rust-lang#14275. I also added a `Interpret` code lens to `Run` and `Debug` when the experimental `interpret tests` is enabled (previously it showed result in hover, which was unusable even for debugging) Changes in unrelated files are: * Changes substitutions of closures, now it includes parent substs ~~before~~ after `sig_ty`. * ~~A salsa input for retrieving the path of a file id, used in emitting stack trace for interpret result.~~ * Normalizing associated types in layout computing
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 5, 2023
Lazy evaluate consts in `path_to_const` fix rust-lang#14275
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change
bytes!()to returnThis gives it the
'staticlifetime, whereas before it had an rvaluelifetime. Until recently this would have prevented assigning
bytes!()to a static, as in
but #14183 fixed it so blocks are now allowed in constant expressions
(with restrictions).
Fixes #11641.