-
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
Simplify ConstValue::ScalarPair
#57442
Conversation
/// Needed for pattern matching code related to slices and strings. | ||
ScalarPair(Scalar, Scalar), | ||
/// Used only for slices and strings (`&[T]`, `&str`, `*const [T]`, `*mut str`, `Box<str>`, ...) | ||
Slice(Scalar, u64), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this name change; ScalarPair
felt a little bit cryptic.
Nice! r=me with the comment fixed. |
@bors r=RalfJung |
📌 Commit 3fba811 has been approved by |
@bors r=RalfJung |
📌 Commit 3177a6f has been approved by |
⌛ Testing commit 3177a6f with merge e0f0935a9bb44cbac7917ae2d2a6e7936cb60f17... |
💔 Test failed - status-appveyor |
Log is empty. Probably spurious. Cc @rust-lang/infra: same as #57351 (comment) |
@bors retry |
Simplify `ConstValue::ScalarPair` While looking at rust-lang#57432 I realized that some of our types for representing constants are very big. This reduces `LazyConst` to 3/4th of its original size and simplifies some code around slices at the same time. r? @RalfJung
@bors r- Failed in rollup, #57554 (comment) |
@bors r=RalfJung |
📌 Commit d7f57d4 has been approved by |
@bors r=RalfJung |
📌 Commit fe50b4e has been approved by |
Simplify `ConstValue::ScalarPair` While looking at rust-lang#57432 I realized that some of our types for representing constants are very big. This reduces `LazyConst` to 3/4th of its original size and simplifies some code around slices at the same time. r? @RalfJung
⌛ Testing commit fe50b4e with merge d2bdef561cf118a8795ec962ee501dc17d097c76... |
💔 Test failed - status-appveyor |
@bors retry |
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
☀️ Test successful - checks-travis, status-appveyor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, rustc-guide refers to ScalarPair
in const-eval
and miri
chapters.
@@ -22,22 +22,28 @@ pub enum ConstValue<'tcx> { | |||
/// Not using the enum `Value` to encode that this must not be `Undef` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment above needs an update as there is no more ScalarPair
/// Represents a constant value in Rust. Scalar and ScalarPair are optimizations which
/// matches the LocalValue optimizations for easy conversions between Value and ConstValue.
While looking at #57432 I realized that some of our types for representing constants are very big. This reduces
LazyConst
to 3/4th of its original size and simplifies some code around slices at the same time.r? @RalfJung