Skip to content
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

Merged
merged 3 commits into from
Jan 28, 2019
Merged

Simplify ConstValue::ScalarPair #57442

merged 3 commits into from
Jan 28, 2019

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jan 8, 2019

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 8, 2019
/// 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),
Copy link
Member

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.

@RalfJung
Copy link
Member

RalfJung commented Jan 9, 2019

Nice! r=me with the comment fixed.

@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 9, 2019

@bors r=RalfJung

@bors
Copy link
Contributor

bors commented Jan 9, 2019

📌 Commit 3fba811 has been approved by RalfJung

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2019
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 9, 2019

@bors r=RalfJung

@bors
Copy link
Contributor

bors commented Jan 9, 2019

📌 Commit 3177a6f has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Jan 10, 2019

⌛ Testing commit 3177a6f with merge e0f0935a9bb44cbac7917ae2d2a6e7936cb60f17...

@bors
Copy link
Contributor

bors commented Jan 10, 2019

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 10, 2019
@RalfJung
Copy link
Member

Log is empty. Probably spurious.

Cc @rust-lang/infra: same as #57351 (comment)

@RalfJung
Copy link
Member

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 10, 2019
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Jan 12, 2019
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
@Centril
Copy link
Contributor

Centril commented Jan 13, 2019

@bors r-

Failed in rollup, #57554 (comment)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 13, 2019
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 14, 2019

@bors r=RalfJung

@bors
Copy link
Contributor

bors commented Jan 14, 2019

📌 Commit d7f57d4 has been approved by RalfJung

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 26, 2019
@oli-obk
Copy link
Contributor Author

oli-obk commented Jan 27, 2019

@bors r=RalfJung

@bors
Copy link
Contributor

bors commented Jan 27, 2019

📌 Commit fe50b4e has been approved by RalfJung

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 27, 2019
Centril added a commit to Centril/rust that referenced this pull request Jan 27, 2019
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
Copy link
Contributor

bors commented Jan 28, 2019

⌛ Testing commit fe50b4e with merge d2bdef561cf118a8795ec962ee501dc17d097c76...

@bors
Copy link
Contributor

bors commented Jan 28, 2019

💔 Test failed - status-appveyor

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 28, 2019
@Centril
Copy link
Contributor

Centril commented Jan 28, 2019

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 28, 2019
@rust-highfive
Copy link
Collaborator

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.
Cloning into 'rust-lang/rust'...
travis_time:end:088bef61:start=1548636286613029111,finish=1548636292588140134,duration=5975111023
$ cd rust-lang/rust
$ git checkout -qf d2bdef561cf118a8795ec962ee501dc17d097c76
fatal: reference is not a tree: d2bdef561cf118a8795ec962ee501dc17d097c76
The command "git checkout -qf d2bdef561cf118a8795ec962ee501dc17d097c76" failed and exited with 128 during .
Your build has been stopped.

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 @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Jan 28, 2019

⌛ Testing commit fe50b4e with merge ec504de...

bors added a commit that referenced this pull request Jan 28, 2019
Simplify `ConstValue::ScalarPair`

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
@bors
Copy link
Contributor

bors commented Jan 28, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: RalfJung
Pushing ec504de to master...

Copy link
Contributor

@rasendubi rasendubi left a 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`
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants