Uh oh!
There was an error while loading. Please reload this page.
stabilize outlives requirements - #53793
Conversation
There was a problem hiding this comment.
I was unsure why the error changed and why i needed this. Also is there is a better way to handle this?
toidiu
commented
Aug 29, 2018
I forgot to update the documentation. So will be pushing another commit. |
This comment has been minimized.
This comment has been minimized.
killercup
commented
Aug 29, 2018
s/stabalize/stabilize |
nikomatsakis
left a comment
There was a problem hiding this comment.
So the main thing is that I think we should make a bigger effort to preserve some of the existing tests rather than deleting them. In particular, they were testing aspects of the WF definition and they just happened to be doing so as part of enum/struct fields. There are other ways to test that same code so we ought to port.
There was a problem hiding this comment.
Do we need this, really? It seems like we can't be relying on it...
There was a problem hiding this comment.
although https://forge.rust-lang.org/stabilization-guide.html says that we want to leave it to compile the stage0 compiler.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
we can add a // compile-pass comment instead of deleting these tests
There was a problem hiding this comment.
Hmm, I'm not sure about deleting these tests. Maybe we should change them (for now) to use 'static instead of 'a? Seems like it would preserve the original intention of the test .. more or less.
There was a problem hiding this comment.
Alternatively, we could add this to the test:
traitDummy<'a>{typeOut;}impl<'a,T>Dummy<'a>forTwhereT:'a{typeOut = ();}typeRequireOutlives<'a,T> = <TasDummy<'a>>::Out;and then replace &'a T with RequireOutlives<'a, T>.
This just exploits a weakness in the inference. Kind of horrible though. Maybe move that code over into rfc-2093-infer-outlives directory, too? (e.g., to test the cases where inference is expected to fail)
I suppose in principle we could keep the original test too and make it // compile-pass but...presumably... we added equivalent tests for infer-outlives? Yeah, I see things like src/test/ui/rfc-2093-infer-outlives/enum.rs, which seem pretty similar.
There was a problem hiding this comment.
we could .. I think .. test this like so:
traitTrait<'a,'b>{typeOut;}impl<'a,'b>Trait<'a,'b>{typeOut = &'aFoo<&'bi32>;//~ ERROR reference has a longer lifetime}Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
we can rewrite this using the trait/impl trick like
traitDummy<'a>{typeOut;}impl<'a,T>Dummy<'a>forT{typeOut = &'afn(T);//~ ERROR E0389There was a problem hiding this comment.
this is out of date, I guess, though not your fault :)
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
toidiu
commented
Sep 1, 2018
@nikomatsakis believe i addressed all your comments. I added There are some cases where we have now have redundant tests but I am not certain if that is a bad thing. Docs: |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
zackmdavis
commented
Sep 2, 2018
@toidiu It may be worth coordinating this with #53013 (a lint for soon-to-be-unnecessary outlives-bounds), the current version of which introduces a new check for the |
This comment has been minimized.
This comment has been minimized.
toidiu
commented
Sep 4, 2018
@zackmdavis I ran into some trouble testing and reproducing the errors locally. Its a short week but I would like to get this ready for merge by end of week. If however your PR is ready then please go ahead (dont want this to be a blocker) and I can easily rebase. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@nikomatsakis I am getting a cryptic error and dont know how to approach it/reproduce it locally or what exactly is causing the error :( |
zackmdavis
commented
Sep 5, 2018
nikomatsakis
commented
Sep 5, 2018
to be more specific, on master, the definition for E0309 includes this: rust/src/librustc/diagnostics.rs Lines 1240 to 1246 in d8af8b6 this code no longer generates the error, so we have to rework the example. In fact, I think we should rework the whole section for E0309. In particular, I think that this error can only really arise due to associated types in the structure definition, so maybe we can specialize the text: The type definition contains some field whose type Here, the where clause |
nikomatsakis
commented
Sep 5, 2018
For E0491, we'll need to make a similar adjustment to the example. A reference has a longer lifetime than the data it references. Erroneous code example: Here, the problem is that a reference type like |
nikomatsakis
commented
Sep 5, 2018
I took the liberty of pasting those descriptions in. |
There was a problem hiding this comment.
The test was failing for me locally until I added this. Although I am wondering if it was simply a bad local setup (same with a few other tests).
I would like to try and get to a passing state and then try to undo this change to see if things still pass.
There was a problem hiding this comment.
I don't quite know why this one changed, but I'm .. less concerned about it. Probably worth figuring out but might have to do with code executing in a somewhat different order than before owing to the new queries.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
rust-highfive
commented
Sep 6, 2018
The job 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 |
toidiu
commented
Sep 6, 2018
Looks like a passing PR. Going to remove |
bors
commented
Sep 12, 2018
☀️ Test successful - status-appveyor, status-travis |
nnethercote
commented
Sep 22, 2018
This hurt compile speed for @toidui: any thoughts? |
nnethercote
commented
Sep 22, 2018
It also hurt max-rss on incremental builds by up to 10%: |
toidiu
commented
Sep 23, 2018
@nnethercote this was the first large PR i committed to rust so please excuse my lack of knowledge and procedure. What steps can I take to rectify the degraded performance? I am also available on rustlang discord and zulip (username: toidiu) is some of this is better for offline discussion. |
@toidiu: if you are on Linux, the best way would be to do Cachegrind runs on two revisions -- the one before your change landed, and the following revision -- and then do a diff. Instructions on how to do a Cachegrind run are here: https://github.com/rust-lang-nursery/rustc-perf/blob/master/collector/README.md |
eddyb
commented
Sep 24, 2018
@nikomatsakis or @arielb1 could also look at this - they already have things set up for profiling. |
nnethercote
commented
Sep 24, 2018
They could, but I want to encourage more people to become familiar with profiling the compiler. It's not too hard now, if you're on Linux. And if there are ideas on how to make it easier, I'd love to hear them. |
toidiu
commented
Sep 27, 2018
So from what I understand
I am wondering if its possible to download the pre-compiled versions of the two branches from somewhere rather than building them locally (takes a long time)? |
nnethercote
commented
Sep 27, 2018
Correct!
Not that I know of. |
@nnethercote Btw will this work on a mac? I got the error |
nnethercote
commented
Oct 3, 2018
Benchmarking (with |
toidiu
commented
Oct 4, 2018
I am getting the following errors on my mac: error: |
nnethercote
commented
Oct 5, 2018
I have fixed that in rust-lang/rustc-perf#288. Unfortunately, it's not enough to get it working, at least on my MacOS 10.12 laptop. Cachegrind starts up ok but doesn't produce an output file, for reasons I haven't yet determined. |
toidiu
commented
Oct 8, 2018
Yes ran it locally and also still getting an error. Here is the full output: https://pastebin.com/xhjEKKr5 |
nnethercote
commented
Oct 9, 2018
This means you don't have Valgrind installed. |
toidiu
commented
Oct 11, 2018
I installed Valgrind ran the @nnethercote I am wondering if there is a path forward where I dont have to rely on my local machine which is not a Linux. |
nnethercote
commented
Oct 11, 2018
No path I can see, unfortunately. |
You can rent an AWS and work ssh-ed into it (tip: use |
toidiu
commented
Oct 14, 2018
I haz procured a Linux. I started running the collector and it seems to be taking a very long time.. been running for multiple hours. Any idea how long it will take to complete? @nnethercote since you asked before; making it easier to get see and analyze the results might an area for improvement. I imagine that someone somewhere already ran these results to conclude that this PR caused a regression. I wonder if it would be possible to reuse those outputs rather then having to rerun them locally? |
#44493
r? @nikomatsakis