Stream: t-compiler/wg-nll

Topic: issue-51710-lazy-causal-tracking


nikomatsakis (Jun 22 2018 at 14:07, on Zulip):

I just opened https://github.com/rust-lang/rust/issues/51710, which describes a way to win 4% more in performance. Anybody interested in working on this? (I could also do a twitter call out)

Santiago Pastorino (Jun 22 2018 at 14:14, on Zulip):

I'd be interested

nikomatsakis (Jun 22 2018 at 14:19, on Zulip):

ok let me know if the directions need clarification :)

Santiago Pastorino (Jun 22 2018 at 14:44, on Zulip):

:+1:

Santiago Pastorino (Jun 22 2018 at 14:44, on Zulip):

how urgent is this?

nikomatsakis (Jun 22 2018 at 15:05, on Zulip):

I would call it one of the top priority tasks? tackling perf + diagnostics together

nikomatsakis (Jun 25 2018 at 19:46, on Zulip):

did you look into this at all @Santiago Pastorino ?

Santiago Pastorino (Jun 25 2018 at 21:06, on Zulip):

not yet, I can start now I guess

nikomatsakis (Jun 26 2018 at 11:25, on Zulip):

@Santiago Pastorino how goes? :)

Santiago Pastorino (Jun 26 2018 at 13:48, on Zulip):

@nikomatsakis couldn't start yesterday, but I'm going to start in a bit

Santiago Pastorino (Jun 26 2018 at 18:35, on Zulip):

@nikomatsakis I've started

Santiago Pastorino (Jun 26 2018 at 18:35, on Zulip):

removed https://github.com/spastorino/rust/commit/8cf540a8183e864e1dafda032c94aee6d50e2adf

Santiago Pastorino (Jun 26 2018 at 18:37, on Zulip):

the idea now is here https://github.com/rust-lang/rust/blob/01dbfdaf4f45b68b49332b8785262a3a780d0a19/src/librustc_mir/borrow_check/nll/region_infer/mod.rs#L1067-L1068

Santiago Pastorino (Jun 26 2018 at 18:37, on Zulip):

instead of that

Santiago Pastorino (Jun 26 2018 at 18:38, on Zulip):

do ... BFS over the MIR graph from elem (a Location), looking for points that may use the region region_sub that we are interested in

nikomatsakis (Jun 26 2018 at 18:39, on Zulip):

yep

nikomatsakis (Jun 26 2018 at 18:39, on Zulip):

does that make sense?

Santiago Pastorino (Jun 26 2018 at 18:47, on Zulip):

yes

Santiago Pastorino (Jun 26 2018 at 18:47, on Zulip):

makes sense :)

Santiago Pastorino (Jun 26 2018 at 18:47, on Zulip):

@nikomatsakis help me to remember, I think there's similar code to this already, right?

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

I'm trying to remember

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

I do have some vague memory of doing something like this

Santiago Pastorino (Jun 26 2018 at 18:48, on Zulip):

if you don't remember from the top of your head don't worry

Santiago Pastorino (Jun 26 2018 at 18:48, on Zulip):

I can search

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

I mean there is the find_assignment code

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

but that doesn't really do a DFS or BFS

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

but I feel like we maybe wrote some code to do that...?

Santiago Pastorino (Jun 26 2018 at 18:48, on Zulip):

I think I've already done a BFS over mir

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

right

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

ah yes

nikomatsakis (Jun 26 2018 at 18:48, on Zulip):

I think we were using it... hmm right

nikomatsakis (Jun 26 2018 at 18:49, on Zulip):

actually it's related

nikomatsakis (Jun 26 2018 at 18:49, on Zulip):

gimme a second

Santiago Pastorino (Jun 26 2018 at 18:49, on Zulip):

yes, I have vague reminds of something related, hehe

nikomatsakis (Jun 26 2018 at 18:49, on Zulip):

https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs#L128-L170

Santiago Pastorino (Jun 26 2018 at 18:49, on Zulip):

man, I need to get memory pills :P

nikomatsakis (Jun 26 2018 at 18:49, on Zulip):

this is ... kind of the same thing

nikomatsakis (Jun 26 2018 at 18:49, on Zulip):

that is, there might be an opportunity to simplify the setup here

Santiago Pastorino (Jun 26 2018 at 18:50, on Zulip):

that's what I was looking for

Santiago Pastorino (Jun 26 2018 at 18:50, on Zulip):

I wrote that

Santiago Pastorino (Jun 26 2018 at 18:50, on Zulip):

or you wrote it and I pasted it :P

nikomatsakis (Jun 26 2018 at 18:50, on Zulip):

yep

nikomatsakis (Jun 26 2018 at 18:50, on Zulip):

so the setup is a bit "indirect" right now

nikomatsakis (Jun 26 2018 at 18:50, on Zulip):

we invoke why_region_contains_point(R, P) to find out why the region R includes the point P

nikomatsakis (Jun 26 2018 at 18:51, on Zulip):

and it returns something like LiveVar(X, L) saying:

nikomatsakis (Jun 26 2018 at 18:51, on Zulip):

the region R includes the point P because the variable X is live

nikomatsakis (Jun 26 2018 at 18:51, on Zulip):

(and, presumably, the type of X includes R)

nikomatsakis (Jun 26 2018 at 18:51, on Zulip):

although it may not actually be R

nikomatsakis (Jun 26 2018 at 18:51, on Zulip):

it's more like "and the type of X includes some region R1 where R: R1"

nikomatsakis (Jun 26 2018 at 18:52, on Zulip):

so then we know that the variable X is live at this point L -- but that just means it may be used at some point in the future

nikomatsakis (Jun 26 2018 at 18:52, on Zulip):

we don't actually know where it is used

nikomatsakis (Jun 26 2018 at 18:52, on Zulip):

this is you are doing the BFS

nikomatsakis (Jun 26 2018 at 18:52, on Zulip):

(in the code as it works today)

nikomatsakis (Jun 26 2018 at 18:52, on Zulip):

so if we were to add another BFS in order to reproduce the current setup, that would be kind of silly

nikomatsakis (Jun 26 2018 at 18:53, on Zulip):

we would basically be doing a BFS to find the use of X

nikomatsakis (Jun 26 2018 at 18:53, on Zulip):

er, to find the use of some variable that includes R1

nikomatsakis (Jun 26 2018 at 18:53, on Zulip):

and then doing another BFS later on to find that use again

nikomatsakis (Jun 26 2018 at 18:53, on Zulip):

(with me so far .. ?)

Santiago Pastorino (Jun 26 2018 at 19:28, on Zulip):

hey, back

Santiago Pastorino (Jun 26 2018 at 19:28, on Zulip):

sorry, need to read

Santiago Pastorino (Jun 26 2018 at 19:28, on Zulip):

well actually we have the meeting in 3 :)

Santiago Pastorino (Jun 27 2018 at 02:51, on Zulip):

@nikomatsakis read what you wrote

Santiago Pastorino (Jun 27 2018 at 02:51, on Zulip):

so if we were to add another BFS in order to reproduce the current setup, that would be kind of silly

I didn't understand since this point on

Santiago Pastorino (Jun 27 2018 at 02:52, on Zulip):

unsure if you're saying that the strategy doesn't make sense or what

nikomatsakis (Jun 27 2018 at 09:19, on Zulip):

@Santiago Pastorino I am saying that the strategy I described in the issue doesn't, I don't think, quite make sense -- we can probably do something simpler

nikomatsakis (Jun 27 2018 at 09:26, on Zulip):

I'm writing some notes in the issue

nikomatsakis (Jun 27 2018 at 09:29, on Zulip):

notes are here

nikomatsakis (Jun 27 2018 at 09:29, on Zulip):

I guess it's not so much that the strategy I described doesn't make sense

nikomatsakis (Jun 27 2018 at 09:29, on Zulip):

as that we can move the BFS from where it is and use it

Santiago Pastorino (Jun 27 2018 at 18:18, on Zulip):

@nikomatsakis questions ...

Santiago Pastorino (Jun 27 2018 at 18:19, on Zulip):

so I need to look from a location (elem in the code) look for points that may use the region (region_sub in the code)

