Uh oh!
There was an error while loading. Please reload this page.
Short-cut T: Sized trait selection for ADTs - #33138
Conversation
There was a problem hiding this comment.
nit: s/confiriming/confirming/
arielb1
commented
Apr 21, 2016
I rationalized the WF behaviour for tuples - this needs a crater run. |
nikomatsakis
commented
Apr 22, 2016
crater run launched |
nikomatsakis
commented
Apr 22, 2016
Crater run failed because building this branch failed: https://tools.taskcluster.net/task-inspector/#eqYUkXetSja7miFf4nXmeQ/0 |
There was a problem hiding this comment.
Total nit: I personally prefer the "main method" to be listed first, and the auxiliary helper methods to be listed below it. I find it easier to read (and indeed I was confused reading this patch for a bit, since the "flow" of code was interrupted by helper fns.) But feel free to ignore me if you would rather keep the current ordering.
There was a problem hiding this comment.
I just rewrote this code about half-a-dozen times.
There was a problem hiding this comment.
I would add to this comment to say:
"One fix would be lazy normalization. At the moment, we do still eagerly normalize, but we still skip the normalization step because, in PR #33138, we only consider the last field of Vec, which is a usize."
nikomatsakis
commented
Apr 22, 2016
@arielb1 this is a beautiful patch. I would r+ it, except that I think it violates my proposed stability policy. I think we ought to be making an effort to either issue warnings or at least issue targeted errors regarding the new changes. Moreover, this seems to be a case where we could readily do so. I am happy to write up the "breaking change issue description" if you like. In any case, you should fix the branch so we can do a crater run and test things. |
Are you talking about the tuple: Sized issue? I don't feel like introducing RFC1214 obligations again. But maybe we need such a framework in general for handling warnings? |
nikomatsakis
commented
Apr 22, 2016
@arielb1 I am talking about the |
nikomatsakis
commented
Apr 22, 2016
Failing that, we could issue an error, but at least direct people to some place that explains the fix. That may be sufficient, and doesn't require as much precision, since it's ok to direct people unnecessarily. |
nikomatsakis
commented
Apr 22, 2016
(I'd like to see the crater impact; if it is zero or very minimal, issuing an error and trying to direct people is probably adequate.) |
arielb1
commented
Apr 22, 2016
Reporting a warning would put us in caching hell. I will improve the error message. |
nikomatsakis
commented
Apr 22, 2016
@arielb1 ok, but let's get the crater run going too. |
arielb1
commented
Apr 22, 2016
Done. |
nikomatsakis
commented
Apr 22, 2016
@arielb1 crater run started |
nikomatsakis
commented
Apr 22, 2016
Crater run results: https://gist.github.com/nikomatsakis/abb0ed492d3cb785af858b87ad3b95fd
I've not investigated these at all. |
jonas-schievink
commented
Apr 22, 2016
|
nikomatsakis
commented
Apr 22, 2016
Tricky. It seems like we can pull that change to tuples out into a distinct PR, and introduce as a warning first -- it may be that we can write some a kind of "warning post-pass" that checks all tuples types that occur in trait methods and issues warnings. This wouldn't cover all possible cases, but hopefully it would hit those that occur in practice (I think they are mostly tied to default methods?). Breaking 34 crates without a warning period seems ungood. cc @rust-lang/core |
The problem is that allowing tuples with unsized elements to be sized is too much of a footgun. I guess I should just disallow that. |
@nikomatsakis Fixing rayon cleans up a majority of that list, so it's not so bad. ndarray has been fixed with 0.5.1. |
this commit should be reverted after a release cycle
arielb1
commented
May 3, 2016
rebased |
There was a problem hiding this comment.
Should we add info for OBJECT_UNSAFE_FRAGMENT too?
Also, can you point this at the summary issue that I see you are drafting? (#33242)
nikomatsakis
commented
May 3, 2016
@bors r+ |
bors
commented
May 3, 2016
📌 Commit 2d0fcc9 has been approved by |
arielb1
commented
May 4, 2016
@bors r=nikomatsakis |
bors
commented
May 4, 2016
📌 Commit ef581db has been approved by |
arielb1
commented
May 4, 2016
@bors r=nikomatsakis |
bors
commented
May 4, 2016
📌 Commit 238e4ee has been approved by |
bors
commented
May 6, 2016
Short-cut `T: Sized` trait selection for ADTs Basically avoids all nested obligations when checking whether an ADT is sized - this speeds up typeck by ~15% The refactoring fixed#32963, but I also want to make `Copy` not object-safe (will commit that soon). Fixes#33201 r? @nikomatsakis
Basically avoids all nested obligations when checking whether an ADT is sized - this speeds up typeck by ~15%
The refactoring fixed#32963, but I also want to make
Copynot object-safe (will commit that soon).Fixes#33201
r? @nikomatsakis