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

remove ?Sized bounds from Index #59527

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
7 participants
@matklad
Copy link
Member

matklad commented Mar 29, 2019

I've noticed that we have an Idx: ?Sized bound on the index in the Index, which seems strange given that we accept index by value. My guess is that it was meant to be removed in #23601, but was overlooked.

If I remove this bound, ./x.py src/libstd/ src/libcore/ passes, which means at least that this is not covered by test.

I think there's three things we can do here:

  • run crater with the bound removed to check if there are any regressions, and merge this, to be consistent with other operator traits
  • run crater, get regressions, write a test for this with a note that "hey, we tried to fix it, its unfixable"
  • decide, in the light of by-value DSTs, that this is a feature rather than a bug, and add a test

cc @rust-lang/libs

EDIT: the forth alternative is that there exist a genuine reason why this is the case, but I failed to see it :D

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Mar 29, 2019

r? @joshtriplett

(rust_highfive has picked a reviewer for you, use r? to override)

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 29, 2019

So this was not the PR I expected.

My guess is that it was meant to be removed in #23601, but was overlooked.

Perhaps. But if so, this is to me a happy accident.

run crater with the bound removed to check if there are any regressions, and merge this, to be consistent with other operator traits

I don't mind running crater, but I would not want to remove the bound when unsized_locals isn't stable and because its a future-compat hazard. Consistency is not a sufficient justification for that imo even if you find zero regressions.

decide, in the light of by-value DSTs, that this is a feature rather than a bug, and add a test

We can add a test now and later remove it if we change our minds.

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 29, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 29, 2019

⌛️ Trying commit a6b130e with merge 47f4f94...

bors added a commit that referenced this pull request Mar 29, 2019

Auto merge of #59527 - matklad:sized-index, r=<try>
remove ?Sized bounds from Index

I've noticed that we have an `Idx: ?Sized` bound on the **index** in the `Index`, which seems strange given that we accept index by value. My guess is that it was meant to be removed in #23601, but was overlooked.

If I remove this bound, `./x.py src/libstd/ src/libcore/` passes, which means at least that this is not covered by test.

I think there's three things we can do here:

* run crater with the bound removed to check if there are any regressions, and merge this, to be consistent with other operator traits
* run crater, get regressions, write a test for this with a note that "hey, we tried to fix it, its unfixable"
* decide, in the light of by-value DSTs, that this is a feature rather than a bug, and add a test

cc @rust-lang/libs

EDIT: the forth alternative is that there exist a genuine reason why this is the case, but I failed to see it :D
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Mar 29, 2019

☀️ Try build successful - checks-travis
Build commit: 47f4f94

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 29, 2019

@craterbot run mode=check-only

@craterbot

This comment has been minimized.

Copy link
Collaborator

craterbot commented Mar 29, 2019

👌 Experiment pr-59527 created and queued.
🤖 Automatically detected try build 47f4f94
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment has been minimized.

Copy link
Collaborator

craterbot commented Mar 29, 2019

🚧 Experiment pr-59527 is now running on agent aws-3-tmp.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@sfackler

This comment has been minimized.

Copy link
Member

sfackler commented Mar 29, 2019

What concrete problem is this solving, exactly? It's not clear to me why we should invest crater/person time on removing this bound.

@Centril

This comment has been minimized.

Copy link
Contributor

Centril commented Mar 29, 2019

@matklad

This comment has been minimized.

Copy link
Member Author

matklad commented Mar 29, 2019

@sfackler I agree that this is basically a non-issue, except for the mere fact that we have a random untested bound in std’s public API.

@craterbot

This comment has been minimized.

Copy link
Collaborator

craterbot commented Mar 30, 2019

🎉 Experiment pr-59527 is completed!
📊 0 regressed and 0 fixed (50551 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.