Santiago Pastorino (Jun 27 2018 at 18:20, on Zulip):

so for any local variable that's contained in region_sub

Santiago Pastorino (Jun 27 2018 at 18:24, on Zulip):

if that's correct ... I'm looking for how to get all the local vars contained on a region

Santiago Pastorino (Jun 27 2018 at 18:24, on Zulip):

I guess that's not what I need to do ... hmmm

Santiago Pastorino (Jun 27 2018 at 18:25, on Zulip):

I guess I need to go statement by statement and see if there's a local used there that is contained in the region

nikomatsakis (Jun 27 2018 at 18:25, on Zulip):

well

nikomatsakis (Jun 27 2018 at 18:25, on Zulip):

we are already visiting locals, right?

nikomatsakis (Jun 27 2018 at 18:25, on Zulip):

so that we can look for the one we wanted?

nikomatsakis (Jun 27 2018 at 18:26, on Zulip):

we should be able to modify that check so that, instead of:

if local == self.local_I_am_looking_for { ... }
nikomatsakis (Jun 27 2018 at 18:26, on Zulip):

it does something like

Santiago Pastorino (Jun 27 2018 at 18:26, on Zulip):

yes, we are visiting locals

nikomatsakis (Jun 27 2018 at 18:26, on Zulip):
if region.appears_in(type_of(local)) { ... }
Santiago Pastorino (Jun 27 2018 at 18:26, on Zulip):

yeah

Santiago Pastorino (Jun 27 2018 at 18:26, on Zulip):

something like that

Santiago Pastorino (Jun 27 2018 at 18:26, on Zulip):

appears_in is pseudo code, right? or does that exist?

Santiago Pastorino (Jun 27 2018 at 18:26, on Zulip):

:P

Santiago Pastorino (Jun 27 2018 at 18:38, on Zulip):

another thing, how do I get the MirBorrowckCtxt from RegionInferenceContext?

Santiago Pastorino (Jun 27 2018 at 18:39, on Zulip):

I need Mir and MirBorrowckCtxt

nikomatsakis (Jun 27 2018 at 18:40, on Zulip):

you cannot get those things

nikomatsakis (Jun 27 2018 at 18:40, on Zulip):

and you should not want them :)

nikomatsakis (Jun 27 2018 at 18:40, on Zulip):

you may need to thread down some additional data though ...

nikomatsakis (Jun 27 2018 at 18:40, on Zulip):

what do you need from the MirBorrowckCtxt?

nikomatsakis (Jun 27 2018 at 18:40, on Zulip):

(the Mir you can thread down readily enough...)

nikomatsakis (Jun 27 2018 at 18:40, on Zulip):

we may also want to move these methods somewhere else

nikomatsakis (Jun 27 2018 at 18:41, on Zulip):

that is, the explain_why_region_contains_point might just return the region_sub value

nikomatsakis (Jun 27 2018 at 18:41, on Zulip):

and we can move the walk outside of it

Santiago Pastorino (Jun 27 2018 at 18:41, on Zulip):
        if !self.regioncx.region_contains_point(self.borrow.region, p) {
Santiago Pastorino (Jun 27 2018 at 18:42, on Zulip):

that is, the explain_why_region_contains_point might just return the region_sub value

well if we do that is possible to get the stuff

nikomatsakis (Jun 27 2018 at 18:42, on Zulip):

right

Santiago Pastorino (Jun 27 2018 at 18:42, on Zulip):

and also I guess change the method name

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

my point is that the RegionInferenceContext does not have access to the MirBorowckCtxt and should not

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

that's just not how the layers are setup

Santiago Pastorino (Jun 27 2018 at 18:43, on Zulip):

ya

Santiago Pastorino (Jun 27 2018 at 18:43, on Zulip):

ok

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

but wait

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

if !self.regioncx.region_contains_point(self.borrow.region, p) {

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

if that is the thing that you use from the MirBorrowckCtxt

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

self.regioncx is the region inference context

nikomatsakis (Jun 27 2018 at 18:43, on Zulip):

so that is just self

Santiago Pastorino (Jun 27 2018 at 18:44, on Zulip):

ahh, hehe, right :)

Santiago Pastorino (Jun 27 2018 at 18:48, on Zulip):

@nikomatsakis so should I move the Find stuff or just leave it there, since I don't need MirBorrowckCtxt?

nikomatsakis (Jun 27 2018 at 18:50, on Zulip):

to me it seems cleaner to move it

nikomatsakis (Jun 27 2018 at 18:50, on Zulip):

then explain_why_borrow_contains_point can return the full explanation

Santiago Pastorino (Jun 27 2018 at 18:51, on Zulip):

move it where?

Santiago Pastorino (Jun 27 2018 at 18:52, on Zulip):

just in case we are on the same page, I've already moved the finder to region_infer/mod.rs

Santiago Pastorino (Jun 27 2018 at 18:52, on Zulip):

are you saying that I should move it out from there?

Santiago Pastorino (Jun 27 2018 at 18:53, on Zulip):

or from explain_borrow/mod.rs? <- if this, it's already out there :)

Santiago Pastorino (Jun 27 2018 at 18:54, on Zulip):

I guess fits more inside explain_borrow

Santiago Pastorino (Jun 27 2018 at 18:54, on Zulip):

and maybe in a new file, right?

Santiago Pastorino (Jun 27 2018 at 18:54, on Zulip):

explain_borrow/find_use.rs or something like this

nikomatsakis (Jun 27 2018 at 18:57, on Zulip):

that would be my preference

Santiago Pastorino (Jun 27 2018 at 19:01, on Zulip):

yeah, makes sense

Santiago Pastorino (Jun 27 2018 at 19:50, on Zulip):

@nikomatsakis I was wondering about all the DefUses logic in finder

nikomatsakis (Jun 27 2018 at 19:50, on Zulip):

yes

Santiago Pastorino (Jun 27 2018 at 19:50, on Zulip):

why is all that needed if we are looking for uses?

Santiago Pastorino (Jun 27 2018 at 19:59, on Zulip):

forget about what I've asked :P

Santiago Pastorino (Jun 27 2018 at 19:59, on Zulip):

it's completely clear in the code

Santiago Pastorino (Jun 27 2018 at 20:16, on Zulip):

@nikomatsakis how do you go from RegionVid to BorrowData?

nikomatsakis (Jun 27 2018 at 20:16, on Zulip):

you cannot in general do that

nikomatsakis (Jun 27 2018 at 20:17, on Zulip):

that is, only some regions have an associated BorrowData

nikomatsakis (Jun 27 2018 at 20:17, on Zulip):

why do you need to do that ?

Santiago Pastorino (Jun 27 2018 at 20:23, on Zulip):

actually I probably don't

Santiago Pastorino (Jun 27 2018 at 20:23, on Zulip):

unsure

Santiago Pastorino (Jun 27 2018 at 20:24, on Zulip):

basically I have a RegionVid and a local

Santiago Pastorino (Jun 27 2018 at 20:24, on Zulip):

and need to check if the region pointed by RegionVid contains that local

nikomatsakis (Jun 27 2018 at 20:31, on Zulip):

So I think what you want to do

nikomatsakis (Jun 27 2018 at 20:31, on Zulip):

is to find out if the type of that local

nikomatsakis (Jun 27 2018 at 20:31, on Zulip):

includes the region

nikomatsakis (Jun 27 2018 at 20:31, on Zulip):

for this, you need the mir

nikomatsakis (Jun 27 2018 at 20:31, on Zulip):

mir.local_decls[local].ty or something should give you the type of the MIR

nikomatsakis (Jun 27 2018 at 20:32, on Zulip):

then you have to walk the regions somehow

nikomatsakis (Jun 27 2018 at 20:32, on Zulip):

I'm debating which of the various helpers is the best fit :)

nikomatsakis (Jun 27 2018 at 20:42, on Zulip):

for_each_free_region is an easy one but it has no way to stop once you found something, nor to return a value

nikomatsakis (Jun 27 2018 at 20:42, on Zulip):

you'd have to set some flag to true

nikomatsakis (Jun 27 2018 at 20:42, on Zulip):

maybe we want a visit_each_free_regon

nikomatsakis (Jun 27 2018 at 20:43, on Zulip):

still, i'd do something like

let mut found_it = false;
tcx.for_each_free_region(ty, |r| if r == region_I_want { found_it = true; })

for now. It's the easiest way to get started.

nikomatsakis (Jun 27 2018 at 20:44, on Zulip):

@Santiago Pastorino :point_up: make sense?

Santiago Pastorino (Jun 27 2018 at 21:28, on Zulip):

@nikomatsakis makes perfect sense

Santiago Pastorino (Jun 27 2018 at 21:28, on Zulip):

can't continue with this now

Santiago Pastorino (Jun 27 2018 at 21:28, on Zulip):

but this is probably very close to be finished

Santiago Pastorino (Jun 27 2018 at 21:29, on Zulip):

just doing what you've said and it's done

Santiago Pastorino (Jun 27 2018 at 22:56, on Zulip):

@nikomatsakis I have a couple of minutes ... where can I get tcx from?

Santiago Pastorino (Jun 27 2018 at 22:56, on Zulip):

I guess I can pass it down

Santiago Pastorino (Jun 27 2018 at 22:56, on Zulip):

on the finder I have the mir

nikomatsakis (Jun 27 2018 at 22:58, on Zulip):

yeah, you can get it from self.infcx.tcx in the MirBorrowckCtxt I think

Santiago Pastorino (Jun 27 2018 at 22:59, on Zulip):

yep

Santiago Pastorino (Jun 27 2018 at 22:59, on Zulip):

ok

Santiago Pastorino (Jun 27 2018 at 22:59, on Zulip):

wasn't sure if was possible to get it from mir

Santiago Pastorino (Jun 27 2018 at 22:59, on Zulip):

ahh tcx is type context?

Santiago Pastorino (Jun 27 2018 at 22:59, on Zulip):

if it's that doesn't make sense to have it on mir :)

Santiago Pastorino (Jun 28 2018 at 00:32, on Zulip):

@nikomatsakis wonder how to proper set up TyCtxt lifetimes

Santiago Pastorino (Jun 28 2018 at 00:32, on Zulip):

pub struct TyCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {

Santiago Pastorino (Jun 28 2018 at 00:32, on Zulip):

mainly the first lifetime param

Santiago Pastorino (Jun 28 2018 at 00:32, on Zulip):

I guess that's 'cx

Santiago Pastorino (Jun 28 2018 at 00:36, on Zulip):
error[E0491]: in type `&'gcx rustc::mir::Mir<'tcx>`, reference has a longer lifetime than the data it references
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:43:5
   |
43 |     mir: &'gcx Mir<'tcx>,
   |     ^^^^^^^^^^^^^^^^^^^^
   |
note: the pointer is valid for the lifetime 'gcx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but the referenced data is only valid for the lifetime 'tcx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:45:5
   |
45 |     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: lifetime parameter instantiated with the lifetime 'gcx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'cx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:45:5
   |
45 |     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: lifetime parameter instantiated with the lifetime 'tcx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'cx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:45:5
   |
45 |     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: lifetime parameter instantiated with the lifetime 'gcx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'tcx as defined on the struct at 42:1
  --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:42:1
   |
42 | struct UseFinder<'cx, 'gcx, 'tcx> {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0491]: in type `&'gcx rustc::mir::Mir<'tcx>`, reference has a longer lifetime than the data it references
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:111:5
    |
111 |     mir: &'gcx Mir<'tcx>,
    |     ^^^^^^^^^^^^^^^^^^^^
    |
note: the pointer is valid for the lifetime 'gcx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but the referenced data is only valid for the lifetime 'tcx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:113:5
    |
113 |     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: lifetime parameter instantiated with the lifetime 'gcx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'cx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:113:5
    |
113 |     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: lifetime parameter instantiated with the lifetime 'tcx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'cx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0478]: lifetime bound not satisfied
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:113:5
    |
113 |     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
note: lifetime parameter instantiated with the lifetime 'gcx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: but lifetime parameter must outlive the lifetime 'tcx as defined on the struct at 110:1
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:110:1
    |
110 | struct DefUseVisitor<'cx, 'gcx, 'tcx> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 8 previous errors
Santiago Pastorino (Jun 28 2018 at 00:37, on Zulip):

will check this tomorrow

nikomatsakis (Jun 28 2018 at 00:47, on Zulip):

you almost certainly don't want any data with lifetime 'gcx

nikomatsakis (Jun 28 2018 at 00:48, on Zulip):

&'tcx Mir<'tcx> or &'cx Mir<'tcx> ...

nikomatsakis (Jun 28 2018 at 00:48, on Zulip):

can you send me some link to the code in question?

lqd (Jun 28 2018 at 00:58, on Zulip):

@Santiago Pastorino if you're writing a visitor needing the MirBorrowckCtx: https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/used_muts.rs#L33 could be an example (I think :)

Santiago Pastorino (Jun 28 2018 at 03:02, on Zulip):

was missing this stuff ...

Santiago Pastorino (Jun 28 2018 at 03:06, on Zulip):

for tomorrow :)

Santiago Pastorino (Jun 28 2018 at 03:09, on Zulip):
error[E0277]: the trait bound `rustc::ty::TyS<'_>: rustc::ty::TypeFoldable<'_>` is not satisfied
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:124:18
    |
124 |         self.tcx.for_each_free_region(local_ty, |r| if r == self.region_vid { found_it = true; });
    |                  ^^^^^^^^^^^^^^^^^^^^ the trait `rustc::ty::TypeFoldable<'_>` is not implemented for `rustc::ty::TyS<'_>`
    |
    = help: the following implementations were found:
              <&'tcx rustc::ty::TyS<'tcx> as rustc::ty::TypeFoldable<'tcx>>

error[E0277]: can't compare `&rustc::ty::RegionKind` with `rustc::ty::RegionVid`
   --> librustc_mir/borrow_check/nll/explain_borrow/find_use.rs:124:58
    |
124 |         self.tcx.for_each_free_region(local_ty, |r| if r == self.region_vid { found_it = true; });
    |                                                          ^^ no implementation for `&rustc::ty::RegionKind == rustc::ty::RegionVid`
    |
    = help: the trait `std::cmp::PartialEq<rustc::ty::RegionVid>` is not implemented for `&rustc::ty::RegionKind`
Santiago Pastorino (Jun 28 2018 at 03:10, on Zulip):
diff --git a/src/librustc_mir/borrow_check/nll/explain_borrow/find_use.rs b/src/librustc_mir/borrow_check/nll/explain_borrow/find_use.rs
index 06656eb8b1..c0494ec990 100644
--- a/src/librustc_mir/borrow_check/nll/explain_borrow/find_use.rs
+++ b/src/librustc_mir/borrow_check/nll/explain_borrow/find_use.rs
@@ -17,7 +17,7 @@ use rustc::ty::{RegionVid, TyCtxt};
 use rustc_data_structures::fx::FxHashSet;
 use util::liveness::{self, DefUse, LivenessMode};

-crate fn find<'cx, 'gcx, 'tcx>(
+crate fn find<'cx, 'gcx: 'tcx, 'tcx: 'cx>(
     mir: &'cx Mir<'tcx>,
     region_cx: Rc<RegionInferenceContext<'tcx>>,
     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
@@ -39,7 +39,7 @@ crate fn find<'cx, 'gcx, 'tcx>(
     uf.find()
 }

-struct UseFinder<'cx, 'gcx, 'tcx> {
+struct UseFinder<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
     mir: &'cx Mir<'tcx>,
     region_cx: Rc<RegionInferenceContext<'tcx>>,
     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
@@ -107,7 +107,7 @@ impl<'cx, 'gcx, 'tcx> UseFinder<'cx, 'gcx, 'tcx> {
     }
 }

-struct DefUseVisitor<'cx, 'gcx, 'tcx> {
+struct DefUseVisitor<'cx, 'gcx: 'tcx, 'tcx: 'cx> {
     mir: &'cx Mir<'tcx>,
     region_cx: Rc<RegionInferenceContext<'tcx>>,
     tcx: TyCtxt<'cx, 'gcx, 'tcx>,
Santiago Pastorino (Jun 28 2018 at 03:16, on Zulip):

will leave this 2 errors ...

nikomatsakis (Jun 28 2018 at 10:12, on Zulip):

@Santiago Pastorino the signature of for_each_free_region is:

    pub fn for_each_free_region<T,F>(self,
                                     value: &T,
                                     callback: F)
        where F: FnMut(ty::Region<'tcx>),
              T: TypeFoldable<'tcx>,

Note that it takes a &T for value -- that means you need to invoke it with &local_ty as argument, not local_ty:

self.tcx.for_each_free_region(&local_ty, |r| ...)

That should fix the first error.

nikomatsakis (Jun 28 2018 at 10:15, on Zulip):

As for the second error, you are searching for a RegionVid -- a region variable id, which is basically one specific kind of region -- but the variable r is a Region<'tcx>, which is the more general type. In fact, since this region is coming from the MIR, and we've rewritten the MIR to only use "region variables" (which have a RegionVid), we can convert the Region to a RegionVid by invoking t.to_region_vid(). The to_region_vid() method is defined on the helper trait ToRegionVid, which may need to be imported.

Santiago Pastorino (Jun 28 2018 at 11:51, on Zulip):

@nikomatsakis ya, that makes sense

Santiago Pastorino (Jun 28 2018 at 11:52, on Zulip):

yesterday that was the last thing I did and didn't check the errors

Santiago Pastorino (Jun 28 2018 at 11:52, on Zulip):

just share the thing before stopping using the computer

Santiago Pastorino (Jun 28 2018 at 11:52, on Zulip):

thanks for the tips anyway

Santiago Pastorino (Jun 28 2018 at 11:52, on Zulip):

the last missing thing is to return the Cause

Santiago Pastorino (Jun 28 2018 at 11:57, on Zulip):

@nikomatsakis this is what I have for now, for you to check https://github.com/rust-lang/rust/compare/master...spastorino:make-causal-tracking-lazy

Santiago Pastorino (Jun 28 2018 at 11:59, on Zulip):

I need to figure out how to return Causal from here https://github.com/rust-lang/rust/compare/master...spastorino:make-causal-tracking-lazy#diff-fa4e5f66c948394f09355b88af038480R71

Santiago Pastorino (Jun 28 2018 at 11:59, on Zulip):

current code I think it's missing some stuff to be able to properly return Causal info

Santiago Pastorino (Jun 28 2018 at 11:59, on Zulip):

need to think a bit about it

Santiago Pastorino (Jun 28 2018 at 11:59, on Zulip):

will be around later

Santiago Pastorino (Jun 28 2018 at 16:25, on Zulip):

@nikomatsakis can you help me a bit to figure out how to build Cause?

Santiago Pastorino (Jun 28 2018 at 16:26, on Zulip):
pub(crate) enum Cause {
    /// point inserted because Local was live at the given Location
    LiveVar(Local, Location),

    /// point inserted because Local was dropped at the given Location
    DropVar(Local, Location),

    /// point inserted because the type was live at the given Location,
    /// but not as part of some local variable
    LiveOther(Location),

    /// part of the initial set of values for a universally quantified region
    #[allow(dead_code)]
    UniversalRegion(RegionVid),
}
Santiago Pastorino (Jun 28 2018 at 16:26, on Zulip):

in

Santiago Pastorino (Jun 28 2018 at 16:26, on Zulip):

https://github.com/rust-lang/rust/compare/master...spastorino:make-causal-tracking-lazy#diff-fa4e5f66c948394f09355b88af038480R71

Santiago Pastorino (Jun 28 2018 at 16:28, on Zulip):

I need to get what's the use exactly

Santiago Pastorino (Jun 28 2018 at 16:28, on Zulip):

drop or live

Santiago Pastorino (Jun 28 2018 at 16:28, on Zulip):

what's the local associated, I can just return from the visit

nikomatsakis (Jun 28 2018 at 16:30, on Zulip):

hmm

Santiago Pastorino (Jun 28 2018 at 16:32, on Zulip):

basically what I need is a logic to know if the Cause is because of LiveVar, DropVar, LiveOther or UniversalRegion

Santiago Pastorino (Jun 28 2018 at 16:32, on Zulip):

the rest I think I have all the data

nikomatsakis (Jun 28 2018 at 16:32, on Zulip):

I think you can gt it from the PlaceContext

nikomatsakis (Jun 28 2018 at 16:33, on Zulip):

https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/visit/enum.PlaceContext.html

nikomatsakis (Jun 28 2018 at 16:33, on Zulip):

e.g, it has a Drop variant

Santiago Pastorino (Jun 28 2018 at 16:34, on Zulip):

you mean that I can get if it's Drop or not with that?

Santiago Pastorino (Jun 28 2018 at 16:34, on Zulip):

and what about the rest?

nikomatsakis (Jun 28 2018 at 16:35, on Zulip):

what is the rest?

Santiago Pastorino (Jun 28 2018 at 16:35, on Zulip):

LiveOther and UniversalRegion

Santiago Pastorino (Jun 28 2018 at 16:35, on Zulip):

don't remember what's UniversalRegion

Santiago Pastorino (Jun 28 2018 at 16:36, on Zulip):

but I'm not doing anything for LiveOther because I'm checking the locals

nikomatsakis (Jun 28 2018 at 16:36, on Zulip):

ok so

nikomatsakis (Jun 28 2018 at 16:36, on Zulip):

my mistake maybe

nikomatsakis (Jun 28 2018 at 16:36, on Zulip):

you don't have a context here

nikomatsakis (Jun 28 2018 at 16:36, on Zulip):

but regarding those other variants, you will never produce those

nikomatsakis (Jun 28 2018 at 16:36, on Zulip):

you will I think only produce LiveVar, DropVar, or "other"

nikomatsakis (Jun 28 2018 at 16:36, on Zulip):

we can probably remove them

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

iirc we don't really use the other things for much anyway

Santiago Pastorino (Jun 28 2018 at 16:37, on Zulip):

hmmm

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

in terms of whether to produce LiveVar or DropVar— you can look at the data at the statement index

Santiago Pastorino (Jun 28 2018 at 16:37, on Zulip):

but this is going to change behavior

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

(a) I don't think it will

Santiago Pastorino (Jun 28 2018 at 16:37, on Zulip):

let me paste the previous code ...

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

(b) who cares

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

:)

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

well, let's check

nikomatsakis (Jun 28 2018 at 16:37, on Zulip):

but the UniversalRegion variant is already dead-code

nikomatsakis (Jun 28 2018 at 16:38, on Zulip):

as you can see from the #[allow], right?

nikomatsakis (Jun 28 2018 at 16:38, on Zulip):

(or did you add that?)

nikomatsakis (Jun 28 2018 at 16:38, on Zulip):

but in any case I don't see any code that is handling LiveOther in a useful way

Santiago Pastorino (Jun 28 2018 at 16:39, on Zulip):

I've added that

Santiago Pastorino (Jun 28 2018 at 16:39, on Zulip):

when I've removed causal

Santiago Pastorino (Jun 28 2018 at 16:39, on Zulip):

check this https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs#L47-L109

Santiago Pastorino (Jun 28 2018 at 16:39, on Zulip):

I was trying to mimic that

Santiago Pastorino (Jun 28 2018 at 16:40, on Zulip):

well LiveOther doesn't show up there

nikomatsakis (Jun 28 2018 at 16:40, on Zulip):

right so— I think that the UniversalRegion stuff is dead code in that match

nikomatsakis (Jun 28 2018 at 16:40, on Zulip):

but in any case it's not a very good output

nikomatsakis (Jun 28 2018 at 16:40, on Zulip):

I guess we'll see if that note disappears and figure out what to do

nikomatsakis (Jun 28 2018 at 16:40, on Zulip):

the thing is

Santiago Pastorino (Jun 28 2018 at 16:40, on Zulip):

ok

Santiago Pastorino (Jun 28 2018 at 16:40, on Zulip):

seems good :)

nikomatsakis (Jun 28 2018 at 16:41, on Zulip):

well, ok, it may be dead code :)

nikomatsakis (Jun 28 2018 at 16:41, on Zulip):

but let's worry about it later in any case

nikomatsakis (Jun 28 2018 at 16:42, on Zulip):

I think if we do find an actual use or drop

nikomatsakis (Jun 28 2018 at 16:42, on Zulip):

that is always a better thing to print

nikomatsakis (Jun 28 2018 at 16:42, on Zulip):

if we fail to find one, I think we can probably look at the region for which we were searching

nikomatsakis (Jun 28 2018 at 16:42, on Zulip):

and decide whether to emit that other note

nikomatsakis (Jun 28 2018 at 16:42, on Zulip):

but it'd be good to have some actual examples

Santiago Pastorino (Jun 28 2018 at 18:42, on Zulip):

@nikomatsakis why are we doing this https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs#L42 ?

nikomatsakis (Jun 28 2018 at 18:42, on Zulip):

what specifically?

nikomatsakis (Jun 28 2018 at 18:42, on Zulip):

the &&?

Santiago Pastorino (Jun 28 2018 at 18:42, on Zulip):

yes

nikomatsakis (Jun 28 2018 at 18:42, on Zulip):

typo, I imagine

Santiago Pastorino (Jun 28 2018 at 18:42, on Zulip):

that's an std::rc::Rc<borrow_check::nll::region_infer::RegionInferenceContext<'_>>

nikomatsakis (Jun 28 2018 at 18:43, on Zulip):

just one would suffice I guess

nikomatsakis (Jun 28 2018 at 18:43, on Zulip):

this just creates a double indirection

nikomatsakis (Jun 28 2018 at 18:43, on Zulip):

the coercions probably make it go away

Santiago Pastorino (Jun 28 2018 at 18:43, on Zulip):

why that and not clone() over the Rc?

nikomatsakis (Jun 28 2018 at 18:43, on Zulip):

why clone when you don't have to, I guess

Santiago Pastorino (Jun 28 2018 at 18:44, on Zulip):

isn't clone() over Rc cheap?

nikomatsakis (Jun 28 2018 at 18:44, on Zulip):

I think it's only that way to avoid typing self.

nikomatsakis (Jun 28 2018 at 18:44, on Zulip):

yes, but not as cheap as not cloning :stuck_out_tongue:

Santiago Pastorino (Jun 28 2018 at 18:44, on Zulip):

ok

Santiago Pastorino (Jun 28 2018 at 18:44, on Zulip):

ya

Santiago Pastorino (Jun 28 2018 at 18:44, on Zulip):

makes sense

Santiago Pastorino (Jun 28 2018 at 18:50, on Zulip):

@nikomatsakis fyi, this thing is now compiling

Santiago Pastorino (Jun 28 2018 at 18:50, on Zulip):

need to run tests and see what's going on

Santiago Pastorino (Jun 28 2018 at 19:17, on Zulip):

@nikomatsakis, yeah there's wrong stuff :)

Santiago Pastorino (Jun 28 2018 at 19:17, on Zulip):

let me share with you all the code

Santiago Pastorino (Jun 28 2018 at 19:18, on Zulip):

@nikomatsakis https://github.com/rust-lang/rust/compare/master...spastorino:make-causal-tracking-lazy

Santiago Pastorino (Jun 28 2018 at 19:18, on Zulip):

we are missing all those errors

Santiago Pastorino (Jun 28 2018 at 19:18, on Zulip):

don't we need a mixture of those solutions?

Santiago Pastorino (Jun 28 2018 at 19:19, on Zulip):

I mean, push down the Cause always but on uses

Santiago Pastorino (Jun 28 2018 at 19:19, on Zulip):

and on uses just do what we are doing in this issue

Santiago Pastorino (Jun 28 2018 at 19:19, on Zulip):

the uses part is what we are trying to optimize

nikomatsakis (Jun 28 2018 at 19:22, on Zulip):

which errors are missing?

nikomatsakis (Jun 28 2018 at 19:22, on Zulip):

do you mean diffs that are committed?

nikomatsakis (Jun 28 2018 at 19:23, on Zulip):

let me take a look at the list

nikomatsakis (Jun 28 2018 at 19:23, on Zulip):

er, your search

Santiago Pastorino (Jun 28 2018 at 19:23, on Zulip):

yes

Santiago Pastorino (Jun 28 2018 at 19:23, on Zulip):

the stderr files committed

Santiago Pastorino (Jun 28 2018 at 19:23, on Zulip):

I've added one separate commit with that so it's easy to remove :)

nikomatsakis (Jun 28 2018 at 19:23, on Zulip):

I see I see

Santiago Pastorino (Jun 28 2018 at 19:23, on Zulip):

that clearly does not belong, hehe

nikomatsakis (Jun 28 2018 at 19:23, on Zulip):

so I think this is he case we were discussing, that we cut

nikomatsakis (Jun 28 2018 at 19:24, on Zulip):

and yes I think we can hadnle it

nikomatsakis (Jun 28 2018 at 19:24, on Zulip):

can you check something for me?

Santiago Pastorino (Jun 28 2018 at 19:24, on Zulip):

yes

nikomatsakis (Jun 28 2018 at 19:24, on Zulip):

well, there appear to be two sorts of problems

nikomatsakis (Jun 28 2018 at 19:24, on Zulip):

e.g., we are missing this Drop case

nikomatsakis (Jun 28 2018 at 19:25, on Zulip):

in some other cases, we report drops but not uses, where the uses appear better

nikomatsakis (Jun 28 2018 at 19:26, on Zulip):

and then there are the "borrowed value must be live for" sorts of cases <-- this being the one we expected not to see

Santiago Pastorino (Jun 28 2018 at 19:46, on Zulip):

ok, would need to investigate all these stuff

Santiago Pastorino (Jun 28 2018 at 19:48, on Zulip):

but the thing is ... so we need to include back LiveOther and UniversalRegion, right?

Santiago Pastorino (Jun 28 2018 at 19:48, on Zulip):

these are the things that handle some cases

Santiago Pastorino (Jun 28 2018 at 19:48, on Zulip):

also ... seems like the BFS is giving the wrong results from what you say

Santiago Pastorino (Jun 28 2018 at 19:48, on Zulip):

anyway, need to investigate

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

but the thing is ... so we need to include back LiveOther and UniversalRegion, right?

no

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

not necessarily

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

we do need to distinguish "found no use"

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

and add some handling after that

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

note that LiveOther did nothing

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

so this is really about deciding the universal region case

nikomatsakis (Jun 28 2018 at 20:00, on Zulip):

is your branch commited somewhere?

nikomatsakis (Jun 28 2018 at 20:01, on Zulip):

I'd like to play with it a bit :)

nikomatsakis (Jun 28 2018 at 20:01, on Zulip):

but I think we can examine the "subregion" (the region that we were searching for uses of)

nikomatsakis (Jun 28 2018 at 20:01, on Zulip):

to decide when to issue the universal region case

Santiago Pastorino (Jun 28 2018 at 20:03, on Zulip):

yes, the stuff is pushed

Santiago Pastorino (Jun 28 2018 at 20:03, on Zulip):

the link is above

Santiago Pastorino (Jun 28 2018 at 20:03, on Zulip):

let me paste again

Santiago Pastorino (Jun 28 2018 at 20:03, on Zulip):

https://github.com/rust-lang/rust/compare/master...spastorino:make-causal-tracking-lazy

Santiago Pastorino (Jun 28 2018 at 20:04, on Zulip):

@nikomatsakis https://github.com/spastorino/rust/tree/make-causal-tracking-lazy

nikomatsakis (Jun 28 2018 at 20:08, on Zulip):

ok

nikomatsakis (Jun 28 2018 at 20:16, on Zulip):

doing a build:)

Santiago Pastorino (Jun 28 2018 at 20:52, on Zulip):

:)

nikomatsakis (Jun 28 2018 at 20:52, on Zulip):

it's built now

Santiago Pastorino (Jun 28 2018 at 20:53, on Zulip):

cool

Santiago Pastorino (Jun 28 2018 at 20:53, on Zulip):

I went out for a bit but I'm back

Santiago Pastorino (Jun 28 2018 at 20:53, on Zulip):

I guess you fixed the thing

Santiago Pastorino (Jun 28 2018 at 20:53, on Zulip):

:)

Santiago Pastorino (Jun 28 2018 at 20:53, on Zulip):

otherwise I can keep investigating it

nikomatsakis (Jun 28 2018 at 20:54, on Zulip):

I didn't fix anything :)

nikomatsakis (Jun 28 2018 at 20:54, on Zulip):

but I added some debug! builds

nikomatsakis (Jun 28 2018 at 20:55, on Zulip):

I was going to investigate the region outlives things

nikomatsakis (Jun 28 2018 at 20:55, on Zulip):

I think I know how to fix those but I want to see what is coming out

nikomatsakis (Jun 28 2018 at 20:55, on Zulip):

also, I should not, I wouldn't be surprised if the output changes a bit here

nikomatsakis (Jun 28 2018 at 20:55, on Zulip):

that seems ok

nikomatsakis (Jun 28 2018 at 20:55, on Zulip):

as long as it's not horrible

Santiago Pastorino (Jun 28 2018 at 21:01, on Zulip):

ok

Santiago Pastorino (Jun 28 2018 at 21:01, on Zulip):

let me know your findings

nikomatsakis (Jun 28 2018 at 21:03, on Zulip):

ok yes I think this will work

nikomatsakis (Jun 28 2018 at 21:03, on Zulip):

I still don't know why some of those drop/use things turned out differently

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

trying my change, one sec

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

the TL;DR is that the "borrowed value must be valid for..." message--

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

we can look at the region_sub variable and print it for that region most of the time

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

in particular, region_sub is some region that caused us to include this point

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

and if it is a "universal region" (e.g., a lifetime parameter)

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

and we can't find any use of it

nikomatsakis (Jun 28 2018 at 21:04, on Zulip):

than we can just print out the region itself, which is what we were doing

nikomatsakis (Jun 28 2018 at 21:05, on Zulip):

not the best print out really but better than nothing

nikomatsakis (Jun 28 2018 at 21:05, on Zulip):

(this would benefit from the "causal stuff" that @David Wood and I have been working on, which tries to explain better why one region has to outlive another, but that's not landed yet...)

nikomatsakis (Jun 28 2018 at 21:05, on Zulip):

man, it's so annoying we have to rebuild libstd

nikomatsakis (Jun 28 2018 at 21:05, on Zulip):

there has to be some way to skip that

nikomatsakis (Jun 28 2018 at 21:05, on Zulip):

e.g., my builds (with incremental enabled) would finish pretty darn fast for these changes but for having to rebuild libstd

nikomatsakis (Jun 28 2018 at 21:16, on Zulip):

@Santiago Pastorino pushed a commit

nikomatsakis (Jun 28 2018 at 21:16, on Zulip):

you can see that mos of the lifetime errors are back now

nikomatsakis (Jun 28 2018 at 21:18, on Zulip):

these are the only tests with remaining diffs:

modified   src/test/ui/generator/borrowing.nll.stderr
@@ -2,15 +2,10 @@ error[E0597]: `a` does not live long enough
modified   src/test/ui/generator/ref-escapes-but-not-over-yield.nll.stderr
@@ -1,19 +1,11 @@
modified   src/test/ui/generator/yield-while-iterating.nll.stderr
@@ -19,7 +19,8 @@ LL | |     };
modified   src/test/ui/generator/yield-while-ref-reborrowed.nll.stderr
@@ -11,7 +11,8 @@ LL | |     };
modified   src/test/ui/issue-47646.stderr
@@ -3,15 +3,9 @@ error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as m
modified   src/test/ui/span/destructor-restrictions.nll.stderr
@@ -2,14 +2,9 @@ error[E0597]: `*a` does not live long enough
modified   src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
@@ -2,28 +2,17 @@ error[E0597]: `y` does not live long enough
modified   src/test/ui/span/send-is-not-static-std-sync.nll.stderr
@@ -50,8 +50,8 @@ LL |     tx.send(&*y);
nikomatsakis (Jun 28 2018 at 21:19, on Zulip):

you can view the diffs in this gist

nikomatsakis (Jun 28 2018 at 21:19, on Zulip):

I'm gonna guess that the problem here is the region that we are selecting

nikomatsakis (Jun 28 2018 at 21:19, on Zulip):

i.e., the region_sub we are searching for is not a good choice

nikomatsakis (Jun 28 2018 at 21:19, on Zulip):

I'm not sure how much to worry about that

nikomatsakis (Jun 28 2018 at 21:20, on Zulip):

but it'd be interesting to see if some tweaks would make it better

nikomatsakis (Jun 28 2018 at 21:41, on Zulip):

@Santiago Pastorino I feel like to fix some of these cases we may have to tweak the "find use" divide a bit

nikomatsakis (Jun 28 2018 at 21:41, on Zulip):

it might be worth landing this and doing a follow-up to do better

nikomatsakis (Jun 28 2018 at 21:41, on Zulip):

ah, wait, hmm...

nikomatsakis (Jun 28 2018 at 21:43, on Zulip):

that mgiht be wrong, at last in some cases

nikomatsakis (Jun 28 2018 at 21:43, on Zulip):

I wonder if find_use is doing a DFS and not a BFS

nikomatsakis (Jun 28 2018 at 21:43, on Zulip):

that could be related?

nikomatsakis (Jun 28 2018 at 21:43, on Zulip):

yes, it is

Santiago Pastorino (Jun 28 2018 at 21:45, on Zulip):

hey ... back

Santiago Pastorino (Jun 28 2018 at 21:45, on Zulip):

let me read all this

nikomatsakis (Jun 28 2018 at 21:45, on Zulip):

ok, I'm trying one last tweak to see if it helps ;)

nikomatsakis (Jun 28 2018 at 21:46, on Zulip):

but it'd prob be useful to sync a bit in any case, particularly if there are still regressions we know of

nikomatsakis (Jun 28 2018 at 21:46, on Zulip):

i.e., so I can explain a bit more deeply

nikomatsakis (Jun 28 2018 at 21:46, on Zulip):

and/or sync over Zulip

Santiago Pastorino (Jun 28 2018 at 21:46, on Zulip):

:+1:

nikomatsakis (Jun 28 2018 at 21:47, on Zulip):

I was looking at the test src/test/ui/generator/yield-while-iterating.nll.stderr, in particular

nikomatsakis (Jun 28 2018 at 21:47, on Zulip):

I'll just dump out a bit of my thought process here

nikomatsakis (Jun 28 2018 at 21:47, on Zulip):

while I wait for this damn build :)

nikomatsakis (Jun 28 2018 at 21:48, on Zulip):

so, running with RUST_LOG=rustc_mir::borrow_check I see the following output:

DEBUG 2018-06-28T21:40:03Z: rustc_mir::borrow_check::nll::explain_borrow: explain_why_borrow_contains_point(context=Context { kind: AssignRhs, loc: bb6[23] }, borrow=BorrowData { reserve_location: bb6[3], activation_location: None, kind: Mut { allow_two_phase_borrow: fal\
se }, region: '_#2r, borrowed_place: _1, assigned_place: _6 }, kind_place=None)
DEBUG 2018-06-28T21:40:03Z: rustc_mir::borrow_check::nll::explain_borrow: explain_why_borrow_contains_point: borrow_region_vid='_#2r
DEBUG 2018-06-28T21:40:03Z: rustc_mir::borrow_check::nll::explain_borrow: explain_why_borrow_contains_point: region_sub='_#35r
nikomatsakis (Jun 28 2018 at 21:48, on Zulip):

those are debug logs I added

nikomatsakis (Jun 28 2018 at 21:48, on Zulip):

in particular, you see that we are looking for '_#35r

nikomatsakis (Jun 28 2018 at 21:49, on Zulip):

that is, in order to explain why the given borrow contains the point bb6[23], we found that it was because the borrow region ('#2r) was forced to outlive '_#35r, and '_#35r contained bb6[23]

nikomatsakis (Jun 28 2018 at 21:49, on Zulip):

(make sense?)

Santiago Pastorino (Jun 28 2018 at 21:49, on Zulip):

I wonder if find_use is doing a DFS and not a BFS

lol, I took it for granted that was doing a BFS, unsure why and didn't even bother to check

nikomatsakis (Jun 28 2018 at 21:49, on Zulip):

my command line btw is this:

RUST_LOG=rustc_mir::borrow_check rustc +rust-5-stage1 yield-while-iterating.rs -Zborrowck=mir -Zdump-mir=nll -Zverbose >& killme
nikomatsakis (Jun 28 2018 at 21:50, on Zulip):

so then looking at the MIR dump, I see that '_#35r indeed appears within the type of the variable b

nikomatsakis (Jun 28 2018 at 21:50, on Zulip):

so the curious thing is:

nikomatsakis (Jun 28 2018 at 21:50, on Zulip):

why are we highlighting the drop of b

nikomatsakis (Jun 28 2018 at 21:50, on Zulip):

and not the regular use?

nikomatsakis (Jun 28 2018 at 21:50, on Zulip):

the regular use comes earlier really

nikomatsakis (Jun 28 2018 at 21:50, on Zulip):

actually, using a BFS doesn't fix it, which seems obvious now that I've been writing this out

nikomatsakis (Jun 28 2018 at 21:51, on Zulip):

but I think this particular test is still fixable by fixing the search itself

Santiago Pastorino (Jun 28 2018 at 21:51, on Zulip):

you're explaining now how did you figured out that find_use is wrong, right?

nikomatsakis (Jun 28 2018 at 21:51, on Zulip):

yes

Santiago Pastorino (Jun 28 2018 at 21:51, on Zulip):

ok

Santiago Pastorino (Jun 28 2018 at 21:51, on Zulip):

so BFS doesn't fix it?

nikomatsakis (Jun 28 2018 at 21:51, on Zulip):

we're currently getting this output:

error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
  --> yield-while-iterating.rs:67:20
   |
62 |       let mut b = || {
   |  _________________-
63 | |         for p in &mut x {
64 | |             yield p;
65 | |         }
66 | |     };
   | |_____- mutable borrow occurs here
67 |       println!("{}", x[0]); //~ ERROR
   |                      ^ immutable borrow occurs here
68 |       b.resume();
69 |   }
   |   - borrow later used here, when `b` is dropped
nikomatsakis (Jun 28 2018 at 21:51, on Zulip):

but the weird thing is how it's highlighting when b is dropped -- where there is a regular use (b.resume()) one line above

nikomatsakis (Jun 28 2018 at 21:51, on Zulip):

actually I think the reason for this is probably something like this:

nikomatsakis (Jun 28 2018 at 21:52, on Zulip):

if you look at the MIR graph, you will find that e.g. the println! might panic

nikomatsakis (Jun 28 2018 at 21:52, on Zulip):

if it were to panic, then it would drop b

nikomatsakis (Jun 28 2018 at 21:52, on Zulip):

and indeed that is "closer" in some sense (in terms of the distance through the graph) than b.resume()

nikomatsakis (Jun 28 2018 at 21:52, on Zulip):

but I think we'd still prefer to print regular uses

nikomatsakis (Jun 28 2018 at 21:52, on Zulip):

over drops

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

they are more intuitive

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

I can see a couple of possible fixes for this:

Santiago Pastorino (Jun 28 2018 at 21:53, on Zulip):

why does it points to { instead of the println! though?

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

if we find a use in a dtor, we could keep looking until we find a regualr use (if we do...)

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

why does it points to { instead of the println! though?

the println is not the point where the dtor runs

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

the dtor runs when you exit the block

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

so that it was it is highlighting

nikomatsakis (Jun 28 2018 at 21:53, on Zulip):

that doesn't seem wrong to me

Santiago Pastorino (Jun 28 2018 at 21:54, on Zulip):

what is dtor? destructor?

nikomatsakis (Jun 28 2018 at 21:54, on Zulip):

I'm just saying the path that you might take to reach the } in fewer steps than the regular use

nikomatsakis (Jun 28 2018 at 21:54, on Zulip):

yes, dtor == destructor

Santiago Pastorino (Jun 28 2018 at 21:54, on Zulip):

yes, I see

nikomatsakis (Jun 28 2018 at 21:54, on Zulip):

alternatively, we could perhaps just not walk unwind paths

nikomatsakis (Jun 28 2018 at 21:54, on Zulip):

after all, everything that gets dropped on an unwind

nikomatsakis (Jun 28 2018 at 21:54, on Zulip):

also gets dropped on a regular path

nikomatsakis (Jun 28 2018 at 21:54, on Zulip):

except I think that's not entirely true, e.g. for infinte loops maybe not

Santiago Pastorino (Jun 28 2018 at 21:54, on Zulip):

ya, that seems better

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

which seems better?

Santiago Pastorino (Jun 28 2018 at 21:55, on Zulip):

to not walk unwind paths

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

there is yet another alternative

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

which is to just push unwind paths onto a deferred list

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

and walk them only if the rest fails :)

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

we could try just skipping unwind paths for now

Santiago Pastorino (Jun 28 2018 at 21:55, on Zulip):

yeah, seems good

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

and if we find a case where it seems to be missing something

nikomatsakis (Jun 28 2018 at 21:55, on Zulip):

then we worry about it

nikomatsakis (Jun 28 2018 at 21:56, on Zulip):

I'm trying to see how easy it is to identify an unwind path

Santiago Pastorino (Jun 28 2018 at 21:56, on Zulip):

but should unwind paths be considered to report errors?

nikomatsakis (Jun 28 2018 at 21:56, on Zulip):

not that easy

nikomatsakis (Jun 28 2018 at 21:56, on Zulip):

but doable :)

Santiago Pastorino (Jun 28 2018 at 21:56, on Zulip):

:)

nikomatsakis (Jun 28 2018 at 21:56, on Zulip):

we hvae to add a helper fn I think to TerminatorKind

nikomatsakis (Jun 28 2018 at 21:56, on Zulip):

but should unwind paths be considered to report errors?

well, I don't know, that's the question :)

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

as I said, I think 99% of the time they are not needed

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

and they are going to lead to surprising reports for users somehow

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

because unwinding is less obvious

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

so if a non-unwind path can be found, seems better

Santiago Pastorino (Jun 28 2018 at 21:57, on Zulip):

I mean, that's never related to the code the user wrote, right?

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

well, they wrote the function call :)

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

that triggers the unwind

nikomatsakis (Jun 28 2018 at 21:57, on Zulip):

but I think ignoring unwind is a good idea

nikomatsakis (Jun 28 2018 at 21:58, on Zulip):

or at least worth a try

nikomatsakis (Jun 28 2018 at 21:58, on Zulip):

and relatively simple to do

Santiago Pastorino (Jun 28 2018 at 21:58, on Zulip):

:+1:

nikomatsakis (Jun 28 2018 at 21:58, on Zulip):

I just pushed a commit

nikomatsakis (Jun 28 2018 at 21:58, on Zulip):

that makes the search into a BFS

Santiago Pastorino (Jun 28 2018 at 21:58, on Zulip):

ok

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

since it still seems better

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

(it will find the shortest path)

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

but I can walk you through how to skip unwinds if you want

Santiago Pastorino (Jun 28 2018 at 21:59, on Zulip):

so ... with all the code in my branch the missing thing is to skip unwind paths?

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

I think so

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

we'll see how much that fixes

Santiago Pastorino (Jun 28 2018 at 21:59, on Zulip):

ok

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

but I think it would fix this test at least

nikomatsakis (Jun 28 2018 at 21:59, on Zulip):

it's still a hypothesis to some extent

Santiago Pastorino (Jun 28 2018 at 21:59, on Zulip):

ok

Santiago Pastorino (Jun 28 2018 at 22:00, on Zulip):

but I can walk you through how to skip unwinds if you want

:+1:

nikomatsakis (Jun 28 2018 at 22:00, on Zulip):

so in your code there is this loop here:

                        queue.extend(block_data.terminator().successors().map(|&basic_block| {
                            Location {
                                statement_index: 0,
                                block: basic_block,
                            }
                        }));
nikomatsakis (Jun 28 2018 at 22:00, on Zulip):

or, not loop, but line

nikomatsakis (Jun 28 2018 at 22:00, on Zulip):

which takes all the successors of a node and adds them to the queue (it used to be a stack, but I changed it to a queue to make it a BFS)

nikomatsakis (Jun 28 2018 at 22:00, on Zulip):

we basically want to filter out the "unwind" successors there

Santiago Pastorino (Jun 28 2018 at 22:00, on Zulip):

ya

nikomatsakis (Jun 28 2018 at 22:01, on Zulip):

the nice property is that there is at most one such successor

nikomatsakis (Jun 28 2018 at 22:01, on Zulip):

so roughly what we want is this:

let unwind_successor: Option<BasicBlock> = block_data.terminator().unwind_successor();
queue.extend(block_data.terminator().successors()
    .filter(|&bb| Some(bb) != unwind_successor)
    .map(|&basic_block| {
                            Location {
                                statement_index: 0,
                                block: basic_block,
                            }
                        }));
nikomatsakis (Jun 28 2018 at 22:02, on Zulip):

the only catch is that this unwind_successor helper doesn't exist :)

Santiago Pastorino (Jun 28 2018 at 22:02, on Zulip):

ya

nikomatsakis (Jun 28 2018 at 22:02, on Zulip):

there is a very similar one

nikomatsakis (Jun 28 2018 at 22:02, on Zulip):

but not quite the same

Santiago Pastorino (Jun 28 2018 at 22:02, on Zulip):

:)

nikomatsakis (Jun 28 2018 at 22:02, on Zulip):

there is https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/enum.TerminatorKind.html#method.unwind_mut

nikomatsakis (Jun 28 2018 at 22:02, on Zulip):

unwind_mut

nikomatsakis (Jun 28 2018 at 22:02, on Zulip):

but it returns a Option<&mut BasicBlock>

nikomatsakis (Jun 28 2018 at 22:03, on Zulip):

i.e., a reference that lets you modify the unwind successor

nikomatsakis (Jun 28 2018 at 22:03, on Zulip):

I think we basically to copy and paste that

nikomatsakis (Jun 28 2018 at 22:03, on Zulip):

to something that returns Option<BasicBlock>

nikomatsakis (Jun 28 2018 at 22:03, on Zulip):

(I would not make it Option<&BasicBlock> -- no point to returning a reference to an integer)

nikomatsakis (Jun 28 2018 at 22:03, on Zulip):

kind of annoying to have to copy and paste but I don't know a better way

nikomatsakis (Jun 28 2018 at 22:04, on Zulip):

(that is one of Rust's flaws :) it's hard to abstract over & and &mut)

Santiago Pastorino (Jun 28 2018 at 22:05, on Zulip):

seems easy

Santiago Pastorino (Jun 28 2018 at 22:05, on Zulip):

cool

nikomatsakis (Jun 28 2018 at 22:05, on Zulip):

this is the source, incidentally: https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc/mir/mod.rs.html#1168-1191

Santiago Pastorino (Jun 28 2018 at 22:05, on Zulip):

:)

nikomatsakis (Jun 28 2018 at 22:05, on Zulip):

yeah, should be easy enough I think

Santiago Pastorino (Jun 28 2018 at 22:05, on Zulip):

do you prefer me to fix the commits and merge stuff from your commits and mine?

Santiago Pastorino (Jun 28 2018 at 22:05, on Zulip):

so there are no spurious stuff?

Santiago Pastorino (Jun 28 2018 at 22:06, on Zulip):

actually haven't checked your commits yet, but the last I made doesn't make any sense

Santiago Pastorino (Jun 28 2018 at 22:07, on Zulip):

and the previous one is incomplete, so ... I guess it's better to merge them all into one thing

nikomatsakis (Jun 28 2018 at 22:08, on Zulip):

probably I would just squash into one commit

nikomatsakis (Jun 28 2018 at 22:08, on Zulip):

the history is pretty messy

nikomatsakis (Jun 28 2018 at 22:08, on Zulip):

I don't care if you preseve my authorship if that is what you are asking :)

nikomatsakis (Jun 28 2018 at 22:08, on Zulip):

or at least squash into a few commits

nikomatsakis (Jun 28 2018 at 22:08, on Zulip):

(if you see some way to break it up, great)

Santiago Pastorino (Jun 28 2018 at 22:08, on Zulip):

yep

Santiago Pastorino (Jun 28 2018 at 22:09, on Zulip):

I'd try to do something

Santiago Pastorino (Jun 28 2018 at 22:10, on Zulip):

unsure if I will be able now but a bit later probably

Santiago Pastorino (Jun 28 2018 at 22:10, on Zulip):

this should be finished by today :)

nikomatsakis (Jun 28 2018 at 22:10, on Zulip):

that'd be great

nikomatsakis (Jun 28 2018 at 22:10, on Zulip):

I can't wait to land this plus the other things

nikomatsakis (Jun 28 2018 at 22:10, on Zulip):

and do some new profiles :)

Santiago Pastorino (Jun 28 2018 at 22:10, on Zulip):

:)

Santiago Pastorino (Jun 28 2018 at 23:12, on Zulip):

@nikomatsakis done, compiling

nikomatsakis (Jun 28 2018 at 23:35, on Zulip):

@Santiago Pastorino any updates? :)

Santiago Pastorino (Jun 28 2018 at 23:37, on Zulip):

yes

Santiago Pastorino (Jun 28 2018 at 23:37, on Zulip):

just pushed

Santiago Pastorino (Jun 28 2018 at 23:37, on Zulip):

want to see just the latest diff?

Santiago Pastorino (Jun 28 2018 at 23:37, on Zulip):

I have it locally

Santiago Pastorino (Jun 28 2018 at 23:38, on Zulip):

I pushed by melting it with the previous commits

Santiago Pastorino (Jun 28 2018 at 23:38, on Zulip):

I'm opening a PR

Santiago Pastorino (Jun 28 2018 at 23:39, on Zulip):

https://github.com/rust-lang/rust/pull/51889

Santiago Pastorino (Jun 28 2018 at 23:39, on Zulip):

forgot to run rustfmt

Santiago Pastorino (Jun 28 2018 at 23:39, on Zulip):

this will probably fail on CI

Santiago Pastorino (Jun 28 2018 at 23:39, on Zulip):

running rustfmt and pushing

nikomatsakis (Jun 28 2018 at 23:46, on Zulip):

(one nice add'l thing about this approach is that it is more polonius friendly in the future)

Santiago Pastorino (Jun 28 2018 at 23:47, on Zulip):

:)

Santiago Pastorino (Jun 28 2018 at 23:47, on Zulip):

force pushed again

Santiago Pastorino (Jun 28 2018 at 23:47, on Zulip):

removed a wrong dead_code thing and run rustfmt over the files

Santiago Pastorino (Jun 28 2018 at 23:51, on Zulip):

@nikomatsakis let me know if you find something that needs to be changed

nikomatsakis (Jun 28 2018 at 23:51, on Zulip):

cool

nikomatsakis (Jun 28 2018 at 23:51, on Zulip):

I gotta go put my daughter to bed

nikomatsakis (Jun 28 2018 at 23:51, on Zulip):

will look after

Santiago Pastorino (Jun 28 2018 at 23:51, on Zulip):

ok

Santiago Pastorino (Jun 28 2018 at 23:52, on Zulip):

going to have dinner

Santiago Pastorino (Jun 28 2018 at 23:52, on Zulip):

will be kind of around but if there is something to fix will do a bit later for sure

nikomatsakis (Jun 29 2018 at 01:33, on Zulip):

ok so the perf results are...confusing. On the one hand, the total times I see didn't seem to change that much. On the other hand, this did knock those fns out of the profile as expected

nikomatsakis (Jun 29 2018 at 01:33, on Zulip):

I'm curious to see what the perf server finds

nikomatsakis (Jun 29 2018 at 01:33, on Zulip):

it seems to be a bit more consistent somehow

nikomatsakis (Jun 29 2018 at 01:34, on Zulip):

current perf graph: https://gist.github.com/nikomatsakis/61b093fdf1cbff1f10bebfe532bdae8e

Jake Goulding (Jun 29 2018 at 16:07, on Zulip):

(that is one of Rust's flaws :) it's hard to abstract over & and &mut)

@nikomatsakis when are you going to fix that, anyway? :stuck_out_tongue_winking_eye:

Last update: Nov 21 2019 at 14:35UTC