Stream: t-compiler/wg-nll

Topic: general discussion


Welcome Bot (May 03 2018 at 18:21, on Zulip):

Welcome to #wg-nll.

Description: Non-lexical lifetimes working group

nikomatsakis (May 03 2018 at 18:33, on Zulip):

@Douglas Campos testing, testing

qmx (May 03 2018 at 19:12, on Zulip):

here!

qmx (May 03 2018 at 19:13, on Zulip):

@Douglas Campos testing, testing

testing a reply

nikomatsakis (May 04 2018 at 13:51, on Zulip):

I invited @Felix S Klock II to join =)

pnkfelix (May 04 2018 at 13:54, on Zulip):

this is Felix's attempt to send a message that all the WG-nll people can see!

nikomatsakis (May 04 2018 at 13:55, on Zulip):

I saw it!

qmx (May 04 2018 at 13:57, on Zulip):

:raised_hands:

nikomatsakis (May 04 2018 at 13:58, on Zulip):

the weird thing is that when @Felix S Klock II joined, he didn't immediately see the wg-nll stream on the left

qmx (May 04 2018 at 13:59, on Zulip):

this streams concept is a blessing and a curse
too confusing tbh

nikomatsakis (May 04 2018 at 13:59, on Zulip):

I think you are referring to the "threads" concept

pnkfelix (May 04 2018 at 13:59, on Zulip):

shades of Google Wave

nikomatsakis (May 04 2018 at 13:59, on Zulip):

I think the problem @Felix S Klock II had was that the set of streams defaults to showing you the streams you are subscribed too

nikomatsakis (May 04 2018 at 13:59, on Zulip):

which, I guess, makes sense

nikomatsakis (May 04 2018 at 13:59, on Zulip):

but somehow ran counter to my expectations

qmx (May 04 2018 at 13:59, on Zulip):

it's google wave dejavu's all over again

nikomatsakis (May 04 2018 at 14:00, on Zulip):

that is, it's not like (e.g.) gitter shows you all the rooms that exist

nikomatsakis (May 04 2018 at 14:00, on Zulip):

or IRC

nikomatsakis (May 04 2018 at 14:00, on Zulip):

one weird thing -- I've not found any easy way to see which users are subscribed to a stream? Or maybe that is indicated by the "Users" listing on the RHS

nikomatsakis (May 04 2018 at 14:01, on Zulip):

no, it doesn't seem to be

qmx (May 04 2018 at 14:01, on Zulip):

no, RHS is all users

nikomatsakis (May 04 2018 at 14:01, on Zulip):

weird

nikomatsakis (May 04 2018 at 14:02, on Zulip):

(though, to be clear, an "all users" listing is actually a really useful thing to have —I get annoyed a lot on IRC when I have to jump from room to room to find someone's nick that I can't quite remember)

nikomatsakis (May 04 2018 at 14:04, on Zulip):

@Douglas Campos oh I missed that you said you had 45 minutes to hack

nikomatsakis (May 04 2018 at 14:04, on Zulip):

I guess it's less now

nikomatsakis (May 04 2018 at 14:04, on Zulip):

I have a suggestion :P

qmx (May 04 2018 at 14:04, on Zulip):

go for it

nikomatsakis (May 04 2018 at 14:05, on Zulip):

I will push a commit real quick to my repo one sec

nikomatsakis (May 04 2018 at 14:05, on Zulip):

ok, I made a branch called stats

nikomatsakis (May 04 2018 at 14:06, on Zulip):

I was going to integrate the histo crate

nikomatsakis (May 04 2018 at 14:06, on Zulip):

and use it to dump various bits of data

nikomatsakis (May 04 2018 at 14:07, on Zulip):

in particular, I'd like to see:

once that works:

nikomatsakis (May 04 2018 at 14:07, on Zulip):

the main changes in those branch are that I added a way of iterating over all the r1 <= r2 edges after the fact (regardless of where they occur)

nikomatsakis (May 04 2018 at 14:07, on Zulip):

I'm going to investigate something else for a bit so I won't touch it anymore

nikomatsakis (May 04 2018 at 14:08, on Zulip):

here is where I was adding a loop

qmx (May 04 2018 at 14:14, on Zulip):

pulling the branch now

qmx (May 04 2018 at 14:15, on Zulip):

not sure if you got my message later, but I couldn't assign issues on the borrow-check repo

nikomatsakis (May 04 2018 at 14:16, on Zulip):

I think I invited you to the WG-compiler-nll team on rust-lang-nursery, no?

nikomatsakis (May 04 2018 at 14:17, on Zulip):

yes, I did -- @Douglas Campos you have to accept your invitation

qmx (May 04 2018 at 14:18, on Zulip):

found the invitation, it was buried with rust-lang github notifications :joy:

nikomatsakis (May 04 2018 at 14:18, on Zulip):

one thing I don't love about zulip -- it doesn't seem to have the "nickname" concept?

nikomatsakis (May 04 2018 at 14:18, on Zulip):

I guess you have to change your "real name"

nikomatsakis (May 04 2018 at 14:18, on Zulip):

I like "nicks" :)

qmx (May 04 2018 at 14:19, on Zulip):

yea, nicks are great

pnkfelix (May 04 2018 at 14:33, on Zulip):

/me brings back his nick by force

pnkfelix (May 04 2018 at 14:34, on Zulip):

/me breaks @Nicholas Matsakis 's previous @-references to Felix S Klock II

pnkfelix (May 04 2018 at 14:34, on Zulip):

(apparently they have not added alpha-renaming as a "feature" here.)

pnkfelix (May 04 2018 at 14:35, on Zulip):

oh, wait, they aren't broken! You can still click them!

nikomatsakis (May 04 2018 at 14:36, on Zulip):

nice

nikomatsakis (May 04 2018 at 14:36, on Zulip):

sometimes it doesn't seem to "scroll down" and I have to do it manually. that is odd.

nikomatsakis (May 04 2018 at 14:36, on Zulip):

I'm adopting a nick too :)

pnkfelix (May 04 2018 at 14:38, on Zulip):

hey @nikomatsakis do you want to have another r? on rust-lang/rust#49870, or shall I just r=nikomatsakis it based on your earlier "r+ once nits addressed" ? The subsequent changes were a little more involved due to arielb1 feedback, but it was still pretty straight-forward...

pnkfelix (May 04 2018 at 14:38, on Zulip):

oh no, how do I link github issues here???

nikomatsakis (May 04 2018 at 14:38, on Zulip):

oh geez! that's a fail

nikomatsakis (May 04 2018 at 14:38, on Zulip):

there's probably a bot or integration

nikomatsakis (May 04 2018 at 14:39, on Zulip):

I was going to ask, @all, whether we ought to really "try" this experiment or not...

qmx (May 04 2018 at 14:39, on Zulip):

@nikomatsakis if you're focusing on the stream it scrolls down - if you lose focus it stays put so you don't miss where you left off

nikomatsakis (May 04 2018 at 14:39, on Zulip):

@pnkfelix i don't feel the need to review 49870

pnkfelix (May 04 2018 at 14:39, on Zulip):

:ballot_box_with_check:

qmx (May 04 2018 at 14:39, on Zulip):

hate to admit, but I miss gitter - I just wish it worked well

nikomatsakis (May 04 2018 at 14:40, on Zulip):

there is this bot: https://zulipchat.com/integrations/doc/github_detail

nikomatsakis (May 04 2018 at 14:40, on Zulip):

I agree that gitter feels in some ways closer to what I would hope for

nikomatsakis (May 04 2018 at 14:40, on Zulip):

there's just a few tweaks ... well, that and receiving messages

nikomatsakis (May 04 2018 at 14:41, on Zulip):

I filed a bug about the gitter notificaitons going missing

nikomatsakis (May 04 2018 at 14:41, on Zulip):

https://gitlab.com/gitlab-org/gitter/webapp/issues/1894

nikomatsakis (May 04 2018 at 14:41, on Zulip):

it annoys me that they are not treating this like "def con zero" :)

nikomatsakis (May 04 2018 at 14:41, on Zulip):

maybe y'all want to weigh in there

nikomatsakis (May 04 2018 at 14:41, on Zulip):

"they" is perhaps just 1 maintainer, I don't know

nikomatsakis (May 04 2018 at 14:42, on Zulip):

though gitter has had other flaws (missing notifications, bad android app, etc) for a long time :(

pnkfelix (May 04 2018 at 14:47, on Zulip):

long time = one week (?)

qmx (May 04 2018 at 14:48, on Zulip):

way more than one week

pnkfelix (May 04 2018 at 14:51, on Zulip):

somehow didn't realize gitter's missing notifications were going on longer than maybe 2 weeks. But I can believe it.

qmx (May 04 2018 at 14:54, on Zulip):

I've setup the irc bridge solely for not missing mentions
then the irc bridge broke :shrug:

nikomatsakis (May 04 2018 at 15:04, on Zulip):

yeah, lots of people complain about it. Running the app, things mostly worked for me, but I've setup "Backup channels" for reaching people I communicate with regularly, in part for this reason.

nikomatsakis (May 04 2018 at 21:04, on Zulip):

/me waves to @Reed Koser

Reed Koser (May 04 2018 at 21:05, on Zulip):

hello. You're right, this is a... different approach to chat. I can see it being cool though

Reed Koser (May 04 2018 at 21:05, on Zulip):

e.g. new threads for weekly meetings etc.

nikomatsakis (May 04 2018 at 21:06, on Zulip):

yes -- threads have a lot of interesting potential

nikomatsakis (May 04 2018 at 21:06, on Zulip):

both for good and ill :)

nikomatsakis (May 04 2018 at 21:07, on Zulip):

gah, I guess I have to go home now

Keith Yeung (May 04 2018 at 21:08, on Zulip):

let's see if i'm doing this right

Keith Yeung (May 04 2018 at 21:08, on Zulip):
let foo = Box::new(5);
Reed Koser (May 04 2018 at 21:08, on Zulip):

Yep, seems like.

davidtwco (May 04 2018 at 21:09, on Zulip):

I do quite like this.

davidtwco (May 04 2018 at 21:10, on Zulip):

Oops. I made a new chat.

Keith Yeung (May 04 2018 at 21:10, on Zulip):

just a bit annoying that you need to click reply before you can type, but otherwise it feels ok for now

Keith Yeung (May 04 2018 at 21:11, on Zulip):

let's see how GH links look like: https://github.com/rust-lang-nursery/borrow-check/issues/6

Keith Yeung (May 04 2018 at 21:11, on Zulip):

just like any other

qmx (May 04 2018 at 21:11, on Zulip):

We kinda need a github bot

nikomatsakis (May 04 2018 at 21:12, on Zulip):

yeah there is a standard one I think

nikomatsakis (May 04 2018 at 21:12, on Zulip):

I gotta run now but maybe we can mess around with configing later

davidtwco (May 04 2018 at 21:12, on Zulip):

I know that Zulip is an open source project that has a similar welcoming attitude to contributors as Rust does. So there may be opportunity to tweak little things if we find the need. I think Gitter is too, granted.

Reed Koser (May 04 2018 at 21:14, on Zulip):

Clicking on a message should let you reply directly to it, and you can keep sending messages in the same thread with just control-enter I think

davidtwco (May 04 2018 at 21:15, on Zulip):

The app is quite nice, you can just click into a topic and it's like a normal chat.

davidtwco (May 04 2018 at 21:16, on Zulip):

https://zulipchat.com/for/open-source/ is quite good.

Reed Koser (May 04 2018 at 21:23, on Zulip):

Looks like @nikomatsakis just needs to add something like (?P<org>[\w\-]+)\/(?P<project>[\w\-]+)#(?P<issue>[\d]+) with a URL format string https://github.com/%(org)/%(project)/issues/%(issue)into the URL filter list

davidtwco (May 04 2018 at 21:23, on Zulip):

There's a GitHub Details integration that does that.

Reed Koser (May 04 2018 at 21:27, on Zulip):

oh true. I got to practice my regex-foo at least ;)

Chris Vittal (May 04 2018 at 21:58, on Zulip):

@nikomatsakis I have an updated relation branch, I also rebased it from master. Do you mind if I force push to your repo?

nikomatsakis (May 05 2018 at 09:05, on Zulip):

@Chris Vittal no, go for it

nikomatsakis (May 06 2018 at 11:07, on Zulip):

@Vytautas Astrauskas regarding your question from gitter, I was exploring in a branch the idea of doing renaming and trying to avoid removing subset edges when propagating. Unfortunately, it caused Issue 47680 to stop compiling, at least the way that I did it. If you recall that example looks something like this:

loop {
  match temp.foo() { // creates a mutable loan L0 of `temp`
  Some(v) => temp = v,
  None => (),
}

In this case, along the Some path, we were linking the region for the call to foo with the regions in temp and then propagating those subset relations forward. They were no killed when v goes dead. Then we were adding the loan at the point where foo is called -- this loan gets killed on the Some path, but not the None path, and hence we had a path where temp was considered borrowed. Sorry this explanation is short, I'm in the middle of something else -- I should try to do a kind of canonical write-up of this example, though, as I think it illustrates some of the more subtle points.

That said, this (which you wrote on gitter):

I have checked the clap-rs example and found that it has 50 000 program points with at most 60 live regions per program point.

was roughly what I expected to see (lots of points, lots of regions, but few that are actually live at any given point). If I recall, that example has ~20,000 regions. That I think should offer us a lot of opportunity. I confess though I didn't quite understand this part:

Assuming we can find a way to implement subset(R1, R2, P) with a query complexity of log(N), computing requires for all program points would require 50 000 * 60 * log(1000 000, 2) < 60 000 000 operations.

I'm not sure if that is supposed to be a lot or a little or quite where those numbers came from... I guess that's just a max number of subsets or something?

Vytautas Astrauskas (May 07 2018 at 10:10, on Zulip):

Thank you once again for pointing out this example! I am trying to understand what is the problem with it.

That said, this (which you wrote on gitter):

I have checked the clap-rs example and found that it has 50 000 program points with at most 60 live regions per program point.

was roughly what I expected to see (lots of points, lots of regions, but few that are actually live at any given point). If I recall, that example has ~20,000 regions. That I think should offer us a lot of opportunity.

One more observation: I think that we care not about live regions, but about the regions that die at a specific program point because these are the ones that make live loans dead. In other words, we could check what regions died at a specific program point and what loans died as a result of that instead of checking for each loan if it is still alive. Is this idea clear, or should I elaborate? (Note: I have no clue if it is possible to implement this with Datalog, but it should not be too dificult if we use a custom flow analysis.) I would expect this to give around 10x speedup.

I confess though I didn't quite understand this part:

Assuming we can find a way to implement subset(R1, R2, P) with a query complexity of log(N), computing requires for all program points would require 50 000 * 60 * log(1000 000, 2) < 60 000 000 operations.

I'm not sure if that is supposed to be a lot or a little or quite where those numbers came from... I guess that's just a max number of subsets or something?

These numbers are from the clap-rs example:

If we multiply all this, we get < 1800 000 000 operations to borrow check the clap-rs example. This should be around several seconds with a decent CPU. My gut feeling is that by tracking only the regions that die, we could get an additional 10x speedup that should push this below 1 second.

pnkfelix (May 07 2018 at 14:43, on Zulip):

So while working on https://github.com/rust-lang/rust/issues/27282 and generalizing my solution to also fix https://github.com/rust-lang/rfcs/issues/1006 , I found this line of code:

pnkfelix (May 07 2018 at 14:43, on Zulip):

https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/mod.rs#L1714

pnkfelix (May 07 2018 at 14:44, on Zulip):

which looks like this

if let Err(_place_err) = self.is_mutable(place, LocalMutationIsAllowed::Yes) {
    span_bug!(span, "&unique borrow for {:?} should not fail", place);
}
nikomatsakis (May 07 2018 at 14:45, on Zulip):

@pnkfelix ok...

pnkfelix (May 07 2018 at 14:45, on Zulip):

That is, we seem to be able to assume in the current rustc that the borrow-checker will never encounter an attempt to mutate through a unique borrow. But in my case, its a unique borrow of one of my funny implicitly injected shared-borrows

pnkfelix (May 07 2018 at 14:46, on Zulip):

(well, I should probably double-check that claim by actually looking at the generated MIR...)

nikomatsakis (May 07 2018 at 14:46, on Zulip):

I wonder why we think we can assume that

nikomatsakis (May 07 2018 at 14:46, on Zulip):

not entirely obvious to me

pnkfelix (May 07 2018 at 14:46, on Zulip):

Right, that was my question

pnkfelix (May 07 2018 at 14:46, on Zulip):

E.g. the obvious fix to me was to merge this match arm with the one below it

pnkfelix (May 07 2018 at 14:46, on Zulip):

which instead of ICE'ing, reports the error

nikomatsakis (May 07 2018 at 14:49, on Zulip):

@Vytautas Astrauskas I agree that the number of dead regions is ok. I've not had time to process the rest of your message "in detail", but skimming it, it makes sense.

nikomatsakis (May 07 2018 at 18:23, on Zulip):

( JFYI, I've also been experimenting with Discord, and I have to say I think it is probably "The Future" more so than Zulip. It might make sense to just jump over there, even though we just got here. )

Vytautas Astrauskas (May 07 2018 at 19:24, on Zulip):

I think I finally understand why region_live_at is needed in the subset3 rule. Without it, we get a cyclic subset relation among the regions, which causes the variable temp to keep alive the region associated with v on the None branch. Nice example. :relaxed:

nikomatsakis (May 07 2018 at 19:29, on Zulip):

yes, that's it

qmx (May 07 2018 at 19:46, on Zulip):

is there a discord room already?

nikomatsakis (May 07 2018 at 19:55, on Zulip):

Yes. To be honest, I was holding off, but I don't know why, I think we should just up and move

nikomatsakis (May 07 2018 at 19:55, on Zulip):

it seems pretty clear that Discord is way more accessible

nikomatsakis (May 07 2018 at 19:55, on Zulip):

even though I kind of like zulip :)

nikomatsakis (May 07 2018 at 19:56, on Zulip):

discord.gg/rust-lang -- I'll make an NLL room there

davidtwco (May 07 2018 at 19:57, on Zulip):

I feel like the benefits of Zulip appear more at scale than with the smaller chats we're currently having.

davidtwco (May 07 2018 at 19:57, on Zulip):

It'd be particularly useful with the many concurrent conversations that can happen in #rustc on IRC.

nikomatsakis (May 07 2018 at 19:57, on Zulip):

perhaps so

nikomatsakis (May 07 2018 at 19:57, on Zulip):

yeah -- I can definitely imagine the threading being a really cool thing

nikomatsakis (May 07 2018 at 19:57, on Zulip):

but I also think it's clearly just harder to find your way around in

nikomatsakis (May 07 2018 at 19:58, on Zulip):

anyway I'm about to board a plane

nikomatsakis (May 07 2018 at 19:59, on Zulip):

the larger picture is: I think we're in an experimentation phase, but it'd be nice to find a single "Chat tech" that can serve rust-lang well as our "official home" -- IRC is not it -- gitter wasn't really it -- I thought it'd be nice to try experimenting with Zulip and Discord. Anyway, it's still experimentation phase, so I'm happy to also hang out here a little longer.

nikomatsakis (May 07 2018 at 20:00, on Zulip):

but I also feel like Discord is a overall a slicker candidate

nikomatsakis (May 07 2018 at 20:00, on Zulip):

they're missing one or two features I want but it did sound like they would add them ;)

nikomatsakis (May 07 2018 at 20:00, on Zulip):

(notably linking to msgs is not yet easy)

nikomatsakis (May 07 2018 at 20:00, on Zulip):

plus they use Rust, always a plus for me :P

nikomatsakis (May 07 2018 at 20:00, on Zulip):

anyway, I've got to run to grab a plane

qmx (May 07 2018 at 20:01, on Zulip):

safe travels!

nikomatsakis (May 08 2018 at 15:43, on Zulip):

@pnkfelix you around? (Also, are we using this or Discord? =)

nikomatsakis (May 08 2018 at 15:43, on Zulip):

I see some people on Discord but not all

nikomatsakis (May 08 2018 at 15:44, on Zulip):

@Chris Vittal I saw your changes to the borrow-check relation branch -- I was thining about trying to connect that to the main algorithm

pnkfelix (May 08 2018 at 15:53, on Zulip):

We probably should use this tonight

pnkfelix (May 08 2018 at 15:54, on Zulip):

@nikomatsakis (I’m not really around as I need my hands free atm)

nikomatsakis (May 08 2018 at 15:54, on Zulip):

that's fine. I'll try to leave some notes, I may or may not make the mtg

Reed Koser (May 08 2018 at 18:16, on Zulip):

I won't be able to make the meeting today, have to take a final exam. I wrote up and pasted some pictures of a visualization I was playing with. I'm not sure if it's useful but making it was fun ;)

pnkfelix (May 08 2018 at 19:08, on Zulip):

hmm, so who is going to be able to make the meeting today? Maybe its too late to say this, but should we just consider rescheduling to later this week?

pnkfelix (May 08 2018 at 19:08, on Zulip):

(I'll ask again in 22 minutes when the meeting is supposed to start.)

davidtwco (May 08 2018 at 19:11, on Zulip):

I can make it but it's the same "just keeping in the loop, back next week" response as every week.

Vytautas Astrauskas (May 08 2018 at 19:14, on Zulip):

I should also be able to join. However, I do not have anything new to report because I am still trying to figure out how to encode my experiment in timely. (I want to check if it would be enough to kill subsets only on loop back edges.)

nikomatsakis (May 08 2018 at 19:33, on Zulip):

I left some notes in the paper

nikomatsakis (May 08 2018 at 23:59, on Zulip):

@Reed Koser looking at your graph from the paper, I see a lot of black :) are there lots of regions with no relations at all? or is it just that a single pixel doesn't show up?

Reed Koser (May 09 2018 at 00:17, on Zulip):

@nikomatsakis in the first picture there's lots of empty space because the regions are very sparse, in the second picture it's because they're plotted as a scattergram and not a proper matrix plot

Reed Koser (May 09 2018 at 00:18, on Zulip):

source code of the analysis
you'll need to install

Reed Koser (May 09 2018 at 00:18, on Zulip):

pyqtgraph and one of the flavors of python-qt bindings (pyqt-4, pyqt-5, there's a few others that work I think)

nikomatsakis (May 09 2018 at 02:14, on Zulip):

@Chris Vittal I was messing about with integrating the EdgeRelation into the borrow-check -- I may push a WIP WIP commit -- one operation that seems to be missing is the "iterate over all edges", we can't really do that efficienctly =) (but we could thread another linked list to do that)

nikomatsakis (May 09 2018 at 02:14, on Zulip):

for now I will iterate over all edges starting from each live region

qmx (May 09 2018 at 02:16, on Zulip):

@nikomatsakis do you still want that integration with the histo crate or @Reed Koser work supersedes it?

nikomatsakis (May 09 2018 at 02:20, on Zulip):

@qmx still seems useful to me, particularly if we can feed it different sorts of tuples.

qmx (May 09 2018 at 02:21, on Zulip):

good, I'll keep poking at it then - wasn't sure when I've seen the issue closed

nikomatsakis (May 09 2018 at 02:21, on Zulip):

(I didn't notice it was closd)

nikomatsakis (May 09 2018 at 02:21, on Zulip):

I know that I am personally much more likely to dump data in a text-based way :P just because I'm lazy to install everything

qmx (May 09 2018 at 02:21, on Zulip):

probably github being too smart about stuff :P

qmx (May 09 2018 at 02:21, on Zulip):

#teamlazy

nikomatsakis (May 09 2018 at 02:22, on Zulip):

that does happen

Reed Koser (May 09 2018 at 03:47, on Zulip):

yeah, my work doesn't intersect much with the histo stuff @qmx. My "tool" is a python script because I knew that would be easier than trying to get interactive plotting in Rust =)

Chris Vittal (May 09 2018 at 04:43, on Zulip):

@nikomatsakis , that's fine. I'll be happy to take a look.

nikomatsakis (May 09 2018 at 11:31, on Zulip):

@Jake Goulding on Gitter, you wrote this example:

//#![feature(nll)]

struct A;

fn main() {
    let c = Box::new((A, A));

    // Consume internals
    let _a = c.0;
    let _b = c.1;
}

I think that the reason this works with NLL borrow checker is that we started special-casing Box again. On the AST-based borrow checker, we had some steps to treat Box conservatively and hence once you moved out of one part, e.g. the field 0, you would be considered to have moved the entire box. However those special cases were inconsistent and kind of hacky and we removed them in the MIR-based borrow checker, for better or worse.

cc @pnkfelix this is something I've always wanted to revisit and make sure we are happy with =)

pnkfelix (May 09 2018 at 11:46, on Zulip):

We should probably open a bug specifically about revisiting that choice. (...... and maybe... shudder... an RFC..?)

lqd (May 09 2018 at 11:56, on Zulip):

still thinking about the transitive closure mentioned in the borrowck repo, issue #6: completely commenting it out brings clap down from 147s to 9s (and of course misses half the tuples). Do we have an idea if those 9s are good, good enough, bad ?

nikomatsakis (May 09 2018 at 12:00, on Zulip):

it's obviously a lot better =) that's a good measurement, though. Still not great. It'd be good to start investigating where that time is going as well (for once we solve the TC problem)

lqd (May 09 2018 at 12:08, on Zulip):

I wonder if frank mcsherry has debugging and profiling tools for timely :)

nikomatsakis (May 09 2018 at 12:30, on Zulip):

not sure, he mentioned to me at one point that a useful thing was just to stick some calls to count to get a view of raw number of tuples flowing about at any point

lqd (May 09 2018 at 12:35, on Zulip):

(I had forgotten to check this data point as comparison, but the regular NLL analysis takes 16s on this machine)

nikomatsakis (May 09 2018 at 12:36, on Zulip):

9s still feels like a tremendous amount to me

nikomatsakis (May 09 2018 at 12:37, on Zulip):

I think that part of the problem is that we are propagating things "per point" right now

nikomatsakis (May 09 2018 at 12:37, on Zulip):

and there are 2x points per MIR statement (not even basic blocks)

lqd (May 09 2018 at 12:39, on Zulip):

to me too unfortunately (btw the other subset rules apart from the TC didn't seem to be heavy, making subset = outlives didn't change those 9s)

lqd (May 09 2018 at 12:40, on Zulip):

having the invalidation points will be interesting to see as well

lqd (May 09 2018 at 12:44, on Zulip):

it would also be interesting to see what kind of query plans would a graph database generate for these relations :)

nikomatsakis (May 09 2018 at 13:47, on Zulip):

@pnkfelix @qmx now we can't talk anymore :)

qmx (May 09 2018 at 13:48, on Zulip):

heh

nikomatsakis (May 09 2018 at 13:48, on Zulip):

I wonder if zulip also supports "heading" tags

nikomatsakis (May 09 2018 at 13:48, on Zulip):

## Foo

nikomatsakis (May 09 2018 at 13:48, on Zulip):

good, that's a kind of misfeature :)

Jake Goulding (May 09 2018 at 16:52, on Zulip):

we started special-casing Box again. [...] we removed [those special cases] in the MIR-based borrow checker

@nikomatsakis so, is it special-cased before, after, or differently with MIR borrowck?

Jake Goulding (May 09 2018 at 16:53, on Zulip):

And here's a contentious question: is the name "non-lexical lifetimes" a misnomer? (not as bad as OIBIT, though)

Jake Goulding (May 09 2018 at 16:53, on Zulip):

because lifetimes don't really change with NLL; it's just the length of a borrow that changes

qmx (May 09 2018 at 16:58, on Zulip):

whatever the new name is, it has to have "loans" on it :joy:

Jake Goulding (May 09 2018 at 17:08, on Zulip):

I mean, the name doesn't really have to change, as @nikomatsakis points out, once it's enabled, no one will ever think about it again.
It will "just be"

nikomatsakis (May 09 2018 at 17:11, on Zulip):

@Jake Goulding I would say it is special-cased differently :)

nikomatsakis (May 09 2018 at 17:12, on Zulip):

but the old borrow checker was aiming not to special-case it -- meaning, to only permit you to do things you could emulate with a fn into_inner(self) etc

Jake Goulding (May 09 2018 at 17:12, on Zulip):

@nikomatsakis and another missing piece of the puzzle for me: where does the borrow checker come into play with this at all? I'd understand if there were some references involved...

nikomatsakis (May 09 2018 at 17:13, on Zulip):

the borrow checker checks moves too

nikomatsakis (May 09 2018 at 17:13, on Zulip):

they interact

Jake Goulding (May 09 2018 at 17:13, on Zulip):

TIL. I guess borrow_or_move_ck isn't as smooth of a name

nikomatsakis (May 09 2018 at 17:13, on Zulip):

"ownership-check"

nikomatsakis (May 09 2018 at 17:13, on Zulip):

initially the borrow checker did not check moves

nikomatsakis (May 09 2018 at 17:13, on Zulip):

but that changed

nikomatsakis (May 09 2018 at 17:14, on Zulip):

technically that's a "sub-phase", essentially, the "initialization check" (where a move is a "deinitialization")

Jake Goulding (May 09 2018 at 17:18, on Zulip):

@nikomatsakis any objections to me stating that "NLL" is poorly named in a stack overflow answer? :innocent:

nikomatsakis (May 09 2018 at 17:19, on Zulip):

I don't disagree

nikomatsakis (May 09 2018 at 17:19, on Zulip):

so "no" I suppose

Jake Goulding (May 09 2018 at 17:19, on Zulip):

I mean, I plan on having more words to back it up. And mentioning MIR borrowck as the core piece

Jake Goulding (May 09 2018 at 17:20, on Zulip):

"MIR ownership check" I suppose ;-)

nikomatsakis (May 09 2018 at 17:20, on Zulip):

borrowck2.0

nikomatsakis (May 09 2018 at 17:20, on Zulip):

"Now more precise!"

Reed Koser (May 09 2018 at 17:53, on Zulip):

@Santiago Pastorino Have you made any progress on https://github.com/rust-lang-nursery/borrow-check/issues/4 ? I'd really like to have that information and have time to hack it up today =)

Reed Koser (May 09 2018 at 17:57, on Zulip):

(though for general reference, my schedule is changing a lot starting next week and I won't be able to make the weekly meetings unless they get moved sometime that's not from ~9am to 6pm PDT/12pm to 9pm EDT)

Reed Koser (May 09 2018 at 17:58, on Zulip):

I should still be able to stay in touch async though

nikomatsakis (May 09 2018 at 17:58, on Zulip):

@Reed Koser I don't think @Santiago Pastorino has had a chance to do anything. If you have time to hack on it, I say go for it!

lqd (May 09 2018 at 18:19, on Zulip):

it seems the datalog compiled to a binary with soufflé is slower than the timely analysis ? (the counts seem to match, but I'll need to check the output :) -- I killed the single threaded soufflé since it was so long, but at 8 threads it took 92s.

nikomatsakis (May 09 2018 at 18:23, on Zulip):

@lqd note that the datalog can be optimized by reordering clauses sometimes

nikomatsakis (May 09 2018 at 18:23, on Zulip):

I didn't make any effort to order it intelligently

nikomatsakis (May 09 2018 at 18:24, on Zulip):

that said, I think that differential-dataflow is quite competitive

nikomatsakis (May 09 2018 at 18:24, on Zulip):

but I found massive (like 10x) differences in souffle's performance by doing some reordering

nikomatsakis (May 09 2018 at 18:24, on Zulip):

in prior experiments

nikomatsakis (May 09 2018 at 18:25, on Zulip):

you have to sort of visualize how many tuples will result...

nikomatsakis (May 09 2018 at 18:25, on Zulip):

basically prefer this that will "Kill of" stuff

lqd (May 09 2018 at 18:40, on Zulip):

indeed reordering and using their profiler could be an interesting experiment, I was mostly trying it out in case it was faster out of the box, and could have offered insights on the timely plan, but alas

Santiago Pastorino (May 09 2018 at 18:41, on Zulip):

@Santiago Pastorino Have you made any progress on https://github.com/rust-lang-nursery/borrow-check/issues/4 ? I'd really like to have that information and have time to hack it up today =)

I haven't started yet ... is the next task I have on my todo list

Santiago Pastorino (May 09 2018 at 18:41, on Zulip):

probably starting today or tomorrow

nikomatsakis (May 09 2018 at 18:46, on Zulip):

@Santiago Pastorino not sure if @Reed Koser will wind up hacking on that, but there was another "bespoke" data structure I wanted to play around with, I could try to write out the details

nikomatsakis (May 09 2018 at 18:47, on Zulip):

though I should work more on that "harness"

nikomatsakis (May 09 2018 at 19:53, on Zulip):

@Reed Koser are you hacking on #4 after all?

Reed Koser (May 09 2018 at 19:54, on Zulip):

slowly, yes

nikomatsakis (May 10 2018 at 12:03, on Zulip):

grr what the heck is going on -- so I merged https://github.com/rust-lang-nursery/borrow-check/pull/18 -- but now, on my mac anyway, I am not able to build anymore

nikomatsakis (May 10 2018 at 12:03, on Zulip):

can someone else test?

qmx (May 10 2018 at 12:03, on Zulip):

can do

nikomatsakis (May 10 2018 at 12:04, on Zulip):

(you will need a recent nightly)

qmx (May 10 2018 at 12:05, on Zulip):

is 3 days ago recent enough?

nikomatsakis (May 10 2018 at 12:05, on Zulip):

it's weird though because travis is green...

nikomatsakis (May 10 2018 at 12:05, on Zulip):

should be, yeah

qmx (May 10 2018 at 12:06, on Zulip):

yep, master compiled just fine

nikomatsakis (May 10 2018 at 12:06, on Zulip):

huh. strange.

nikomatsakis (May 10 2018 at 12:07, on Zulip):

@qmx which nightly are you using? I am using:

> cargo +nightly --version
cargo 1.27.0-nightly (9e53ac6e6 2018-05-07)
qmx (May 10 2018 at 12:08, on Zulip):

rustc 1.27.0-nightly (91db9dcf3 2018-05-04)

qmx (May 10 2018 at 12:08, on Zulip):

updating my nightly to see if something broke

nikomatsakis (May 10 2018 at 12:08, on Zulip):

I will try that one

qmx (May 10 2018 at 12:08, on Zulip):

/me thinks he will regret that

nikomatsakis (May 10 2018 at 12:09, on Zulip):

the conference wifi is not too fast though

nikomatsakis (May 10 2018 at 12:09, on Zulip):

so my ability to download new nightly's is limited :P

qmx (May 10 2018 at 12:09, on Zulip):

been there

qmx (May 10 2018 at 12:13, on Zulip):

argh, this is the bane of my existance

error: could not rename component directory from '/home/qmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends' to '/home/qmx/.rustup/tmp/gpz2qvd0u6nl969o_dir/bk'
info: caused by: Invalid cross-device link (os error 18)

I hit this every single time

nikomatsakis (May 10 2018 at 12:13, on Zulip):

what the

nikomatsakis (May 10 2018 at 12:13, on Zulip):

I've never heard of that

nikomatsakis (May 10 2018 at 12:14, on Zulip):

ok, I managed to download 2018-05-04, building now

qmx (May 10 2018 at 12:14, on Zulip):

I don't even know where to start debugging this

nikomatsakis (May 10 2018 at 12:15, on Zulip):

hmm 2018-05-04 seems to be working. I wonder if something happened to break it

Vytautas Astrauskas (May 10 2018 at 12:17, on Zulip):

I can confirm that master fails to compile with cargo 1.27.0-nightly (9e53ac6e6 2018-05-07).

qmx (May 10 2018 at 12:17, on Zulip):

there's something that's annoying me with rustc lately - near the end of the build process CPU usage drops to zero, idles 10s, then spikes and finishes the build

qmx (May 10 2018 at 12:19, on Zulip):

overall the wall clock time feels longer

nikomatsakis (May 10 2018 at 12:19, on Zulip):

curious

Vytautas Astrauskas (May 10 2018 at 12:23, on Zulip):

cargo +nightly-2018-05-06 build --release successfully compiled.

nikomatsakis (May 10 2018 at 12:24, on Zulip):

strange. for me, it does not.

nikomatsakis (May 10 2018 at 12:24, on Zulip):

but 2018-05-04 does

nikomatsakis (May 10 2018 at 12:24, on Zulip):

I wonder if something else is weird on my system

Vytautas Astrauskas (May 10 2018 at 12:26, on Zulip):

I am confused:

$ cargo +nightly-2018-05-06 --version
cargo 1.27.0-nightly (af3f1cd29 2018-05-03)

Shouldn't it be 2018-05-06, or at least 2018-05-05?

nikomatsakis (May 10 2018 at 12:26, on Zulip):

that...is confusing

Vytautas Astrauskas (May 10 2018 at 12:32, on Zulip):
$ cargo +nightly-2018-05-06 --version
cargo 1.27.0-nightly (af3f1cd29 2018-05-03)

$ cargo +nightly-2018-05-07 --version
cargo 1.27.0-nightly (af3f1cd29 2018-05-03)

$ cargo +nightly-2018-05-08 --version
cargo 1.27.0-nightly (af3f1cd29 2018-05-03)

$ cargo +nightly-2018-05-09 --version
cargo 1.27.0-nightly (af3f1cd29 2018-05-03)

$ cargo +nightly --version
cargo 1.27.0-nightly (9e53ac6e6 2018-05-07)
Vytautas Astrauskas (May 10 2018 at 12:33, on Zulip):

I'll try to reinstall rustup.

nikomatsakis (May 10 2018 at 12:33, on Zulip):

sometimes all the nightly components don't successfully build, could be related to that

Vytautas Astrauskas (May 10 2018 at 12:36, on Zulip):

If this is a case, then when was the latest nightly build?

Vytautas Astrauskas (May 10 2018 at 12:37, on Zulip):

In other words, why cargo +nightly --version reports 2018-05-07, but cargo +nightly-2018-05-09 --version reports 2018-05-03?

Vytautas Astrauskas (May 10 2018 at 12:46, on Zulip):

Ok, I think I finally understood. The reported date is the commit date while the date in the +nightly-2018-05-09 is the build date, which can be several days later.

Vytautas Astrauskas (May 10 2018 at 12:52, on Zulip):

Anyway, cargo +nightly-2018-05-07 build --release is the latest version that still works for me.

Vytautas Astrauskas (May 10 2018 at 12:53, on Zulip):

So, most likely something happened between the rustc commits 428ea5f6b 2018-05-06 and 565235ee7 2018-05-07.

nikomatsakis (May 10 2018 at 12:57, on Zulip):

thanks @Vytautas Astrauskas! I should file a bug....

Vytautas Astrauskas (May 10 2018 at 12:58, on Zulip):

No problem. :relaxed:

Jake Goulding (May 10 2018 at 19:10, on Zulip):

@nikomatsakis off-the-wall question, but the Box special casing we were talking about doesn't help Box<FnOnce>, does it?

nikomatsakis (May 10 2018 at 19:13, on Zulip):

no

Jake Goulding (May 10 2018 at 19:42, on Zulip):

booo

Jake Goulding (May 10 2018 at 19:42, on Zulip):

I really want a good-natured "boo" reaction emoji

nikomatsakis (May 10 2018 at 22:51, on Zulip):

I opened two new issues on the borrow-checker repo with ideas for ways to make the input smaller:

lqd (May 10 2018 at 22:52, on Zulip):

@nikomatsakis would the hypothetical datalog to DD builder emit semijoins when the previous predicate's output covers the next, and joins otherwise ?

nikomatsakis (May 10 2018 at 22:52, on Zulip):

by "covers" you mean all variables that appear in the second predicate also appeared in the first?

nikomatsakis (May 10 2018 at 22:52, on Zulip):

if so, yes

lqd (May 10 2018 at 22:52, on Zulip):

yeah

nikomatsakis (May 10 2018 at 22:53, on Zulip):

I think the idea would roughly be:

(ignoring negative things)

nikomatsakis (May 10 2018 at 22:54, on Zulip):

probably some details wrong there

lqd (May 10 2018 at 22:54, on Zulip):

so I feel the only grey area is when to use iterate vs other operators, or if there might need to be other inner timely scopes, etc

nikomatsakis (May 10 2018 at 22:55, on Zulip):

ah, yes, recursion is a bit tricky

nikomatsakis (May 10 2018 at 22:55, on Zulip):

there is a lower-level primitive you can use

nikomatsakis (May 10 2018 at 22:55, on Zulip):

but it would probably be good to build a DAG between relations

nikomatsakis (May 10 2018 at 22:55, on Zulip):

you could even not support complex cycles to begin with

nikomatsakis (May 10 2018 at 22:55, on Zulip):

most of the time the relations just recurse on themselves anyway

lqd (May 10 2018 at 22:56, on Zulip):

or maybe have a slightly "richer" input format, to manually control such cases

nikomatsakis (May 10 2018 at 22:58, on Zulip):

right, it doesn't have to really be datalog etc

nikomatsakis (May 10 2018 at 22:58, on Zulip):

especially not to start :)

lqd (May 10 2018 at 22:59, on Zulip):

eg .decl requires(R, B, P) iterates borrow_region

lqd (May 10 2018 at 22:59, on Zulip):

thanks for the answers, this seems like it would be fun to do :p

nikomatsakis (May 10 2018 at 23:31, on Zulip):

I guess to work around the breakage we can revert https://github.com/rust-lang-nursery/borrow-check/pull/18 for now

nikomatsakis (May 10 2018 at 23:34, on Zulip):

https://github.com/rust-lang-nursery/borrow-check/pull/22

qmx (May 10 2018 at 23:40, on Zulip):

yea, that fixed it

nikomatsakis (May 10 2018 at 23:44, on Zulip):

I restarted travis on your PR @qmx

qmx (May 10 2018 at 23:47, on Zulip):

do we need to add extern crate again with the reverts?

nikomatsakis (May 10 2018 at 23:47, on Zulip):

yes

nikomatsakis (May 10 2018 at 23:47, on Zulip):

ah so your PR may need to be edited

qmx (May 10 2018 at 23:48, on Zulip):

ok, fixing

qmx (May 10 2018 at 23:48, on Zulip):

it was so refreshing not having to do that :P

qmx (May 10 2018 at 23:53, on Zulip):

@nikomatsakis is your emacs rust syntax highlighting working with the nightly features or you just live with the breakage?

nikomatsakis (May 10 2018 at 23:54, on Zulip):

it works for the most part? I haven't noticed any glaring problems

qmx (May 10 2018 at 23:55, on Zulip):

yay, green PR

nikomatsakis (May 10 2018 at 23:57, on Zulip):

grr I feel like I'm constantly re-inventing things like IndexVec

nikomatsakis (May 10 2018 at 23:57, on Zulip):

it'd be nice to pull that into a rust-lang-nursery crate

qmx (May 10 2018 at 23:58, on Zulip):

sounds like boring janitorial work, how one can approach that?

nikomatsakis (May 11 2018 at 00:02, on Zulip):

I wonder if we should just pull the entire rustc_data_structures crate, or break it up into smaller crates

nikomatsakis (May 11 2018 at 00:02, on Zulip):

in any case, I can make some repos...

Reed Koser (May 11 2018 at 02:02, on Zulip):

I'm loving zulip threads. Made digesting a 99+ message backlog actually tractable :heart_eyes:

Keith Yeung (May 11 2018 at 05:45, on Zulip):

yeah, i'm totally just clicking on the topics/threads rn to read the context, instead of going into the #wg-nll stream to read everything there

pnkfelix (May 11 2018 at 09:34, on Zulip):

(though for general reference, my schedule is changing a lot starting next week and I won't be able to make the weekly meetings unless they get moved sometime that's not from ~9am to 6pm PDT/12pm to 9pm EDT)

Maybe we should set up another doodle?

nikomatsakis (May 11 2018 at 10:34, on Zulip):

I'm loving zulip threads. Made digesting a 99+ message backlog actually tractable :heart_eyes:

but you put this in the wrong thread! ;)

nikomatsakis (May 11 2018 at 10:42, on Zulip):

(to clarify, I was thinking of the "gitter is dead" thread)

But actually it's pretty interesting that the threads help to catch up later. I can imagine that.

Jake Goulding (May 11 2018 at 13:53, on Zulip):

agree with threads and catching up - can ignore what is uninteresting. needs to be sorted correctly tho

Jake Goulding (May 12 2018 at 01:33, on Zulip):

Mr-Darcy.

qmx (May 13 2018 at 03:48, on Zulip):

argh, this is the bane of my existance

error: could not rename component directory from '/home/qmx/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends' to '/home/qmx/.rustup/tmp/gpz2qvd0u6nl969o_dir/bk'
info: caused by: Invalid cross-device link (os error 18)

I hit this every single time

@nikomatsakis so this error is this one https://github.com/rust-lang-nursery/rustup.rs/issues/1239 - quite a fun one to hit :)

nikomatsakis (May 13 2018 at 11:31, on Zulip):

Argh

nikomatsakis (May 13 2018 at 11:31, on Zulip):

Well at least you found the issue I guess

Reed Koser (May 15 2018 at 13:55, on Zulip):

One again I won't be able to make the triage meeting this week. I'll try to write up my progress quickly in the doc though

Keith Yeung (May 15 2018 at 18:01, on Zulip):

can't make it today as well, i've got meetings all over

pnkfelix (May 17 2018 at 11:16, on Zulip):

is anyone else observing borrow_check rebuilding itself on every cargo run/cargo test invocation, starting from... well, I'm not getting consistent results as to which crate it starts from ...

lqd (May 17 2018 at 11:45, on Zulip):

@pnkfelix not for me on cargo run (but I'm on a rev a couple days old)

nikomatsakis (May 17 2018 at 12:24, on Zulip):

I've noticed that in general (that cargo run likes to rebuild the root crate when I don't feel it should) but not for borrow check in particular

lqd (May 17 2018 at 16:03, on Zulip):

the Mentat talk at rustconf will probably be very interesting wrt datalog :)

Santiago Pastorino (May 17 2018 at 16:22, on Zulip):

there should be a rustc-conf where the ones that know explain the compiler and it's ecosystem :)

qmx (May 17 2018 at 16:22, on Zulip):

that would be super cool

Santiago Pastorino (May 18 2018 at 02:51, on Zulip):

some days ago we were talking about rustc compile times

Santiago Pastorino (May 18 2018 at 02:51, on Zulip):

I did the full thing, without build directory

Santiago Pastorino (May 18 2018 at 02:51, on Zulip):

it took on my machine 145 minutes

Santiago Pastorino (May 18 2018 at 02:52, on Zulip):

I was unplugged, unsure if my OS has something configured that could have slowed down or something

Santiago Pastorino (May 18 2018 at 02:53, on Zulip):

will try again tomorrow to see this

davidtwco (May 18 2018 at 13:14, on Zulip):

Has anything changed since I took a break that would cause bootstrap to fail with lldb --version? Happening on existing cloned repos when I pull and with new clones.

davidtwco (May 18 2018 at 13:37, on Zulip):
thread 'main' panicked at '"lldb" "--version" failed Output { status: ExitStatus(ExitStatus(32512)), stdout: "", stderr: "" }', bootstrap/sanity.rs:243:24
note: Run with `RUST_BACKTRACE=1` for a backtrace.
nikomatsakis (May 18 2018 at 13:38, on Zulip):

uh...

nikomatsakis (May 18 2018 at 13:38, on Zulip):

I have no idea :)

Reed Koser (May 18 2018 at 15:47, on Zulip):

I will have some time on my hands after work today/this weekend. I saw that there were a couple of AIs from the "more future plans" thread, what would be the most useful thing for me to work on from there?

nikomatsakis (May 18 2018 at 15:47, on Zulip):

"AI"?

Reed Koser (May 18 2018 at 15:48, on Zulip):

Err, action item

Reed Koser (May 18 2018 at 15:48, on Zulip):

Sorry, jargon has permeated my brain

nikomatsakis (May 18 2018 at 15:48, on Zulip):

ha

nikomatsakis (May 18 2018 at 15:49, on Zulip):

I agree there are some distinct action items

nikomatsakis (May 18 2018 at 15:49, on Zulip):

I'm feeling a bit disorganized just now

nikomatsakis (May 18 2018 at 15:49, on Zulip):

I will try to write a kind of plan on an issue later today though

Reed Koser (May 18 2018 at 15:51, on Zulip):

Sounds good, I'm not free until 6 or 7 PDT anyway

Reed Koser (May 18 2018 at 15:51, on Zulip):

Just wanted to get the ball rolling a bit :blush:

Jake Goulding (May 18 2018 at 16:25, on Zulip):

@nikomatsakis Do you happen to know if there's a NLL test for "recursive mutable borrows"?

Specifically, this code fails pre-NLL and works post-NLL

type Link = Option<Box<Node>>;

struct Node {
    next: Link
}

struct Recursive {
    root: Link
}

impl Recursive {
    fn back(&mut self) -> &mut Link {
        let mut anchor = &mut self.root;
        while let Some(ref mut node) = *anchor {
            anchor = &mut node.next;
        }
        anchor
    }
}

It's quite a popular Stack Overflow question, so I think it's worth pinning down with a test.

nikomatsakis (May 18 2018 at 16:57, on Zulip):

I believe there is a test for that, yes, but I don't know the name off hand

davidtwco (May 18 2018 at 17:53, on Zulip):

Just watching that video - very helpful! Code walkthroughs like that are something we should do more of.

nikomatsakis (May 18 2018 at 17:59, on Zulip):

I want to start doing it more often. I should make a little YouTube channel or something. If you're interested in being a guinea pig, let me know :)

davidtwco (May 18 2018 at 18:00, on Zulip):

I'd be up for being a guinea pig.

nikomatsakis (May 18 2018 at 18:15, on Zulip):

gotta figure out what to walk through I suppose :)

nikomatsakis (May 18 2018 at 18:15, on Zulip):

we could try to look at that perf problem I was talking about earlier

davidtwco (May 18 2018 at 18:16, on Zulip):

Yeah, that would be good, I'm still not all that sure what specific thing I can be digging into.

nikomatsakis (May 18 2018 at 18:21, on Zulip):

hmm — want to try that shortly?

nikomatsakis (May 18 2018 at 18:21, on Zulip):

like, in 30min to an hour or so?

davidtwco (May 18 2018 at 18:22, on Zulip):

Yeah, sure.

nikomatsakis (May 18 2018 at 18:23, on Zulip):

ok, maybe on the hour? (that is, 3pm my time — probably 8pm yours?) I actually could do it whenever I suppose

davidtwco (May 18 2018 at 18:24, on Zulip):

I'm free for the rest of the day, whenever suits you.

nikomatsakis (May 18 2018 at 18:24, on Zulip):

if it works for you, how about in 5 minutes? :)

nikomatsakis (May 18 2018 at 18:24, on Zulip):

I'll just go find a room

davidtwco (May 18 2018 at 18:24, on Zulip):

Sure.

Jake Goulding (May 20 2018 at 15:57, on Zulip):

Should :frog: have #![feature(nll)] enabled? I think so. Full Ouroboros.

qmx (May 20 2018 at 16:07, on Zulip):

Do this means downstream datafrog users would not be able to compile it with stable?

pnkfelix (May 21 2018 at 12:26, on Zulip):

Hey @nikomatsakis I just noticed: back in December ariel added the fn before_statement_effect and fn before_terminator_effect stuff. But as far as I can telll, a later PR by @Reed Koser recreated those same effects (which is to call kill_loans_out_of_scope_at at the start of fn statement_effect and fn terminator_effect.

nikomatsakis (May 21 2018 at 12:27, on Zulip):

ah, interesting. Perhaps a sort of race condition.

pnkfelix (May 21 2018 at 12:27, on Zulip):

So that raises some questions. E.g. do we still need fn before_foo_effect in the dataflow API? And how much efficiency are we losing by having those extra calls to kill_loans_out_of_scope_at? Anyway I will investigate further. Its possible I've misunderstood something.

pnkfelix (May 21 2018 at 12:27, on Zulip):

Oh and I probably should update my repo before I draw any firm conclusions.

nikomatsakis (May 21 2018 at 12:27, on Zulip):

yes we need it

nikomatsakis (May 21 2018 at 12:28, on Zulip):

I think what we don't need is the second call to kill_loans_out_of_scope

pnkfelix (May 21 2018 at 12:28, on Zulip):

If we need it I don't see where we are currently using it

nikomatsakis (May 21 2018 at 12:28, on Zulip):

I already was talking to @David Wood about removing it

pnkfelix (May 21 2018 at 12:28, on Zulip):

(in the sense of, I don't see where we currently observe its effect)

pnkfelix (May 21 2018 at 12:28, on Zulip):

Anyway what brought me to investigate this

nikomatsakis (May 21 2018 at 12:28, on Zulip):

let me go double check but I believe that was important and could not be simulated with the existing statement_effect

nikomatsakis (May 21 2018 at 12:29, on Zulip):

also, have you seen all the :frog: deveopments @pnkfelix ?

pnkfelix (May 21 2018 at 12:29, on Zulip):

is that I was thinking of tearing out fn before_foo_effect, and replacing it with new parameters to fn statement_effect

davidtwco (May 21 2018 at 12:29, on Zulip):

There's a PR in to remove the two calls to the expensive function.

nikomatsakis (May 21 2018 at 12:29, on Zulip):

is that I was thinking of tearing out fn before_foo_effect, and replacing it with new parameters to fn statement_effect

that..hmm. that sounds strictly worse to me?

nikomatsakis (May 21 2018 at 12:29, on Zulip):

I guess my knee jerk reaction to a parameter is "no" though :)

pnkfelix (May 21 2018 at 12:29, on Zulip):

something like enum Offset { BeforeEntry, BetweenEvalRhsAndAssignToLHS, After }, and then have fn statement_effect(from: Offset, upto: Offset);

nikomatsakis (May 21 2018 at 12:29, on Zulip):

I see

nikomatsakis (May 21 2018 at 12:30, on Zulip):

it sounds kind of complex to reason about

pnkfelix (May 21 2018 at 12:30, on Zulip):

My issue is that right now I find the specification of what before_statement_effect quite confusing

nikomatsakis (May 21 2018 at 12:30, on Zulip):

where do we use After?

nikomatsakis (May 21 2018 at 12:30, on Zulip):

I think it actually maps quite well to the concept of start and mid points

pnkfelix (May 21 2018 at 12:30, on Zulip):

The intention is that the callers write down what scope of effect they are trying to capture

nikomatsakis (May 21 2018 at 12:30, on Zulip):

before_statement_effect is basically the "start" point and statement_effect is the "mid point"

nikomatsakis (May 21 2018 at 12:30, on Zulip):

though really I think "mid point" is not the best term

pnkfelix (May 21 2018 at 12:30, on Zulip):

do they want the whole effect (in which case they pass from: BeforeEntry, upto: After

nikomatsakis (May 21 2018 at 12:30, on Zulip):

in that it's not a specific point, but rather a kind of "heisenberg range"

pnkfelix (May 21 2018 at 12:31, on Zulip):

or do they want to investigate the intermediate point after the RHS has been evaluated

nikomatsakis (May 21 2018 at 12:31, on Zulip):

or do they want to investigate the intermediate point after the RHS has been evaluated

I'm not convinced that's a meaningful thing

nikomatsakis (May 21 2018 at 12:31, on Zulip):

in fact, i'm pretty convinced it's not

nikomatsakis (May 21 2018 at 12:31, on Zulip):

or, specifically what I mean is:

nikomatsakis (May 21 2018 at 12:31, on Zulip):

there is no point in between evaluating the RHS and storing into the LHS

pnkfelix (May 21 2018 at 12:31, on Zulip):

Because we don't write to the RHS as an atomic action?

nikomatsakis (May 21 2018 at 12:31, on Zulip):

those happen simultaneously

nikomatsakis (May 21 2018 at 12:32, on Zulip):

this is what I meant by "heisenberg range" above :)

pnkfelix (May 21 2018 at 12:32, on Zulip):

I suppose that is true

pnkfelix (May 21 2018 at 12:33, on Zulip):

I've seen the traffic about :frog: but I have not had the chance to catch up with it

pnkfelix (May 21 2018 at 12:33, on Zulip):

I did see mention that it would affect whether we still need subprocess integration

pnkfelix (May 21 2018 at 12:34, on Zulip):

Anyway I do agree we need something more. I just don't like the current API, or at least the current specification of the current API.

pnkfelix (May 21 2018 at 12:35, on Zulip):

(Which of course I should have commented on back in December, I'm not saying that I'm faultless here)

nikomatsakis (May 21 2018 at 12:36, on Zulip):

I did see mention that it would affect whether we still need subprocess integration

yes very much

pnkfelix (May 21 2018 at 12:37, on Zulip):

The other option I was considering was to replace whole-hog the uses of mir::Location underneath rustc_mir::dataflow and rustc_mir::borrow_check with some sort of rustc_mir::dataflow::Location type that would encode whether we were sitting Before, or Amidst, or After.

pnkfelix (May 21 2018 at 12:39, on Zulip):

but I wanted to make it easy for non-borrow-check clients to continue using dataflow. Which means giving some easy path for recreating the effect of a whole statement, without trying to model the fuzzy space modeled by Mid (or Amidst, whatever).

pnkfelix (May 21 2018 at 12:39, on Zulip):

anyway I guess I will now review the backlog to try to determine what is going on.

nikomatsakis (May 21 2018 at 12:39, on Zulip):

the TL;DR is that we moved from differential-dataflow to :frog: and — as a side-effect — we can now integrate polonius as a library quite easily. Probably more easily than an executable.

nikomatsakis (May 21 2018 at 12:43, on Zulip):

The other option I was considering was to replace whole-hog the uses of mir::Location underneath rustc_mir::dataflow and rustc_mir::borrow_check with some sort of rustc_mir::dataflow::Location type that would encode whether we were sitting Before, or Amidst, or After.

this already exists. It's called LocationIndex.

nikomatsakis (May 21 2018 at 12:44, on Zulip):

I want to re-iterate that I don't think we want/need an After point though =)

pnkfelix (May 21 2018 at 12:52, on Zulip):

if your meaning is that an (After, loc)should be equivalent in meaning to a (Before, succ(loc)), then I understand that and agree it would be a redundancy

nikomatsakis (May 21 2018 at 12:52, on Zulip):

yeah pretty much that

Reed Koser (May 23 2018 at 06:01, on Zulip):

did we ever ended up with graphviz visualizations for facts?

@qmx: to the best of my knowledge, no

Keith Yeung (May 23 2018 at 07:45, on Zulip):

not sure where i'm supposed to ask this, but what becomes of the SEME integration?

Keith Yeung (May 23 2018 at 07:46, on Zulip):

last week's meeting niko mentioned that we'll be instead moving towards implementing that as a short term solution

pnkfelix (May 23 2018 at 09:07, on Zulip):

I think at this point niko has decided that SEME would be too much effort for too little gain

nikomatsakis (May 23 2018 at 09:10, on Zulip):

yep, it's optimizing something that is 0% of the profile

pnkfelix (May 24 2018 at 14:20, on Zulip):

Hey: Was part of the expected effects of NLL to actually pin down a particular destruction order for the variables in let (x, y) = ...; ?

pnkfelix (May 24 2018 at 14:21, on Zulip):

Historically the AST-borrowck has treated those as expiring at "the same time", in terms of saying e.g. if y is Drop and holds a borrow of x, that's an error. Even though technically we could allow that.

pnkfelix (May 24 2018 at 14:22, on Zulip):

It seems that since MIR-borrowck operates on the control flow, it has stopped treating that like an error. (But having x be Drop and hold a borrow of y continues to be an error.

pnkfelix (May 24 2018 at 14:23, on Zulip):

My question is: Do we want to try to prevent this? (not sure exactly how we would; perhaps with more FalseEdges analogous to what we did for match in order to keep our options open for the future...)

pnkfelix (May 24 2018 at 14:24, on Zulip):

((doing that might cause code explosion though...))

nikomatsakis (May 24 2018 at 14:24, on Zulip):

@pnkfelix a good point. I would be ok with pinning down a dtor order: after all, it's observable in other ways

pnkfelix (May 24 2018 at 14:25, on Zulip):

yeah the only argument I can see against it is that some people may see AST-borrowck's current strictness (of requiring separate let bindings when drop order matters) as a feature, not a bug...

pnkfelix (May 24 2018 at 14:25, on Zulip):

(sort of like how some people like requiring let mut back during the mutapocalypse)

pnkfelix (May 24 2018 at 14:26, on Zulip):

Though this seems somewhat less likely to actually catch bugs in the real world

pnkfelix (May 24 2018 at 14:27, on Zulip):

I guess I'll open an issue just to have something to reference from Github when having discussion in comment threads

pnkfelix (May 24 2018 at 15:12, on Zulip):

Filed as rust-lang/rust#51036

pnkfelix (May 24 2018 at 21:22, on Zulip):

hey niko do you have a second to double check something with me?

pnkfelix (May 24 2018 at 21:23, on Zulip):

or maybe I'll ask Zoxc

pnkfelix (May 24 2018 at 21:24, on Zulip):

the basic question is: the comments in https://github.com/rust-lang/rust/blob/master/src/test/ui/generator/dropck.rs imply (to me) that a use-after-free was observed, or at least posited to exist

pnkfelix (May 24 2018 at 21:25, on Zulip):

But I don't think it would have under Rust's semantics for drop order in let (cell, mut gen);

pnkfelix (May 24 2018 at 21:25, on Zulip):

namely, the final comment says "drops the RefCell and then the Ref, leading to use-after-free"

pnkfelix (May 24 2018 at 21:26, on Zulip):

but for that to happen, the drop order would need to be: drop the cell before the gen. And that implies the declaration should have been let (mut gen, cell);

nikomatsakis (May 24 2018 at 21:29, on Zulip):

@pnkfelix not sure :)

pnkfelix (May 24 2018 at 21:34, on Zulip):

okay. All I know is that if I switch the declaration order to let (mut gen, cell);, we start seeing the expected errors under NLL.

nikomatsakis (May 24 2018 at 21:37, on Zulip):

in most of these cases NLL is correct :)

nikomatsakis (May 24 2018 at 21:37, on Zulip):

since it has the actual executable code to analyze...

nikomatsakis (May 24 2018 at 21:37, on Zulip):

...sometimes that code is odd though

nikomatsakis (May 24 2018 at 21:38, on Zulip):

(doens't sound like the instance here)

nikomatsakis (May 24 2018 at 21:38, on Zulip):

most of those cases where I am grumpy have to do with the temporaries in tail position

lqd (May 26 2018 at 10:33, on Zulip):

Spoke a bit about Polonius and NLL with RalfJ at rusfest paris and they mentioned they were interested in it, relating to their Coq formal work :)

nikomatsakis (May 26 2018 at 11:21, on Zulip):

I'm jealous of you RustFesters!

lqd (May 26 2018 at 13:07, on Zulip):

:)

Jake Goulding (May 26 2018 at 14:09, on Zulip):

Hello NLL friends! This generates an error with and without NLL, but we aren't sure it should. Any opinions one way or the other?:

#![feature(nll)]

fn next<'buf>(buffer: &'buf mut String) -> &'buf str {
    loop {
        let event = parse(buffer);

        if true {
            return event;
        }
    }
}

fn parse<'buf>(_buffer: &'buf mut String) -> &'buf str {
    unimplemented!()
}

fn main() {}
error[E0499]: cannot borrow `*buffer` as mutable more than once at a time
 --> src/main.rs:5:27
  |
5 |         let event = parse(buffer);
  |                           ^^^^^^ mutable borrow starts here in previous iteration of loop
  |
note: borrowed value must be valid for the lifetime 'buf as defined on the function body at 3:1...
 --> src/main.rs:3:1
  |
3 | fn next<'buf>(buffer: &'buf mut String) -> &'buf str {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jake Goulding (May 26 2018 at 14:11, on Zulip):

seeing as how event should either leave the loop or be thrown away before the next iteration

nikomatsakis (May 28 2018 at 10:24, on Zulip):

@Jake Goulding this should throw an error (for now) but this error should eventually go away. This is precisely a case where "Location sensitivity" is needed, but we removed that feature in the name of performance — once polonius support lands, though, this code would be accepted. That may or may not be before the edition.

nikomatsakis (May 28 2018 at 10:25, on Zulip):

It's actually a nice reduced test case, maybe you can file an issue? It'd be good to add to the test suite.

Jake Goulding (May 28 2018 at 15:35, on Zulip):

maybe you can file an issue?

Done as https://github.com/rust-lang/rust/issues/51132. Thanks!

Jake Goulding (May 28 2018 at 15:40, on Zulip):

Would anyone care to take a stab at what "location sensitivity" is in 1-3 sentences? I'm pretty sure I'd botch it. Trying to circle back to answer the original SO question that prompted that last example.

nikomatsakis (May 28 2018 at 15:44, on Zulip):

in the context of your example: the value event only has to have the lifetime 'buf conditionally — at the return point which may or may not execute. But when we are "location insensitive", we just track the lifetime that event must have anywhere, without considering where that lifetime must hold. In this case, that means we make it hold everywhere, which is why you get a compilation failure.

Jake Goulding (May 28 2018 at 15:49, on Zulip):

I see. So the lifetime of the event inside the if block needs to be 'buf, but the lifetime of the event after the if doesn't. Does "anywhere" even mean outside the loop?

nikomatsakis (May 28 2018 at 15:51, on Zulip):

yes

nikomatsakis (May 28 2018 at 15:52, on Zulip):

so, one subtle thing is that the current analysis is location sensitive in one respect

nikomatsakis (May 28 2018 at 15:52, on Zulip):

where the borrow takes place

nikomatsakis (May 28 2018 at 15:52, on Zulip):

but the length of the borrow is not

nikomatsakis (May 28 2018 at 15:52, on Zulip):

this is why you can often fix bugs by doing

nikomatsakis (May 28 2018 at 15:53, on Zulip):

that is, by convering:

let p = &x;
if condition(p) {
  return p;
}

into:

let p = &x;
if condition(p) {
  return &x; // NB fresh borrow
}
nikomatsakis (May 28 2018 at 15:53, on Zulip):

this is why you can often fix bugs by doing

er, I mean "workaround" the problem, really

Jake Goulding (May 28 2018 at 15:54, on Zulip):

heh, I like it

Santiago Pastorino (May 28 2018 at 21:00, on Zulip):

does someone know how to pass compare-mode=nll when using x.py?

nikomatsakis (May 28 2018 at 21:09, on Zulip):

@Santiago Pastorino hmm I think you may have to run with -v and add the argument manually

Santiago Pastorino (May 28 2018 at 21:10, on Zulip):

how is that?

nikomatsakis (May 28 2018 at 21:11, on Zulip):

x.py test -v src/test/ui, in other words, and then see what gets output

nikomatsakis (May 28 2018 at 21:11, on Zulip):

there should be a call to a compiletest binary somewhere

nikomatsakis (May 28 2018 at 21:11, on Zulip):

but maybe we added a compare-mode to x.py

nikomatsakis (May 28 2018 at 21:11, on Zulip):

I can't remember

Santiago Pastorino (May 28 2018 at 21:12, on Zulip):

there's also this https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L704-L709

nikomatsakis (May 28 2018 at 21:12, on Zulip):

if not, we could add one readily enough...

Santiago Pastorino (May 28 2018 at 21:12, on Zulip):

but that will run on ci I guess

Santiago Pastorino (May 28 2018 at 21:12, on Zulip):

I mean I can use to quickly test it

Santiago Pastorino (May 28 2018 at 21:12, on Zulip):

better to use this one https://github.com/rust-lang/rust/blob/master/src/bootstrap/test.rs#L649-L655 I guess

nikomatsakis (May 28 2018 at 21:13, on Zulip):

oh btw there is ./x.py test --rustc-args

nikomatsakis (May 28 2018 at 21:13, on Zulip):

which would prob suffice for a simple test :)

nikomatsakis (May 28 2018 at 21:14, on Zulip):

you might be able to use --test-args for this?

nikomatsakis (May 28 2018 at 21:14, on Zulip):

@Santiago Pastorino try --test-args '--compare-mode polonius' and see if that works

nikomatsakis (May 28 2018 at 21:15, on Zulip):

that is, ./x.py test src/test/ui --test-args '--compare-mode polonius'

Santiago Pastorino (May 28 2018 at 21:17, on Zulip):

have already tried test-args but without quotes

Santiago Pastorino (May 28 2018 at 21:17, on Zulip):

trying exactly that

Santiago Pastorino (May 28 2018 at 21:18, on Zulip):

I guess we should move to #'compate-mode notes'

Jake Goulding (May 30 2018 at 03:09, on Zulip):

A side anecdote... A few minutes ago, I was surprised to learn that this code works with NLL:

let mut foo = None;
let mut string1 = "Hello".to_string();
foo = Some(&string1);
let mut string2 = "Goodbye".to_string();
foo = Some(&string2);

After reflection, I think my problem is that I have a preexisting mental model where the type of foo starts as Option<&'static String>. On the first assignment, it would be changing it's type to Option<&'string1 String> and then to Option<&'string2 String> at the second assignment. "Obviously" you can't change the type of a variable through assignment, so it makes "intuitive" sense that this would fail to compile.

To keep my mental model where the lifetime is part of the type and a type cannot change through assignment , the lifetime inside foo under NLL has to be more "fluid". It's now always the same thing (say 'a), but the actual value of that 'a changes depending on which line of code we are looking at (a.k.a. what actions have occurred to the referred-to value).

Just thought I'd share; I wonder how other Rustaceans mental models compare and how they will be affected by NLL.

nikomatsakis (May 30 2018 at 08:55, on Zulip):

@Jake Goulding there is actually a question mark for me about more-or-less this specific point with polonius. But a question: does it surprise you that this would work? (This works today)

let mut string1 = "Hello".to_string();
let mut string2 = "Goodbye".to_string();
let mut foo = None;
foo = Some(&string1);
foo = Some(&string2);
nikomatsakis (May 30 2018 at 08:57, on Zulip):

That said, polonius does allow you to do things that might be surprising if you think too hard about them, and I've been wondering if we should dial it back. The motivation is to support stuff like this:

let mut x = 3;
let mut p = &x;
let mut q = p;
let mut y = 4;
p = &y; // at this point, p "borrows" y, and q "borrows" x
println(p);
y += 1; // key point: p is no longer in use, so y is not borrowed
prontln(q);
nikomatsakis (May 30 2018 at 08:58, on Zulip):

But as a kind of side-effect we wind up permitting stuff like this, or at least we could if we are not careful:

fn foo(mut p: &'static u32) {
    let y = 22;
    p = &y; // old value, and hence old regions, of `p` are not important
}
nikomatsakis (May 30 2018 at 08:58, on Zulip):

I've been meaning to write up a blog post trying to dive into this specific point and see if we can draw a better line about which to support and which not.

lqd (May 30 2018 at 11:01, on Zulip):

alright I was looking at the "-Z polonius" failures we saw earlier, and yeah for sure the Opt variant has slight differences from the Naive one

Jake Goulding (May 30 2018 at 11:14, on Zulip):

does it surprise you that this would work? (This works today)

I don't feel like I am surprised by that, but it may just be because I'm used to current Rust. I think my mental model is that all the uses are scanned up-front and then a single lifetime is assigned. In that example, the type of foo would be Option<&'string2 String>. string1 can be shortened to fit that, and the implicit 'static of the None can be as well.

lqd (May 30 2018 at 11:17, on Zulip):

@nikomatsakis would it be interesting to have this, or some of these failures, in the polonius repo, and if so, under which form ? add the facts files in "inputs" (but without enabling them in the tests!macro), or replicate those facts in the frontend, or something else ?

Jake Goulding (May 30 2018 at 11:19, on Zulip):
fn foo(mut p: &'static u32) {
    let y = 22;
    p = &y; // old value, and hence old regions, of `p` are not important
}

What I dislike about this is that it's really obvious that the "type" of p changes through assignment. It also kind of goes against the idea I have that user-specified lifetime annotations should be "important" (https://github.com/rust-lang/rust/issues/47184) I also understand a bit better why that issues exists to start with.

Jake Goulding (May 30 2018 at 11:20, on Zulip):

On the flip side, I can see why writing this code is super useful

nikomatsakis (May 30 2018 at 12:33, on Zulip):

@Jake Goulding well, they would be "imported", but only at the point of the first assignment (in this case, that is at the point where fn is called). But I don't disagree.

nikomatsakis (May 30 2018 at 12:34, on Zulip):

@lqd probably — now that integration has landed, we should do a bit of investigation (first and foremost) into the failing tests

lqd (May 30 2018 at 12:35, on Zulip):

yeah that was was I doing during lunch break, investigating where naive/opt start differing in the ui test issue-31567.rs

nikomatsakis (May 30 2018 at 12:35, on Zulip):

I suspect we can restore more intuitive behavior by tweaking the definition of region_live_at — for example, the regions in a variable might be live everywhere that a variable is in scope. But I don't want to do any of that until we hvae a good test suite to judge the effects.

nikomatsakis (May 30 2018 at 12:35, on Zulip):

@lqd do they, in fact, differ?

lqd (May 30 2018 at 12:35, on Zulip):

absolutely

nikomatsakis (May 30 2018 at 12:35, on Zulip):

also, do we have the ability to set the algorithm with rustc?

nikomatsakis (May 30 2018 at 12:35, on Zulip):

(via env var)

nikomatsakis (May 30 2018 at 12:36, on Zulip):

I had talked about adding that, not sure if it got done

nikomatsakis (May 30 2018 at 12:36, on Zulip):

absolutely

interesting

nikomatsakis (May 30 2018 at 12:36, on Zulip):

/me has to divide how to parcel up his day today

lqd (May 30 2018 at 12:37, on Zulip):

of course, that's why I was investigating this on my own first, so that you don't need to look at it yet :)

lqd (May 30 2018 at 12:38, on Zulip):

(there are a couple PRs in flight, but I feel I've seen a PR from @Vytautas Astrauskas related to an env var to select the algorithm, but maybe was it just about polonius)

Jake Goulding (May 30 2018 at 13:22, on Zulip):

@nikomatsakis this doesn't work, which seems inconsistent:

struct W<'a>(&'a u32);

fn foo(mut p: W<'static>) {
    let y = 22;
    p.0 = &y;
}
Vytautas Astrauskas (May 30 2018 at 13:28, on Zulip):

(there are a couple PRs in flight, but I feel I've seen a PR from @Vytautas Astrauskas related to an env var to select the algorithm, but maybe was it just about polonius)

Rustc has DatafrogOpt hard coded. We could change it to something like:

let algorithm: Algorithm = env::var("POLONIUS_ALGORITHM").unwrap_or("DatafrogOpt").into();

However, for that we need a new version of polonius-engine to be released and it probably would make sense to land first all PRs that are currently in flight.

nikomatsakis (May 30 2018 at 13:36, on Zulip):

@Jake Goulding indeed, we draw a distinction between "overwriting the variable" (p = ...) and updating part of it (p.0 = ...)

Jake Goulding (May 30 2018 at 13:38, on Zulip):

Hm. I'll have to file that away for a future SO answer.

nikomatsakis (May 30 2018 at 13:38, on Zulip):

well, that depends on the rules we ultimately settle on, I suppose :)

davidtwco (May 31 2018 at 17:52, on Zulip):

What's the best issue for me to pick up and start on?

nikomatsakis (May 31 2018 at 18:03, on Zulip):

good question...

nikomatsakis (May 31 2018 at 18:03, on Zulip):

I think diagnostics + perf are still the order of the day

nikomatsakis (May 31 2018 at 18:04, on Zulip):

I'm not sure within that, maybe @pnkfelix has some suggestions

nikomatsakis (May 31 2018 at 18:04, on Zulip):

I was hoping to do some more perf profiling and try to generate some leads

pnkfelix (May 31 2018 at 18:10, on Zulip):

I have a new table at the bottom of https://paper.dropbox.com/doc/NLL-stderr-diagnostic-deviations-KzroSvNgQ7lip3WQyiLTa

pnkfelix (May 31 2018 at 18:10, on Zulip):

that lists all the diagnostic issues on that page that have a github issue

pnkfelix (May 31 2018 at 18:11, on Zulip):

as well as meta data: how many tests are affected by it? is there a PR to address it? and (just added) who is/was looking into it?

pnkfelix (May 31 2018 at 18:12, on Zulip):

my strategy for resolving these issues

pnkfelix (May 31 2018 at 18:12, on Zulip):

has been to reverse engineer how the AST borrowck generates its notes/suggestions

pnkfelix (May 31 2018 at 18:12, on Zulip):

and then try to add something approximating that to MIR-borrowck. :)

nikomatsakis (May 31 2018 at 18:27, on Zulip):

@pnkfelix do you have any suggestions for @David Wood ?

nikomatsakis (May 31 2018 at 18:27, on Zulip):

is there an "untaken" issue ?

pnkfelix (May 31 2018 at 18:27, on Zulip):

most are untaken AFAIK

pnkfelix (May 31 2018 at 18:27, on Zulip):

I added a column to try to track that

pnkfelix (May 31 2018 at 18:27, on Zulip):

but the best thing

pnkfelix (May 31 2018 at 18:27, on Zulip):

...

pnkfelix (May 31 2018 at 18:27, on Zulip):

might be for me to first skim through

pnkfelix (May 31 2018 at 18:28, on Zulip):

to make some guess as to which ones are good starter issues, maybe

davidtwco (May 31 2018 at 18:29, on Zulip):

Sounds good.

pnkfelix (May 31 2018 at 18:39, on Zulip):

hey actually @David Wood , I reopened https://github.com/rust-lang/rust/issues/46983

pnkfelix (May 31 2018 at 18:40, on Zulip):

@David Wood so that might be a great place to start, since you're already familiar with it

davidtwco (May 31 2018 at 18:40, on Zulip):

Oh yeah, forgot I saw that email, will look into that.

Jake Goulding (Jun 03 2018 at 15:31, on Zulip):

boooring. where's all the hard work everyone else is doing for me to watch. :innocent:

pnkfelix (Jun 03 2018 at 18:34, on Zulip):

clearly we each need to make a Twitch channel

Jake Goulding (Jun 03 2018 at 21:34, on Zulip):

I'd be down for a "Twitch codes the borrow checker" stream. Especially to watch the competing masses construct complex code

Keith Yeung (Jun 03 2018 at 21:49, on Zulip):

there was a twitch stream of coding rust in ruby using helix over the weekend

Santiago Pastorino (Jun 05 2018 at 20:29, on Zulip):

is there somebody else on Linux getting cannot allocate memory errors when compiling rustc?

Santiago Pastorino (Jun 05 2018 at 20:29, on Zulip):
error: could not exec the linker `cc`
  |
  = note: Cannot allocate memory (os error 12)
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc0-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc1-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc10-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc11-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc12-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc13-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc14-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc15-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc2-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc3-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc4-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc5-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc6-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc7-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc8-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.rustc9-b84aba51d8fa261656fb8626e42ec5b7.rs.rcgu.o" "-o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-e895ca9e7240a850.so" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.crate.metadata.rcgu.o" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/rustc-e895ca9e7240a850.crate.allocator.rcgu.o" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-nodefaultlibs" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps" "-L" "/usr/lib" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/backtrace-sys-e9110a0f73074a74/out" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/build/miniz-sys-a6962d6eb47c5537/out" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "test-818ff740b2707f00" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "term-b839a5796ea44350" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libflate2-c17c83ac42687712.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libminiz_sys-9d2624e9eb4a622b.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libbacktrace-a35747a5a8069ba9.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libbacktrace_sys-1322fd8632ba970e.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/librustc_demangle-b3681afb8e962366.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/librustc_apfloat-80c82ead1538fe96.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libchalk_engine-58cfea5e91374964.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libchalk_macros-aad115bd8a7dd7b8.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/liblazy_static-51c2a57e338b5928.rlib" "-Wl,--no-whole-archive" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-Wl,-Bdynamic" "-l" "proc_macro-bfb43a03f28a1a2b" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libjobserver-0f76c961320be96e.rlib" "-Wl,--no-whole-archive" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-Wl,-Bdynamic" "-l" "syntax-d3b388d855044135" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_errors-a62036a28f5fe0d1" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "syntax_pos-2a0bc4bd5ca0d03f" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_target-14ad2d7f44b20bbc" "-Wl,-Bstatic" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libpolonius_engine-73a5ff10d0da308d.rlib" "-Wl,--no-whole-archive" "-Wl,--whole-archive" "/tmp/rustc.vzQhQqLNNJtM/libdatafrog-6bd5fdf8a4c09e7e.rlib" "-Wl,--no-whole-archive" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-Wl,-Bdynamic" "-l" "graphviz-c0b3d3295583df0b" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "fmt_macros-05d9a5117f1b8b6a" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "arena-268a49b49dfb8f2f" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_data_structures-d03d75bec68473fe" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "rustc_cratesio_shim-e967eee6857a2363" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-l" "serialize-b1c71ab5580e556c" "-Wl,--start-group" "-L" "/home/santiago/src/oss/rust-perf/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-l" "std-267ac0a0e10e341c" "-Wl,--end-group" "-Wl,-Bstatic" "/tmp/rustc.vzQhQqLNNJtM/libcompiler_builtins-371c588c1a3805de.rlib" "-Wl,-Bdynamic" "-l" "unwind" "-l" "util" "-l" "util" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util" "-shared" "-Wl,-rpath,$ORIGIN/../lib"

error: aborting due to previous error

error: Could not compile `rustc`.
Santiago Pastorino (Jun 05 2018 at 20:30, on Zulip):

it's happening me following https://gist.github.com/nikomatsakis/45e81ac4cfcf21c665176e3e2907f40e

Santiago Pastorino (Jun 05 2018 at 20:30, on Zulip):

8GB of RAM here

Santiago Pastorino (Jun 05 2018 at 20:30, on Zulip):

:P

Reed Koser (Jun 13 2018 at 21:31, on Zulip):

At this point, people should probably consider anything assigned to me "soft unassigned." I'll be around on Zulip and IRC to answer questions, but realistically I only have about an hour a day to work on side projects and that's just not enough time to really get in the zone with rustc code. I'll have more time after mid-August or so to dive back in though =D

Jake Goulding (Jun 15 2018 at 13:56, on Zulip):

help: consider changing this to be a mutable reference: &mut elf

Any idea why this message is elf?

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

I wanted to let you know that we (Uruguay) won against Egypt :smile:

Jake Goulding (Jun 15 2018 at 15:23, on Zulip):

Here's the repro:

#![feature(nll, arbitrary_self_types)]

use std::rc::Rc;

struct Combine(u8);

impl Combine {
    fn poll(self: Rc<Self>) {
        drop(self);
        self.0 = 42;
    }
}

fn main() {}
Jake Goulding (Jun 15 2018 at 15:24, on Zulip):

I wanted to let you know that we (Uruguay) won against Egypt :smile:

🇺🇾

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

:smile:

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

here football is more than a passion

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

there's no people in the street in matches like this

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

everyone is watching the match

lqd (Jun 15 2018 at 15:26, on Zulip):

haha a goal at the last minute :D

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

:heart: is the best way to win :smile:

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

@lqd where are you from?

lqd (Jun 15 2018 at 16:07, on Zulip):

@Santiago Pastorino France

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

good luck!, France is a great team

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

we like Antoine a lot, he is a bit uruguayan :smile:

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

if you're really into football you probably know why :)

lqd (Jun 15 2018 at 16:09, on Zulip):

:D good luck to you / Uruguay as well :)

Jake Goulding (Jun 15 2018 at 17:04, on Zulip):

I filed https://github.com/rust-lang/rust/issues/51578 for my elves

csmoe (Jun 16 2018 at 15:59, on Zulip):

how can I generate the inputs for a crate?

csmoe (Jun 16 2018 at 16:00, on Zulip):

the doc just shows the way for single rs code

lqd (Jun 17 2018 at 06:37, on Zulip):

you can also pass the flags to cargo rustc

lqd (Jun 17 2018 at 06:59, on Zulip):

I will make a PR to add that to the readme

lqd (Jun 17 2018 at 07:13, on Zulip):

https://github.com/rust-lang-nursery/polonius/pull/71

csmoe (Jun 17 2018 at 07:30, on Zulip):

@lqd thank you :)

lqd (Jun 17 2018 at 08:59, on Zulip):

np

pnkfelix (Jun 18 2018 at 01:44, on Zulip):

@Jake Goulding the “elf” thing is probably due to a royal mess of a hack in check_access_permissions which PR 51275 does a big rewrite of

pnkfelix (Jun 18 2018 at 01:44, on Zulip):

I will need to look into how that PR handles your test case

Jake Goulding (Jun 18 2018 at 01:45, on Zulip):

@pnkfelix cool. Then you get a free bug to close :-)

Jake Goulding (Jun 18 2018 at 01:46, on Zulip):

Which is now at 18x :laughing:

pnkfelix (Jun 18 2018 at 01:47, on Zulip):

But it’s code that looks like this:

pnkfelix (Jun 18 2018 at 01:47, on Zulip):

if let Ok(src) =
self.tcx.sess.codemap().span_to_snippet(sp) {
to_suggest_span = src[1..].to_string();
};

pnkfelix (Jun 18 2018 at 01:48, on Zulip):

Because it assumed the first character was a ‘&’ that it was chopping off

pnkfelix (Jun 18 2018 at 01:49, on Zulip):

I actually ended deciding to keep a similar strategy, rather than trying to reconstruct the type as the user wrote it. But I should probably check or at least assert that the first character actually is a ‘&’

csmoe (Jun 18 2018 at 01:54, on Zulip):

@pnkfelix the span can be more specific to self instead of split the string from raw span_str

Jake Goulding (Jun 18 2018 at 02:10, on Zulip):

to_suggest_span = src[1..].to_string();

I kind of figured it was something like that, but darned if I knew where to find it.

Jake Goulding (Jun 22 2018 at 03:02, on Zulip):

For those us of playing along at home, what is "mois"?

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

collection of MoveOutIndex :simple_smile:

Jake Goulding (Jun 22 2018 at 19:39, on Zulip):

I was wrong. My guess was "method of interest"

Jake Goulding (Jun 25 2018 at 02:52, on Zulip):

Thought experiment: does the MIR-based borrowck remove the need for (mutable?) reborrowing?

Jake Goulding (Jun 25 2018 at 16:44, on Zulip):

There are now 24 questions linked to/from What are non-lexical lifetimes?, which is a rough count of "solved by NLL" questions that I've touched in the last ~1.5 month

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

Thought experiment: does the MIR-based borrowck remove the need for (mutable?) reborrowing?

I do not believe so. =) I mean when you do let bar: &mut X; foo(bar), you still don't want to move bar -- that requires reborrowing

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

put another way, reborrowing occurs before MIR borrowck enters the picture (during MIR lowering)

Jake Goulding (Jun 25 2018 at 18:48, on Zulip):

Yeah, that makes sense. Are there some cases where reborrowing is used to "trick" the borrow checker?

Jake Goulding (Jun 25 2018 at 18:50, on Zulip):

The context was https://stackoverflow.com/q/51015503/155423 / https://stackoverflow.com/q/45095523/155423, but I don't know why the OP actually needed the code in question

lqd (Jun 26 2018 at 18:07, on Zulip):

do we already track this NLL ICE ? https://github.com/rust-lang/rust/issues/51348#issuecomment-400398622

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

I'm not really aware of it

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

one thing I wanted to do was to start paying more attention to ICEs and soundness bugs

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

though I feel like performance + diagnostics are not quite there yet

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

but I'm worried about neglecting those categories too much :)

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

agreed :) also why it's indeed a good idea to check bootstrapping + crater soon

lqd (Jun 26 2018 at 18:36, on Zulip):

"are _not quite_ there yet" you mean ?

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

yes :)

lqd (Jun 26 2018 at 18:36, on Zulip):

:)

lqd (Jun 26 2018 at 18:45, on Zulip):

nice, with the new issues, it looks like we can make some more performance progress soon as well

lqd (Jun 26 2018 at 19:05, on Zulip):

@nikomatsakis re: https://github.com/rust-lang/rust/issues/51377#issuecomment-400420054 you mean we might need to reprofile again right ? (as #51411 has already landed)

Jake Goulding (Jun 28 2018 at 03:27, on Zulip):

Before

enum LastOrNot<'a> {
    Last(&'a mut Node),
    NotLast(&'a mut Node),
}

impl Node {
    fn get_last_or_self(&mut self) -> LastOrNot {
        match self.children.is_empty() {
            false => LastOrNot::Last(self.children.last_mut().unwrap()),
            true => LastOrNot::NotLast(self),
        }
    }
}

fn get_last(mut current: &mut Node) -> &mut Node {
    loop {
        match { current }.get_last_or_self() {
            LastOrNot::Last(child) => current = child,
            LastOrNot::NotLast(end) => return end,
        }
    }
}

after

impl Node {
    fn get_last(&mut self) -> Option<&mut Node> {
        self.children.last_mut()
    }
}

fn get_last(mut current: &mut Node) -> &mut Node {
    while let Some(child) = current.get_last() {
        current = child;
    }
    current
}
Jake Goulding (Jun 29 2018 at 03:59, on Zulip):

NLL + Polonius win.

### Before

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

@Jake Goulding ?

Jake Goulding (Jun 29 2018 at 14:33, on Zulip):

howdy @nikomatsakis

Amusingly, I was awake at 5:!5 AM my time, but not near a computer :-)

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

I was confused because you wrote this:

NLL + Polonius win.

### Before
nikomatsakis (Jun 29 2018 at 14:33, on Zulip):

but maybe it was just a mistake :)

Jake Goulding (Jun 29 2018 at 14:36, on Zulip):

Huh. It was a mistake, but I sent https://rust-lang.zulipchat.com/#narrow/stream/122657-wg-nll/subject/general.20discussion/near/128809452 before I sent https://rust-lang.zulipchat.com/#narrow/stream/122657-wg-nll/subject/general.20discussion/near/128752230

Jake Goulding (Jul 03 2018 at 21:08, on Zulip):

I thought that using #![feature(kjhadkjdjk)] reported an error...

simulacrum (Jul 03 2018 at 21:12, on Zulip):

It should

Jake Goulding (Jul 03 2018 at 21:14, on Zulip):

@simulacrum https://play.integer32.com/?gist=f903649f836e2b4dc3c0cf2e06dce93f&version=nightly&mode=debug&edition=2015

Jake Goulding (Jul 03 2018 at 21:14, on Zulip):

Am I doing a dumb-o somewhere?

simulacrum (Jul 03 2018 at 21:15, on Zulip):

Looks like a bug to me -- I'll go run a bisection

nikomatsakis (Jul 03 2018 at 21:15, on Zulip):

I think it's kinda' been that way for a while

nikomatsakis (Jul 03 2018 at 21:15, on Zulip):

I feel like I noticed this a while back but thought "oh I must have remembered wrong"

nikomatsakis (Jul 03 2018 at 21:15, on Zulip):

I could be mistaken though

Jake Goulding (Jul 03 2018 at 21:24, on Zulip):

I was worried that I wasn't actually invoking NLL when trying to reduce that testcase, so I threw in some junk

simulacrum (Jul 03 2018 at 21:25, on Zulip):

2017-08-11 prints a warning (unused or unknown feature)

simulacrum (Jul 03 2018 at 21:28, on Zulip):

2016-11-21 highlighted the feature name, not just the underline...

simulacrum (Jul 03 2018 at 21:30, on Zulip):

@Jake Goulding Yeah, looks like this has ~never been a thing

simulacrum (Jul 03 2018 at 21:30, on Zulip):

I must have remembered wrong

Jake Goulding (Jul 03 2018 at 21:31, on Zulip):

@simulacrum what happened to the warning tho?

simulacrum (Jul 03 2018 at 21:31, on Zulip):

hm, I did not attempt to bisect when it disappeared, let me do that

Jake Goulding (Jul 03 2018 at 21:33, on Zulip):

I mean, I could see non-error as a case, sure, maybe....

simulacrum (Jul 03 2018 at 21:41, on Zulip):

bisection claims 2017-09-09 is the first nightly that regressed, but I'm still trying to narrow down a specific commit

simulacrum (Jul 03 2018 at 21:43, on Zulip):

@Jake Goulding I suspect https://github.com/rust-lang/rust/pull/44142 (the commit range if I'm reading it right is d93036a04 to dead08cb3).

Jake Goulding (Jul 04 2018 at 01:58, on Zulip):

@simulacrum shall I file an issue?

simulacrum (Jul 04 2018 at 02:02, on Zulip):

@Jake Goulding Probably, yeah, though not urgent of course

Jake Goulding (Jul 04 2018 at 02:04, on Zulip):

Didn't we just tell everyone to go add rust2018-preview feature all over the place? :-)

simulacrum (Jul 04 2018 at 02:24, on Zulip):

@Jake Goulding Sure, but technically they'll presumably notice if they get it wrong because things won't work

simulacrum (Jul 04 2018 at 02:25, on Zulip):

This is more urgent because of that, though, yeah

davidtwco (Jul 05 2018 at 17:27, on Zulip):

@nikomatsakis What's the best issue for me to take on next?

nikomatsakis (Jul 05 2018 at 17:31, on Zulip):

@David Wood I'm skimming the list

nikomatsakis (Jul 05 2018 at 17:31, on Zulip):

are you interested in doing some of the region follow-up?

nikomatsakis (Jul 05 2018 at 17:32, on Zulip):

specifically, trying to improve the "naming" of regions and stuff like we talked about here?

nikomatsakis (Jul 05 2018 at 17:32, on Zulip):

I was hoping to open some issues with mild mentoring instructions in that area

davidtwco (Jul 05 2018 at 17:33, on Zulip):

Yeah, that sounds good.

DPC (Jul 05 2018 at 17:33, on Zulip):

hi @nikomatsakis

nikomatsakis (Jul 05 2018 at 17:33, on Zulip):

Hi @DPC =)

nikomatsakis (Jul 05 2018 at 17:34, on Zulip):

@David Wood are you ready to hack now or would it be later today?

davidtwco (Jul 05 2018 at 17:34, on Zulip):

I can go now.

nikomatsakis (Jul 05 2018 at 17:34, on Zulip):

let's make a topic for that I guess

nikomatsakis (Jul 05 2018 at 17:35, on Zulip):

@DPC (how goes?)

DPC (Jul 05 2018 at 17:36, on Zulip):

starting on the issue rn and i'm kinda lost after going through it earlier today :wink:

nikomatsakis (Jul 05 2018 at 17:37, on Zulip):

cool, let me start a topic jsut for that to help keep the messages straight

DPC (Jul 05 2018 at 17:38, on Zulip):

sure

Santiago Pastorino (Jul 06 2018 at 13:47, on Zulip):

@lqd good luck :fr:

lqd (Jul 06 2018 at 13:48, on Zulip):

@Santiago Pastorino haha good luck to you as well :)

Santiago Pastorino (Jul 06 2018 at 13:48, on Zulip):

:)

Santiago Pastorino (Jul 06 2018 at 13:49, on Zulip):

I'm extremely nervous :P

lqd (Jul 06 2018 at 13:49, on Zulip):

because of Cavani ?

Santiago Pastorino (Jul 06 2018 at 13:49, on Zulip):

no no, because of the match in general

lqd (Jul 06 2018 at 13:49, on Zulip):

:)

lqd (Jul 06 2018 at 13:50, on Zulip):

feels like it will be tough in general for both sides :)

DPC (Jul 06 2018 at 13:50, on Zulip):

yeah. but without Cavani, Uruguay will find it tough

Santiago Pastorino (Jul 06 2018 at 13:50, on Zulip):

I'm not sure how people in France live this kind of matches, but here is complete craziness

Santiago Pastorino (Jul 06 2018 at 13:50, on Zulip):

people don't work

Santiago Pastorino (Jul 06 2018 at 13:50, on Zulip):

offices close

Santiago Pastorino (Jul 06 2018 at 13:50, on Zulip):

etc, etc

DPC (Jul 06 2018 at 13:51, on Zulip):

that's crazy

Santiago Pastorino (Jul 06 2018 at 13:51, on Zulip):

yeah. but without Cavani, Uruguay will find it tough

yes, without Cavani is harder

Santiago Pastorino (Jul 06 2018 at 13:51, on Zulip):

that's crazy

football in south america is a hard to understand passion

lqd (Jul 06 2018 at 13:51, on Zulip):

offices don't close per se, but a lot of people watch the game instead of working

Santiago Pastorino (Jul 06 2018 at 13:51, on Zulip):

@DPC where are you from?

DPC (Jul 06 2018 at 13:51, on Zulip):

India

lqd (Jul 06 2018 at 13:52, on Zulip):

but yeah, at 1/4 finals people are getting passionate

Santiago Pastorino (Jul 06 2018 at 13:52, on Zulip):

yeah

Santiago Pastorino (Jul 06 2018 at 13:53, on Zulip):

here there's no man that haven't played football at some point of his life

Santiago Pastorino (Jul 06 2018 at 13:53, on Zulip):

and woman are starting more and more to play also

Santiago Pastorino (Jul 06 2018 at 13:53, on Zulip):

that's why such a small country more or less does well in the sport :)

Santiago Pastorino (Jul 06 2018 at 13:53, on Zulip):

3 million people lives here

Santiago Pastorino (Jul 06 2018 at 13:54, on Zulip):

and we have won 2 world cups and 15 south american cups (even more than Brazil and Argentina)

DPC (Jul 06 2018 at 13:54, on Zulip):

the city where I work has a bigger population than that

Santiago Pastorino (Jul 06 2018 at 13:55, on Zulip):

yes :)

lqd (Jul 06 2018 at 13:55, on Zulip):

and 2 olympics which technically count as 2 world cups ;)

Santiago Pastorino (Jul 06 2018 at 13:55, on Zulip):

yes

Santiago Pastorino (Jul 06 2018 at 13:55, on Zulip):

https://en.wikipedia.org/wiki/Copa_Am%C3%A9rica#Performance_by_country

Santiago Pastorino (Jul 06 2018 at 13:55, on Zulip):

we have won 15 and Brazil only 8 ;)

Santiago Pastorino (Jul 06 2018 at 13:56, on Zulip):

anyway, best of luck to you

Santiago Pastorino (Jul 06 2018 at 13:56, on Zulip):

leaving this because the game is starting

lqd (Jul 06 2018 at 13:56, on Zulip):

:)

lqd (Jul 06 2018 at 13:56, on Zulip):

same here, everyone is stopping work lol

Santiago Pastorino (Jul 06 2018 at 16:06, on Zulip):

@lqd congrats again, France played fantastic and Uruguay a bit bad :(

lqd (Jul 06 2018 at 16:11, on Zulip):

@Santiago Pastorino you too, Cavani missing was very unfortunate :/ Uruguay deserved better, as they were very very good

Santiago Pastorino (Jul 06 2018 at 16:12, on Zulip):

I think we would have lost with Cavani and also with a bit of better luck

Santiago Pastorino (Jul 06 2018 at 16:12, on Zulip):

I think France would have won anyway, but still here we are sad that in all the world cups we always miss the best player for key matches

lqd (Jul 06 2018 at 16:13, on Zulip):

definitely bad luck :/

Santiago Pastorino (Jul 06 2018 at 16:13, on Zulip):

I wanted to lose with all the team, that's the sad part but ... :/

lqd (Jul 06 2018 at 16:13, on Zulip):

I will be supporting Uruguay in the future now that I know you :D

Santiago Pastorino (Jul 06 2018 at 16:16, on Zulip):

:D :heart:

DPC (Jul 06 2018 at 17:15, on Zulip):

congrats @lqd

lqd (Jul 06 2018 at 17:15, on Zulip):

:)

Jake Goulding (Jul 09 2018 at 20:30, on Zulip):

I really hope y'all pull off a miracle and get Polonius as part of Rust 2018

lqd (Jul 09 2018 at 20:32, on Zulip):

why in particular ? (it seems very unlikely right?)

Jake Goulding (Jul 09 2018 at 20:35, on Zulip):

I don't have as good of a sense of likely/unlikely as you do, but the reason is that I don't know that "the public" is going to care about the fine grained distinction that we know of.

Jake Goulding (Jul 09 2018 at 20:35, on Zulip):

I sense that NLL is thought of as "the thing that will make the borrow checker not reject valid programs"

lqd (Jul 09 2018 at 20:36, on Zulip):

oh, and Polonius would match that goal better presumably

Jake Goulding (Jul 09 2018 at 20:37, on Zulip):

Right, because of NLL case #3, conditionals

lqd (Jul 09 2018 at 20:38, on Zulip):

maybe explaining it as a series of steps towards that goal of accepting more and more versions of "all" valid programs ?

Jake Goulding (Jul 09 2018 at 20:40, on Zulip):

Perhaps, but it's tied up with this idea of the edition. What's "the point" of the edition if it only halfway implements NLL? ( I mean, I know there's a point, but for argument's sake )

Jake Goulding (Jul 09 2018 at 20:41, on Zulip):

I also heard that async / await may not ship with the edition, just the keyword reservations. That seems likewise unfortunate.

Jake Goulding (Jul 09 2018 at 20:41, on Zulip):

That's hearsay and gossip ^ so it could easily be wrong.

lqd (Jul 09 2018 at 20:42, on Zulip):

yeah, even though (and I could be wrong) I feel like the transition from AST borrowck to NLL is bigger than NLL to NLL 2.0/Polonius

lqd (Jul 09 2018 at 20:45, on Zulip):

@Jake Goulding since you have a lot of experience with real world code and SO questions, do you think NLLs without Polonius would still be a "gamechanger" for the cases you encountered ?

Jake Goulding (Jul 09 2018 at 20:46, on Zulip):

These are the questions I've linked to the "what is NLL" question - https://stackoverflow.com/questions/linked/50251487?lq=1

Jake Goulding (Jul 09 2018 at 20:46, on Zulip):

I think many of them will be improved with current NLL

Jake Goulding (Jul 09 2018 at 20:47, on Zulip):

But just a few minutes ago I had to say "that's not the real NLL" (referring to today's implementation)

lqd (Jul 09 2018 at 20:47, on Zulip):

what was the code in question ?

Jake Goulding (Jul 09 2018 at 20:49, on Zulip):

https://play.rust-lang.org/?gist=bee131949c07b68cbae7f0ba67fc4cf6&version=nightly&mode=debug&edition=2015

lqd (Jul 09 2018 at 20:49, on Zulip):

dayum

lqd (Jul 09 2018 at 20:51, on Zulip):

:/

Jake Goulding (Jul 09 2018 at 20:51, on Zulip):

There's also the more complicated https://stackoverflow.com/questions/50519147/double-mutable-borrow-error-in-a-loop-happens-even-with-nll-on

lqd (Jul 09 2018 at 20:55, on Zulip):

I liked your good news / bad news here

lqd (Jul 09 2018 at 20:57, on Zulip):

I think the edition cutoff is like in a month and a half (and a bit)

Jake Goulding (Jul 09 2018 at 21:06, on Zulip):

Yeah, I try to give some hope to people when I tell them things they won't like :wink:

pnkfelix (Jul 10 2018 at 11:42, on Zulip):

@Jake Goulding one reason why its worth tying even a "halfway-done" version of NLL to the edition: NLL changes the semantics for how pattern variables work in match guards

pnkfelix (Jul 10 2018 at 11:44, on Zulip):

it does so in a way that is meant to fly under the (developer's) radar in most cases, and it is fixing a soundness bug, but it is a change to the semantics nonetheless (and not solely making more programs pass the borrow-checker)

Jake Goulding (Jul 10 2018 at 12:55, on Zulip):

@pnkfelix oh, I should strive to be more clear. I do think that it's good to have them tied together, I just wish it was NLL to the max

Jake Goulding (Jul 10 2018 at 12:56, on Zulip):

Really, it's more of a "I wish the edition could just be delayed a bit to fully deliver all these things together"

Santiago Pastorino (Jul 10 2018 at 19:12, on Zulip):

@pnkfelix are we having the meeting today?

pnkfelix (Jul 10 2018 at 19:13, on Zulip):

yes i am planning to do so

Santiago Pastorino (Jul 10 2018 at 19:13, on Zulip):

given that Niko is not around and France is playing semis, I see this ... ahh ok ok :)

pnkfelix (Jul 10 2018 at 19:13, on Zulip):

in 17 minutes, right?

Santiago Pastorino (Jul 10 2018 at 19:13, on Zulip):

yes

pnkfelix (Jul 10 2018 at 19:13, on Zulip):

i'm not watching the game, though I am definitely hearing the results as they happen

Santiago Pastorino (Jul 10 2018 at 19:14, on Zulip):

:+1:

lqd (Jul 10 2018 at 19:14, on Zulip):

1-0 :fr: ;) I'll be watching the game during the meeting :p (but participating ofc)

lqd (Jul 10 2018 at 19:15, on Zulip):

btw I've added my status update to the Paper

Santiago Pastorino (Jul 10 2018 at 19:16, on Zulip):

my bet was :fr: 2 belgium 1

lqd (Jul 10 2018 at 19:17, on Zulip):

if we do such a thing as nominated issues there's an ICE in the just released 1.27.1 https://github.com/rust-lang/rust/issues/52213

Niel (Jul 10 2018 at 19:23, on Zulip):

Really, it's more of a "I wish the edition could just be delayed a bit to fully deliver all these things together"

My understanding of editions is that if the feature gets added after the 'edition' ships, and all the documentation is updated to reflect the change, then it will be like the feature shipped with the edition? Or will NLL 2.0 change things to have to wait until the next edition?

pnkfelix (Jul 10 2018 at 19:27, on Zulip):

@Niel my interpretation of @Jake Goulding 's remarks is that they were more about getting the best initial marketing/word-of-mouth for the initial deployment of NLL. (perhaps thinking that People may not care to stick around to see if NLL 2.0 is ever successfully deployed?)

Jake Goulding (Jul 10 2018 at 19:29, on Zulip):

Yep, mostly around the marketing aspect of it. Right now, we could just ship the edition with the keyword reservations and then deliver all the new functionality every 6 weeks, as usual.

pnkfelix (Jul 10 2018 at 19:30, on Zulip):

@lqd I'm not sure that's an NLL regression... or rather ... did you link to the bug you meant to? That's not describing an ICE, but rather than outright soundness bug?

Niel (Jul 10 2018 at 19:31, on Zulip):

Hmmm, my understanding of marketing is that it takes several months to filter through the ranks. Any semantics/keywords should be in place for NLL 2.0 though.

lqd (Jul 10 2018 at 19:31, on Zulip):

@pnkfelix I guess yeah, it's about AST borrowck and match default bindings, I was thinking maybe you would know your way around this in niko's absence

lqd (Jul 10 2018 at 19:32, on Zulip):

err wait not an ICE a segfault true

pnkfelix (Jul 10 2018 at 19:33, on Zulip):

(and also a segfault that is only exposed by AST borrowck if I read that correctly. Its something the compiler team needs to fix, perhaps I need to fix, but its not necessarily something that needs this groups' eyeballs)

lqd (Jul 10 2018 at 19:34, on Zulip):

sure, I mostly wanted to bring your attention to it as people pinged you on discord and we were about to have the meeting :)

lqd (Jul 11 2018 at 18:03, on Zulip):

to reset my mind from the triaging, I've made another couple of tiny polonius/:frog: PRs :)

Niel (Jul 11 2018 at 18:51, on Zulip):

@lqd What's triaging? I've looked through the HackMD page, but can't seem to determine what exactly the purpose of the document is?

lqd (Jul 11 2018 at 18:55, on Zulip):

in this case it's looking at the crater run results, to decide if the errors they contain are a problem in the MIR borrowck or in the crate being tested, or if the diagnostics need work, and so on. The hackmd pages list some of these errors, with sometimes, explanations I've done, minimization of problems, or links to already known issues if the problems are indeed already filed

Niel (Jul 11 2018 at 18:57, on Zulip):

Interesting, sounds like repetitive work. Also perhaps a good starting point for a rustacean-shrimp?

lqd (Jul 11 2018 at 18:58, on Zulip):

possibly yeah, depending on the cases, sometimes it's easy to minimize

Niel (Jul 11 2018 at 19:00, on Zulip):

Oki. Show me tomorrow?

lqd (Jul 11 2018 at 19:03, on Zulip):

feel free to ask questions :) (but I'll be at work and not extremely available)

lqd (Jul 11 2018 at 19:06, on Zulip):

(that way I can answer async)

Niel (Jul 11 2018 at 19:08, on Zulip):

:thumbs_up:

DPC (Jul 11 2018 at 19:15, on Zulip):

let me know if you need a hand :hand: :)

lqd (Jul 11 2018 at 19:17, on Zulip):

oh but all help is very welcome for sure!

lqd (Jul 11 2018 at 19:18, on Zulip):

eg every crate in https://hackmd.io/2sR4vloZQhC8arJkFOFyLA?both which doesn't have a "->" with an explanation is one that can be triaged :)

lqd (Jul 12 2018 at 10:09, on Zulip):

I was being silly and with Frank's help I completed the LocationInsensitive leapfrog variant. If you combine with yesterday's PRs, on clap (a great case for us as it passes the location insensitive analysis), yesterday's best run (unstable sort, redundant indexing, no leapfrog) was 800ms to today's best of 125ms. (caveats about microbenchmarking, mistakes on my part, lack of testing, etc)

Jake Goulding (Jul 12 2018 at 13:18, on Zulip):

@lqd so it takes 15% of the time it used to? not bad!

lqd (Jul 12 2018 at 13:20, on Zulip):

@Jake Goulding hopefully it is also, you know, ... correct whistles

Jake Goulding (Jul 12 2018 at 13:34, on Zulip):

Ain't y'all get tests in there yet?

lqd (Jul 12 2018 at 13:38, on Zulip):

there are some, this variant has one test ;)

lqd (Jul 13 2018 at 14:35, on Zulip):

Today in Polonius™ - results on the clap benchmark: -20% in the datafrogopt variant, and -15% in leapfrog (caveat: don't forget that these "optimized" variants still have known bugs and probably unknown ones ;)

Jake Goulding (Jul 13 2018 at 17:53, on Zulip):

error[E0499]: cannot borrow *self as mutable more than once at a time
note: borrowed value must be valid for the lifetime 'a as defined on the impl at 8:1...

Jake Goulding (Jul 13 2018 at 17:53, on Zulip):

Why does that note belong with that error?

Matthew Jasper (Jul 15 2018 at 11:45, on Zulip):

Did this ever work with NLL/mir borrowck? I thought I've tried it before, but I can't find a past nightly where it did

fn foo(x: Box<&mut i32>) -> &mut i32 {
    *x
}
Matthew Jasper (Jul 15 2018 at 12:39, on Zulip):

It seems that https://github.com/rust-lang/rust/issues/45696 was closed, but the PR to fix it didn't actually fix it.

simulacrum (Jul 15 2018 at 16:56, on Zulip):

Reopened https://github.com/rust-lang/rust/issues/45696

pnkfelix (Jul 17 2018 at 12:38, on Zulip):

@Matthew Jasper BTW PR #52405 is an epic win

pnkfelix (Jul 17 2018 at 12:40, on Zulip):

the only nitpicky question I have is whether the test file mutability-errors.rs should be broken up into multiple files.

pnkfelix (Jul 17 2018 at 12:40, on Zulip):

but at this point I'm tempted to just r+ it as is.

pnkfelix (Jul 17 2018 at 12:44, on Zulip):

ah but it has merge conflicts anyway, so I'll go ahead and make my nitpicky comment

nikomatsakis (Jul 17 2018 at 12:55, on Zulip):

wow, I was just skimming the tests. very nice indeed @Matthew Jasper :tada:

lqd (Jul 18 2018 at 11:35, on Zulip):

@nikomatsakis easy r?s :) -- https://github.com/rust-lang-nursery/polonius/pull/72 https://github.com/rust-lang-nursery/datafrog/pull/9

lqd (Jul 18 2018 at 11:43, on Zulip):

thanks :heart:

lqd (Jul 18 2018 at 11:44, on Zulip):

(I'll space the others out during the next 10 years)

lqd (Jul 18 2018 at 11:47, on Zulip):

(as a summary of the many things in-flight, leapfrog + compressed cfg + etc clocks in at around 1.5s)

lqd (Jul 18 2018 at 12:15, on Zulip):

( for the live loans)

Jake Goulding (Jul 18 2018 at 13:51, on Zulip):

@lqd can you remind us what thats in comparison to?

lqd (Jul 18 2018 at 14:02, on Zulip):

suffering from a million branches, but from memory the naive (but correct) variant is at 30s; datafrogopt 5-6s

Jake Goulding (Jul 18 2018 at 21:09, on Zulip):

@Matthew Jasper informs me that

-Zpolonius is completely broken atm: it doesn't report any errors.

I'd selfishly like to ask that be "fixed" either by disabling the flag or reporting the errors ;-)

Jake Goulding (Jul 18 2018 at 21:09, on Zulip):

Because I've been using that to "prove" that some given piece of code will or won't work in the future

davidtwco (Jul 19 2018 at 20:35, on Zulip):

I used to pass --stage 1 --keep-stage 0 to make building faster, that stopped working a while ago, what's the equivalent now? - I miss building quickly.

nikomatsakis (Jul 19 2018 at 20:37, on Zulip):

I use ./x.py build --stage 1 -i --keep-stage 1 and it seems to work pretty well

nikomatsakis (Jul 19 2018 at 20:37, on Zulip):

I don't really understand what the argument to keep-stage represents though :)

nikomatsakis (Jul 19 2018 at 20:37, on Zulip):

@simulacrum would know

simulacrum (Jul 19 2018 at 20:37, on Zulip):

It's somewhat unclear to everyone :)

davidtwco (Jul 19 2018 at 20:38, on Zulip):

I thought it meant "don't bother rebuilding that, re-use it", so each time I'd just rebuild stage 1 (and then the --stage 1 was slightly redundant).

simulacrum (Jul 19 2018 at 20:38, on Zulip):

You probably want --keep-stage 0 without any --stage flag and then use stage2/bin/rustc

davidtwco (Jul 19 2018 at 20:40, on Zulip):

I assume with that it would be safe to ignore the "warning: using potentially old..." messages?

davidtwco (Jul 19 2018 at 20:41, on Zulip):

probably worth updating this part of the forge which still mentions the old flags, that's where I got them from initially.

simulacrum (Jul 19 2018 at 20:46, on Zulip):

It's generally safe to ignore yes, certainly for (most) NLL work

davidtwco (Jul 20 2018 at 12:02, on Zulip):

If I x.py build first without -keep-stage or --stage and then in subsequent builds use only -keep-stage 0 then it works as expected. It seems though that if I switch to using x.py check (still with --keep-stage 0) then any subsequent x.py builds with --keep-stage 0 will fail unless I do a full build without --keep-stage 0 again. Is that intended?

simulacrum (Jul 20 2018 at 12:56, on Zulip):

No -- I think eddyb also mentioned that. If you could file an issue with that description that'd be great

davidtwco (Jul 20 2018 at 12:59, on Zulip):

@simulacrum #52565

simulacrum (Jul 20 2018 at 13:00, on Zulip):

Thanks!

Matthew Jasper (Jul 21 2018 at 20:37, on Zulip):

Could someone r+ https://github.com/rust-lang/rust/pull/52359, please?

simulacrum (Jul 21 2018 at 20:41, on Zulip):

Done

csmoe (Jul 24 2018 at 13:16, on Zulip):

@nikomatsakis is there any plan to make the region concept transparent or more friendly to ordinary users in nll error message? lifetime is used in most error message, but some of them use region, and lifetime is more common in teaching Rust. for example:

  --> $DIR/return-wrong-bound-region.rs:21:23
   |
LL |     expect_sig(|a, b| b); // ought to return `a`
   |                 -  -  ^ free region requires that `'1` must outlive `'2`
   |                 |  |
   |                 |  lifetime `'1` appears in this argument
   |                 lifetime `'2` appears in this argument
nikomatsakis (Jul 24 2018 at 13:16, on Zulip):

I don't believe the "free region requires" is meant to be part of the message long term

nikomatsakis (Jul 24 2018 at 13:17, on Zulip):

I would prefer not to use the word lifetime, which I think is quite confusing for people

nikomatsakis (Jul 24 2018 at 13:17, on Zulip):

but I haven't found a good alternative...

nikomatsakis (Jul 24 2018 at 13:19, on Zulip):

in any case I would expect that message to say something like "returning b requires that '2 outlives '1"

davidtwco (Jul 24 2018 at 13:21, on Zulip):

@csmoe @nikomatsakis It says the following with #52648:

error: unsatisfied lifetime constraints
  --> $DIR/return-wrong-bound-region.rs:21:23
   |
LL |     expect_sig(|a, b| b); // ought to return `a`
   |                 -  -  ^ closure was supposed to return data with lifetime `'1` but it is returning data with lifetime `'2`
   |                 |  |
   |                 |  has type `&'1 i32`
   |                 | has type `&'2 i32`
Jake Goulding (Jul 24 2018 at 20:23, on Zulip):

I would prefer not to use the word lifetime, which I think is quite confusing for people

I brought this up on some RFC, but I think that abandoning "lifetime" 3 years after Rust 1.0 isn't something we should do, and definitely not something that should be done without an RFC. Getting rid of that word (even though I agree it wasn't the best choice) would undo many years of documentation and so on.

nikomatsakis (Jul 24 2018 at 20:29, on Zulip):

I don't disagree, though I do think that if we can find better ways to explain things, we should.

nikomatsakis (Jul 24 2018 at 20:29, on Zulip):

that is, I'm not proposing a kind of "hard" deprecation -- in fact, i'm not really proposed a deprecation at all, since most of our messages are using the word lifetime right now

nikomatsakis (Jul 24 2018 at 20:29, on Zulip):

but if we can find ways to express what we need that avoid the term, better still

nikomatsakis (Jul 24 2018 at 20:30, on Zulip):

that said I pretty commonly hear people getting confused about the lifetime of the underlying value and that of the reference itself

Jake Goulding (Jul 24 2018 at 20:32, on Zulip):

Absolutely. Lifetimes in Rust means "time at a specific memory address". Some people are accustomed to thinking of it as "time from construction to destruction"

Jake Goulding (Jul 24 2018 at 20:33, on Zulip):

Semi-related: I keep seeing '1 in the errors. What's that about?

Jake Goulding (Jul 24 2018 at 20:33, on Zulip):

is that a test placeholder thing?

nikomatsakis (Jul 24 2018 at 20:34, on Zulip):

the idea is to give a name to the lifetime in question so we can talk about it later -- particularly anonymous ones

nikomatsakis (Jul 24 2018 at 20:35, on Zulip):

unclear to me still if calling it with some untypable name is a good idea or not

nikomatsakis (Jul 24 2018 at 20:35, on Zulip):

but I think it's definitely better than the messages they replace...

Jake Goulding (Jul 24 2018 at 20:36, on Zulip):

ah

Jake Goulding (Jul 24 2018 at 20:38, on Zulip):

Had a question in SO world: Will NLL be enabled by default in Edition 2015 (at some point)? I think yes, other people feel like they've heard no.

Matthew Jasper (Jul 24 2018 at 20:40, on Zulip):

I don't think that AST borrowck can be kept around forever

Jake Goulding (Jul 24 2018 at 20:41, on Zulip):

That's just tempting fate, to say that ;-)

nikomatsakis (Jul 24 2018 at 20:42, on Zulip):

Had a question in SO world: Will NLL be enabled by default in Edition 2015 (at some point)? I think yes, other people feel like they've heard no.

yes, it will.

Jake Goulding (Jul 24 2018 at 20:44, on Zulip):

whew!

Jake Goulding (Jul 24 2018 at 20:44, on Zulip):

Man, who gets to git rm ast-borrowck...

Jake Goulding (Jul 24 2018 at 20:44, on Zulip):

That's my favorite type of code

Keith Yeung (Jul 24 2018 at 21:09, on Zulip):

re:lifetimes, I usually differentiate lifetimes from scopes, in that only references have lifetimes, and the underlying value lives under a scope

Keith Yeung (Jul 24 2018 at 21:11, on Zulip):

i don't think it makes a lot of sense to talk about the lifetime of a concrete value (i.e. a non-reference type), since we always know it's valid to be referenced any time, except when it goes out of scope

pnkfelix (Jul 24 2018 at 21:14, on Zulip):

except when it goes out of scope

pnkfelix (Jul 24 2018 at 21:15, on Zulip):

as in, when it is moved? (or also when its lexical scope ends)

pnkfelix (Jul 24 2018 at 21:16, on Zulip):

sorry I'm being obtuse. I guess what I mean is: This is not a trivial property. which is exactly why we need to maintain dynamic drop flags

Keith Yeung (Jul 24 2018 at 21:18, on Zulip):

when it is moved?

yes

Keith Yeung (Jul 24 2018 at 21:19, on Zulip):

i think of lifetimes as basically answering the question, "when/where is this reference safe to be dereferenced?"

Jake Goulding (Jul 24 2018 at 21:20, on Zulip):

i don't think it makes a lot of sense to talk about the lifetime of a concrete value

Except I think that's the intuitive meaning of the word "lifetime", especially for those coming from other languages. It's the time between when the value is "born" and when it "dies". That's why I think that "lifetime" was an unfortunate choice of word.

Jake Goulding (Jul 24 2018 at 21:20, on Zulip):

dynamic drop flags

remember when these were part of the type, and not on the stack? good times

nikomatsakis (Jul 24 2018 at 21:22, on Zulip):

re:lifetimes, I usually differentiate lifetimes from scopes, in that only references have lifetimes, and the underlying value lives under a scope

I've tried to push for the terminology of "scopes" being when dtors run etc, but it's hard

Jake Goulding (Jul 24 2018 at 21:30, on Zulip):

English is hard

Keith Yeung (Jul 24 2018 at 21:31, on Zulip):

well, wait till you see the chinese translation of "scope"

Keith Yeung (Jul 24 2018 at 21:31, on Zulip):

there are two versions of it, one taiwanese and one mainland chinese

Keith Yeung (Jul 24 2018 at 21:32, on Zulip):

the taiwanese version is 生存空间 -- "living space"

Keith Yeung (Jul 24 2018 at 21:32, on Zulip):

the mainland chinese version is 作用域 -- "effective region"

Keith Yeung (Jul 24 2018 at 21:33, on Zulip):

i personally think the mainland chinese version captures the essence better

Jake Goulding (Jul 24 2018 at 21:36, on Zulip):

Oh, I wasn't meaning that there wasn't harder languages ;-)

Keith Yeung (Jul 24 2018 at 21:37, on Zulip):

i think this ties back in to how lifetimes are actually regions in academia

pnkfelix (Jul 25 2018 at 12:21, on Zulip):

@nikomatsakis somehow we managed to overlook #45696 . @simulacrum caught it but something went wrong it seems

nikomatsakis (Jul 25 2018 at 12:22, on Zulip):

hmm.

pnkfelix (Jul 25 2018 at 12:23, on Zulip):

(I'm hoping its not an EP2 blocker)

pnkfelix (Jul 25 2018 at 12:23, on Zulip):

but it seems like it should be an RC blocker.

nikomatsakis (Jul 25 2018 at 15:20, on Zulip):

@pnkfelix so https://github.com/rust-lang/rust/issues/45696 .. I had kind of forgotten about dangly paths :)

nikomatsakis (Jul 25 2018 at 15:20, on Zulip):

/me tries to bring that back into cache

nikomatsakis (Jul 25 2018 at 15:21, on Zulip):

I could certainly imagine implementing a specialized variant for Box specifically...

Jake Goulding (Jul 25 2018 at 15:22, on Zulip):

dangly paths

Please try not to use specialized compiler-writer jargon so the rest of us can follow along :wink:

pnkfelix (Jul 25 2018 at 15:23, on Zulip):

dangly paths

Please try not to use specialized compiler-writer jargon so the rest of us can follow along :wink:

its sort of hard to avoid in this case

DPC (Jul 25 2018 at 15:24, on Zulip):

:D

nikomatsakis (Jul 25 2018 at 15:26, on Zulip):

should branch a thread anyhow

simulacrum (Jul 25 2018 at 17:01, on Zulip):

@nikomatsakis FYI, try builds should be fixed now but we're still in tree closed as macOS builds are not fixed.

Jake Goulding (Jul 30 2018 at 16:18, on Zulip):

And that was the last we ever saw of @pnkfelix

https://github.com/felix-lang/felix

DPC (Jul 30 2018 at 18:22, on Zulip):

i think if you gather all the people who wrote their own programming language, you will have enough people to host a conference :joy:

pnkfelix (Jul 30 2018 at 18:38, on Zulip):

And that was the last we ever saw of @pnkfelix

https://github.com/felix-lang/felix

Nah, if you ever lose me, it will be to Scheme

lqd (Jul 30 2018 at 21:50, on Zulip):

@pnkfelix are you excited about Dan Friedman and David Christiansen's new book (dependently typed language implementation in Scheme) ? I know I am :) (should be out in a couple weeks)

pnkfelix (Jul 30 2018 at 21:51, on Zulip):

Hmm i actually was not aware of it

pnkfelix (Jul 30 2018 at 21:51, on Zulip):

I sort of stopped following Dan Friedman's books at some point

pnkfelix (Jul 30 2018 at 21:51, on Zulip):

no real good reason

lqd (Jul 30 2018 at 21:58, on Zulip):

https://github.com/the-little-typer/pie is the language they'll be making

lqd (Jul 30 2018 at 22:00, on Zulip):

I've heard it's going to be good from people who read it at a previous OPLSS :)

lqd (Jul 30 2018 at 22:55, on Zulip):

there was a question on IRC and I wasn't sure so I wanted to check here: such cases of "early returns" like this are considered out of scope until Polonius ? I feel they are but I also remember some of the conditional control flow examples in the RFC felt somewhat similar.

pnkfelix (Jul 30 2018 at 23:03, on Zulip):

yes I think that is another example of the kind of control-flow dependent case that we are punting to Polonius

pnkfelix (Jul 30 2018 at 23:04, on Zulip):

It would actually be nice to try to put back the slow code and let us enable it with a debug flag

pnkfelix (Jul 30 2018 at 23:04, on Zulip):

but then again the slow code did have a maintenance burden

lqd (Jul 30 2018 at 23:04, on Zulip):

yeah it "used to work"

lqd (Jul 30 2018 at 23:05, on Zulip):

alright thanks a lot @pnkfelix

Jake Goulding (Jul 30 2018 at 23:20, on Zulip):

@lqd any cross-function conditional borrowing, IIRC

Jake Goulding (Jul 30 2018 at 23:20, on Zulip):

so you can inline the function and it should work

lqd (Jul 30 2018 at 23:21, on Zulip):

hm interesting

lqd (Jul 30 2018 at 23:23, on Zulip):

I'll try it in their example just in case, thanks Jake

lqd (Jul 30 2018 at 23:24, on Zulip):

but we will make it happen with Polonius!

Jake Goulding (Jul 30 2018 at 23:33, on Zulip):

AKA NLL case #3

pnkfelix (Aug 03 2018 at 13:10, on Zulip):

@Matthew Jasper do you think you'll have time in the near future to address the feedback on PR #52959 ?

pnkfelix (Aug 03 2018 at 14:41, on Zulip):

also, by the way... if I don't manage to fix #53026, it is probably the scariest thing that I've seen in a while.

pnkfelix (Aug 03 2018 at 14:41, on Zulip):

@nikomatsakis ^

pnkfelix (Aug 03 2018 at 14:41, on Zulip):

but I'm hoping to identify the root cause.... well, sometime very soon

Matthew Jasper (Aug 03 2018 at 18:49, on Zulip):

I'll try to have #52959 ready for tonight.

Charles Lew (Aug 04 2018 at 17:44, on Zulip):

#49250

lqd (Aug 04 2018 at 17:55, on Zulip):

at least Matthew's minimized repro doesn't ICE on the playground

Keith Yeung (Aug 06 2018 at 09:09, on Zulip):

can i ask what can polonius solve, while MIR borrowck can't?

pnkfelix (Aug 06 2018 at 12:16, on Zulip):

@Keith Yeung I think the theory is that we’ll be able to implement efficient per-location outlives/subtyping atop Polonius

nikomatsakis (Aug 06 2018 at 12:27, on Zulip):

there are also examples that polonius can solve which the older MIR borrowck formulation never code

nikomatsakis (Aug 06 2018 at 12:27, on Zulip):

they are linked in the blog post

nikomatsakis (Aug 06 2018 at 12:27, on Zulip):

here is an example

Keith Yeung (Aug 06 2018 at 19:52, on Zulip):

i see a lot of issues assigned to @Matthew Jasper on github, are they more of a placeholder or are they actually working on all of the issues assigned to them?

nikomatsakis (Aug 06 2018 at 20:09, on Zulip):

afaik they are working on them :) but they may be able to say more... :)

Matthew Jasper (Aug 06 2018 at 20:24, on Zulip):

I have #51759 as more of a bookmark. I've unassigned myself from #46632. The rest are being worked on and should have PRs soon.

Keith Yeung (Aug 06 2018 at 20:49, on Zulip):

i've just checked the tests in https://github.com/rust-lang/rust/issues/46632, it looks like all the diagnostics on that one is properly underlining just the head of the closure, instead of the entirety of it

nikomatsakis (Aug 06 2018 at 21:25, on Zulip):

@Keith Yeung if you are looking for a task, maybe https://github.com/rust-lang/rust/issues/47349 might be good?

nikomatsakis (Aug 06 2018 at 21:25, on Zulip):

I outlined a strategy for fixing towards the end

nikomatsakis (Aug 06 2018 at 21:25, on Zulip):

https://github.com/rust-lang/rust/issues/47349#issuecomment-410852205

Keith Yeung (Aug 06 2018 at 21:25, on Zulip):

you've read my mind :)

Jake Goulding (Aug 06 2018 at 23:30, on Zulip):

I'm happy to see all the discussion is nice wg-nll, not in silly old t-compiler today. Boo compiler, yay NLL

davidtwco (Aug 07 2018 at 08:26, on Zulip):

Out of curiosity, how much difference is there between the performance of polonius and non-polonius?

davidtwco (Aug 07 2018 at 08:28, on Zulip):

Also, can someone take a look at why on #53124, @nikomatsakis's r+ comment hasn't done anything?

nikomatsakis (Aug 07 2018 at 09:57, on Zulip):

Out of curiosity, how much difference is there between the performance of polonius and non-polonius?

unknown— haven't tried polonius in a while

nikomatsakis (Aug 07 2018 at 09:57, on Zulip):

a lot of opts we have done apply equally to both

nikomatsakis (Aug 07 2018 at 09:57, on Zulip):

but not all

davidtwco (Aug 07 2018 at 10:01, on Zulip):

That's why I was wondering.

Keith Yeung (Aug 09 2018 at 19:16, on Zulip):

i'm having trouble building rustc at home using a windows machine

Keith Yeung (Aug 09 2018 at 19:16, on Zulip):

i suspect that they're issues arising from cmake

Keith Yeung (Aug 09 2018 at 19:17, on Zulip):

does anyone know of such kinds of quirks with rustc?

simulacrum (Aug 09 2018 at 19:19, on Zulip):

@Keith Yeung Do you have an error message on hand?

Keith Yeung (Aug 09 2018 at 20:14, on Zulip):

unfortunately not, i've since erased my build folder, upgraded my cmake to the latest version and tried to rebuild

Keith Yeung (Aug 09 2018 at 20:15, on Zulip):

now it's complaining about the cmake command not found

memoryruins (Aug 14 2018 at 12:18, on Zulip):

while adding tests, ran into https://github.com/rust-lang/rust/issues/21906#issuecomment-389400841

memoryruins (Aug 14 2018 at 12:18, on Zulip):

is this a regression or deferred for now?

nikomatsakis (Aug 14 2018 at 12:50, on Zulip):

can you say more? what test did you add exactly?

nikomatsakis (Aug 14 2018 at 12:51, on Zulip):

in any case, the example from https://github.com/rust-lang/rust/issues/21906 is of the kind that polonius aims to fix

nikomatsakis (Aug 14 2018 at 12:51, on Zulip):

the tell-tale sign is the conditional return:

nikomatsakis (Aug 14 2018 at 12:51, on Zulip):
        loop {
            let k = self.one();
            if *k > 10i32 {
                return k;
            }
        }
nikomatsakis (Aug 14 2018 at 12:51, on Zulip):

hmm

nikomatsakis (Aug 14 2018 at 12:51, on Zulip):

I wonder if we can target that with an error message

memoryruins (Aug 14 2018 at 12:53, on Zulip):

Specifically the last two comments, the first one says it built in May, but the second comment said it no longer did. Ah yea, exactly that example!

memoryruins (Aug 14 2018 at 12:58, on Zulip):

As for the tests, no problems there. I was looking into adding the above example, then read the last two comments. Glad to hear polonius is geared for it ^^. Copying the code samples from https://github.com/rust-lang/rust/issues/48697 and https://github.com/rust-lang/rust/issues/30104 into a compile-pass ui test

memoryruins (Aug 14 2018 at 14:22, on Zulip):

meant to add that these tests are originating from issues labeled E-needstest

lqd (Aug 17 2018 at 06:59, on Zulip):

nIce! here's what the dashboard would look like when njn's PR lands: dashboard

memoryruins (Aug 17 2018 at 08:06, on Zulip):

wow! :tada:

Jake Goulding (Aug 17 2018 at 13:55, on Zulip):

What was @nikomatsakis' gut feeling for the cutoff?

Jake Goulding (Aug 17 2018 at 13:55, on Zulip):

125% ?

nikomatsakis (Aug 17 2018 at 13:56, on Zulip):

20% is what The Research says ... I was shooting for 10% ;)

nikomatsakis (Aug 17 2018 at 13:56, on Zulip):

by The Research I mean what @scottmcm cited from somewhere :)

Jake Goulding (Aug 17 2018 at 13:56, on Zulip):

So just a few crates in the benchmark need a boost to hit that

nikomatsakis (Aug 17 2018 at 13:56, on Zulip):

we're getting there

lqd (Aug 17 2018 at 13:57, on Zulip):

probably from https://www.safaribooksonline.com/library/view/designing-and-engineering/9780321562944/

Jake Goulding (Aug 17 2018 at 13:57, on Zulip):

Course, if you factor in the savings of not having to compile a second time just to add some extra {} because AST borrowck...

nikomatsakis (Aug 17 2018 at 13:57, on Zulip):

yeah that sounds right

lqd (Aug 17 2018 at 13:59, on Zulip):

and there are a couple nice PRs in flight from Wesley and Santiago

memoryruins (Aug 18 2018 at 00:04, on Zulip):

twist: ends up outperforming current borrowck across the board

memoryruins (Aug 18 2018 at 00:04, on Zulip):

already is with deep-vector :)

scottmcm (Aug 18 2018 at 01:04, on Zulip):

Yup, that's the one, @lqd

Matthew Jasper (Aug 18 2018 at 08:45, on Zulip):

Can someone with bors permissions retry #53175?

lqd (Aug 18 2018 at 09:13, on Zulip):

@kennytm might be up :) ^

Matthew Jasper (Aug 18 2018 at 10:39, on Zulip):

Thanks @kennytm

Keith Yeung (Aug 21 2018 at 00:50, on Zulip):

I just saw this piece of code in a blog post, and I don't understand why it compiles (even with NLL):

pub struct Node {
    value: u64,
    next: Option<Box<Node>>,
    prev: Option<Box<Node>>,
}

fn main() {
    // must be mut so we can modify it
    let mut head = Node {
        value: 5,
        next: None,
        prev: None,
    };
    let next = Node {
        value: 6,
        next: None,
                     // next takes ownership of head!!!
        prev: Some(Box::new(head)),
    };
    // I actually don't understand why the line below compiles.
    // Since `head` was moved into the box, I'm not sure why I can mutate it.
    head.next = Some(Box::new(next));
}
Keith Yeung (Aug 21 2018 at 00:54, on Zulip):

oh wow, and it looks like we have an answer here: https://github.com/rcoh/rcoh-dot-me-v2/issues/4

Jake Goulding (Aug 21 2018 at 01:06, on Zulip):

@Keith Yeung see also https://github.com/rust-lang/rust/issues/21232

csmoe (Aug 23 2018 at 08:10, on Zulip):

it's an indented behavior in current borrowck, or more specific place check https://github.com/rust-lang/rust/issues/52669

lqd (Aug 23 2018 at 18:26, on Zulip):

#53643 is a new contender for huge statics

lqd (Aug 23 2018 at 18:29, on Zulip):

I wasn't expecting to see another one of those that soon

lqd (Aug 23 2018 at 18:29, on Zulip):

it would be interesting to try with the SCC + 'static PR

davidtwco (Aug 23 2018 at 18:30, on Zulip):

Are those measurements with the same improvements that helped with the previous huge statics issue?

lqd (Aug 23 2018 at 18:31, on Zulip):

at least some of them I think, but not the one which halved html5ever's memory usage, it has yet to land, #53327

lqd (Aug 24 2018 at 14:31, on Zulip):

oh I was profiling this in the background and didn't notice @nikomatsakis was doing it at the same time; I'll make a PR to add the crate to perf later then

lqd (Aug 24 2018 at 14:33, on Zulip):

I have a profile with the SCC+'static PR if that's useful (#53327)

nikomatsakis (Aug 24 2018 at 14:35, on Zulip):

sounds useful

lqd (Aug 24 2018 at 15:09, on Zulip):

now that my profile on master is done, the two turn out to be so similar to the point of not being useful :3

lqd (Aug 24 2018 at 15:33, on Zulip):

but the PR does indeed reduce the memory for this new bench as well: from 2G+ to 1G or so. in any case here are the 2 profiles, both in text and native format for qcachegrind.

ucd
Jake Goulding (Aug 24 2018 at 16:05, on Zulip):

from 2G+ to 1G

not shabby 50%

Jake Goulding (Aug 26 2018 at 15:21, on Zulip):

Is foo.method_takes_mut_self(foo.method_takes_self()) handled by "two-phase borrows"? I've never been clear on exactly what that feature means.

nikomatsakis (Aug 26 2018 at 15:26, on Zulip):

yes, that example is indeed the whole purpose of that feature

Jake Goulding (Aug 26 2018 at 15:31, on Zulip):

I thought that that much was implemented, was I wrong or was it rolled back?

Jake Goulding (Aug 26 2018 at 15:32, on Zulip):
#![feature(nll)]
fn main() {
    let x = &mut [1, 2];
    x.split_at_mut(x.len() / 2);
}
error[E0502]: cannot borrow `*x` as immutable because it is also borrowed as mutable
 --> src/main.rs:4:20
  |
4 |     x.split_at_mut(x.len() / 2);
  |     ---------------^-----------
  |     |              |
  |     |              immutable borrow occurs here
  |     mutable borrow occurs here
  |     borrow later used here
nikomatsakis (Aug 26 2018 at 15:50, on Zulip):

It is implemented. Not sure why it's not working there. Hmm. Might be worth filing an issue. I would guess it has to do with us inserting more borrows than you might expect.

nikomatsakis (Aug 26 2018 at 15:51, on Zulip):

e.g., maybe we desugar that to something like &mut *( &mut *x ) or something

nikomatsakis (Aug 26 2018 at 15:51, on Zulip):

there are some tricky cases, e.g., if x is a Vec, where the thing we are invoking the method on is actually the result of auto-deref to []

nikomatsakis (Aug 26 2018 at 15:51, on Zulip):

this is (roughly) why things like x[i] += x[j] don't necessarily work

nikomatsakis (Aug 26 2018 at 15:52, on Zulip):

or at least one reason

nikomatsakis (Aug 26 2018 at 15:52, on Zulip):

it's annoying that the playground "MIR" option doesn't succeed if there is a borrowck error! :)

nikomatsakis (Aug 26 2018 at 15:54, on Zulip):

in any case, I am slowly becoming convincd that we should consider a more general version -- but I'd prefer to do that in the context of polonius, I think -- or at least to defer thinking about it until we're done with what we've got now. But we might be able to fix this particular example by tweaking how we desugar to try and avoid introducing unnecessary borrows (which would prob just be a general improvement)

Jake Goulding (Aug 26 2018 at 16:01, on Zulip):

@nikomatsakis ok, clearly I'm missing something - https://play.rust-lang.org/?gist=ab7e2ad353951d86bc2a17eff93c1049&version=nightly&mode=debug&edition=2015

Jake Goulding (Aug 26 2018 at 16:01, on Zulip):

there's no possibility for desugaring here, right?

nikomatsakis (Aug 26 2018 at 16:01, on Zulip):

you had #[feature(nll)]

nikomatsakis (Aug 26 2018 at 16:01, on Zulip):

try #![feature(nll)]

Jake Goulding (Aug 26 2018 at 16:02, on Zulip):

feh

nikomatsakis (Aug 26 2018 at 16:02, on Zulip):

that works for me

Jake Goulding (Aug 26 2018 at 16:02, on Zulip):

whew

Jake Goulding (Aug 26 2018 at 16:02, on Zulip):

and I didn't make the same mistake for split_at_mut, good

nikomatsakis (Aug 26 2018 at 16:03, on Zulip):

well, sort of good :P

nikomatsakis (Aug 26 2018 at 16:03, on Zulip):

/me would rather you had

Jake Goulding (Aug 26 2018 at 16:03, on Zulip):

good for me, not for Rust

Jake Goulding (Aug 26 2018 at 16:04, on Zulip):

https://github.com/rust-lang/rust/issues/53723. I tagged as NLL but didn't go deeper. Not sure how y'all are playing your tags these days

Jake Goulding (Aug 26 2018 at 16:24, on Zulip):

@nikomatsakis as I'm idling in #rust, I realize I really appreciate that you put forth effort to consistently use "they" / "them" on the Internet. Thanks for that :heart:

Jake Goulding (Aug 26 2018 at 16:26, on Zulip):

it's annoying that the playground "MIR" option doesn't succeed if there is a borrowck error! :)

@nikomatsakis I just do --emit=mir — is there a file output even when the compiler returns non-zero?

nikomatsakis (Aug 26 2018 at 16:27, on Zulip):

well, you'd have to use -Zdump-mir

nikomatsakis (Aug 26 2018 at 16:27, on Zulip):

which dumps the MIR at each stage

nikomatsakis (Aug 26 2018 at 16:27, on Zulip):

you could imagine having multiple MIR options, e.g. pre-opt and post-opt

nikomatsakis (Aug 26 2018 at 16:27, on Zulip):

not that there is much difference now

nikomatsakis (Aug 26 2018 at 16:27, on Zulip):

but there is some

Jake Goulding (Aug 26 2018 at 16:30, on Zulip):

-Z so it's nightly only, yeah? And this produces an undefined number of MIR files?

nikomatsakis (Aug 26 2018 at 16:56, on Zulip):

yes to both

Jake Goulding (Aug 27 2018 at 16:32, on Zulip):

<Dodo> https://play.rust-lang.org/?gist=a2cddd874bbe8af95ce9d35f98a16aa2&version=nightly&mode=debug&edition=2015
12:17 PM such a nice message :)
12:27 PM <andytoshi> wow, that is a really cool message
12:28 PM very close to my IRC explanation

Jake Goulding (Aug 27 2018 at 16:32, on Zulip):

Yay for NLL error messages!

Jake Goulding (Aug 27 2018 at 23:16, on Zulip):

@nikomatsakis your comment got cut off "(Then we could fix"

nikomatsakis (Aug 27 2018 at 23:28, on Zulip):

no idea what I wanted there...

Jake Goulding (Aug 28 2018 at 18:21, on Zulip):

@nikomatsakis your keyboard slipped away again "In particular, when we lower"

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

test test

nikomatsakis (Aug 28 2018 at 18:22, on Zulip):

I think I just meant to kill those last two paragraphs

nikomatsakis (Aug 28 2018 at 18:22, on Zulip):

thanks for being my copy editor :P

Jake Goulding (Aug 28 2018 at 18:23, on Zulip):

Nah, if I were doing that, I'd just edit it. It's more that I'm hanging on every word!

nikomatsakis (Aug 28 2018 at 18:25, on Zulip):

lol

nikomatsakis (Aug 28 2018 at 18:26, on Zulip):

I'm sure I've used some horrible grammatical monstrosities as well

nikomatsakis (Aug 28 2018 at 18:26, on Zulip):

that you have graciously resisted pointing out

Jake Goulding (Aug 28 2018 at 18:29, on Zulip):

Eh. Different forums have different needs. SO is meant to be a "forever repository" so I care more about that. Ditto RFCs. GitHub, URLO/IRLO are more fluid, Zulip/IRC/Discord/Gitter even more so.

Jake Goulding (Aug 28 2018 at 18:30, on Zulip):

@nikomatsakis regarding your chaining iterator, I'd say that Either is far more common, but your point about efficiency is interesting. Would be neat to see how they compare

nikomatsakis (Aug 28 2018 at 18:31, on Zulip):

Either is a more mechanical transformation, to be sure

nikomatsakis (Aug 28 2018 at 18:32, on Zulip):

I guess it will depend on how many items you are iterating over

nikomatsakis (Aug 28 2018 at 18:32, on Zulip):

since it is sort of a "proportional" price

nikomatsakis (Aug 28 2018 at 18:32, on Zulip):

and of course how much work you're doing

nikomatsakis (Aug 28 2018 at 18:32, on Zulip):

it seems..unlikely to really matter

nikomatsakis (Aug 28 2018 at 18:33, on Zulip):

I don't know why the "option variant" appeals to me so

nikomatsakis (Aug 28 2018 at 18:33, on Zulip):

I guess it's the "flatenning" aspect

nikomatsakis (Aug 28 2018 at 18:33, on Zulip):

I dislike ifs :P

nikomatsakis (Aug 28 2018 at 18:33, on Zulip):

/me is aware that there are actually ifs either way

nikomatsakis (Aug 28 2018 at 18:33, on Zulip):

I also haven't looked closely at thow the "exact len iterator" and other such traits business propagates

nikomatsakis (Aug 28 2018 at 18:33, on Zulip):

I think that is perhaps more important

nikomatsakis (Aug 28 2018 at 18:34, on Zulip):

but in principle it could be propagated either way

Jake Goulding (Aug 28 2018 at 18:34, on Zulip):

Would you care to add this variant to https://stackoverflow.com/questions/29760668/conditionally-iterate-over-one-of-several-possible-iterators ?

Jake Goulding (Aug 28 2018 at 18:37, on Zulip):
use std::iter;

fn main() {
    let x: Option<i64> = None;

    let a;
    let b;

    match x {
        None => {
            a = Some(1..5);
            b = None;
        }
        Some(x) => {
            a = None;
            b = Some(iter::repeat(x).take(5));
        }
    }

    let c = a
        .into_iter()
        .flat_map(|x| x)
        .chain(b.into_iter().flat_map(|x| x));

    // Repeat x 5 times if present, otherwise count from 1 to 5
    for i in c {
        println!("{}", i);
    }
}

Not quite as pretty, if I did it right.

nikomatsakis (Aug 28 2018 at 18:40, on Zulip):

I'm debating if what I said about perf is really true

Jake Goulding (Aug 28 2018 at 18:42, on Zulip):

chain would need to check every next call for None, either would check the enum for every next call

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

(posted)

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

I left out commentary about perf

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

since it's...complex

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

might be a win, might not

Jake Goulding (Aug 28 2018 at 18:47, on Zulip):

thanks!

lqd (Aug 29 2018 at 11:55, on Zulip):

@pnkfelix RE: https://github.com/rust-lang/rust/issues/53643#issuecomment-416923045 the memory issue is greatly reduced by #53327 https://github.com/rust-lang/rust/pull/53327#issuecomment-416623319

pnkfelix (Aug 29 2018 at 11:59, on Zulip):

But by “only” 50%, right?

pnkfelix (Aug 29 2018 at 12:00, on Zulip):

I thought Simon reported a much more grave regression

lqd (Aug 29 2018 at 12:00, on Zulip):

67%

pnkfelix (Aug 29 2018 at 12:00, on Zulip):

Hmm ok

lqd (Aug 29 2018 at 12:00, on Zulip):

it is "reduced" but I wouldn't say "fixed" or inexistant for sure

pnkfelix (Aug 29 2018 at 12:01, on Zulip):

Oh oh I now see

pnkfelix (Aug 29 2018 at 12:01, on Zulip):

I misread Simon’s comment

lqd (Aug 29 2018 at 12:01, on Zulip):

ie it will go from 542,664K to 772,052K once the PR lands

pnkfelix (Aug 29 2018 at 12:02, on Zulip):

He mentioned a second worse regesssion, but that was before the current nightly

lqd (Aug 29 2018 at 12:02, on Zulip):

yeah exactly

lqd (Aug 29 2018 at 12:05, on Zulip):

(it was a nightly from mid july causing problems; which was before the other memory work for html5ever IIRC)

lqd (Aug 29 2018 at 13:11, on Zulip):

oh the "new" try blocks require edition 2018

lqd (Aug 29 2018 at 13:12, on Zulip):

I was confused by these errors in Polonius on edition 2015 https://play.rust-lang.org/?gist=77369449a113b0c04383f0365d8bf28e&version=nightly&mode=debug&edition=2015

lqd (Aug 29 2018 at 13:19, on Zulip):

#![feature(rust_2018_preview)] is not enough ?! wat

nikomatsakis (Aug 29 2018 at 14:01, on Zulip):

polonius is just broken I think?

lqd (Aug 29 2018 at 14:03, on Zulip):

opting into the edition from Cargo.toml is the only way I managed to make it work

lqd (Aug 29 2018 at 14:03, on Zulip):

it might also be the correct way to make it work :)

Basile Desloges (Aug 29 2018 at 14:20, on Zulip):

Hey everyone!

I'd like to work on NLL, is there a list of starter issues where I should pick one or should I just pick an issue in https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Aissue+label%3AA-NLL ? (if that's the second case, any recommendation?)

pnkfelix (Aug 29 2018 at 15:32, on Zulip):

Hi @Basile Desloges ; you may want to look over the list of issues that were discussed at the meeting last night, as documented in the triage Paper

Basile Desloges (Aug 29 2018 at 15:33, on Zulip):

Thanks! I'll take a look :)

lqd (Aug 29 2018 at 17:26, on Zulip):

(teasing yet again, -13% in leapfrog)

Jake Goulding (Aug 29 2018 at 18:35, on Zulip):

@lqd are things in any kind of state to compare datafrog perf vs mainline compiler?

lqd (Aug 29 2018 at 18:37, on Zulip):

interesting question, I don't think so

nikomatsakis (Aug 29 2018 at 18:37, on Zulip):

absolutely not

nikomatsakis (Aug 29 2018 at 18:37, on Zulip):

e.g. the subtyping code is not creating facts

nikomatsakis (Aug 29 2018 at 18:38, on Zulip):

we have to go back and try to fix up polonius support at some point...

lqd (Aug 29 2018 at 18:39, on Zulip):

(and our best strategy in polonius itself isn't fully baked / available / 100% correct yet)

lqd (Aug 29 2018 at 18:41, on Zulip):

also: it doesn't build :p

lqd (Aug 29 2018 at 18:43, on Zulip):

if would be cool to know what needs to be done fo fix up polonius support, maybe it can be done in the background of the current work, or by new contributors etc

lqd (Aug 29 2018 at 18:43, on Zulip):

or by @Jake Goulding

Jake Goulding (Aug 29 2018 at 18:44, on Zulip):

Man... there's so much lacking knowledge in this brain between here and there

Jake Goulding (Aug 29 2018 at 18:44, on Zulip):

I could make it build again, maybe. And last I heard, it should be easy to get all the tests passing again ;-).

lqd (Aug 29 2018 at 18:46, on Zulip):

(I got it to build earlier, which is where that tiny bench came from, just needs to opt in the 2018 edition, switch the catch_exprs fleature flag to try_blocks, and s/do catch/ try/g)

memoryruins (Aug 31 2018 at 20:43, on Zulip):

ran across two untagged nll/borrowcheck related issues
https://github.com/rust-lang/rust/issues/53528
https://github.com/rust-lang/rust/issues/52706

Matthew Jasper (Sep 01 2018 at 21:49, on Zulip):

Is everyone happy with removing the "not reporting region error due to nll" warning? (cf. #53865)

lqd (Sep 04 2018 at 11:58, on Zulip):

@pnkfelix is there anything I can help you with #52934 ?

pnkfelix (Sep 04 2018 at 11:58, on Zulip):

@lqd nope, I'm about done writing a test I think

pnkfelix (Sep 04 2018 at 11:58, on Zulip):

It just took me a little while because I wanted to try to enumerate various cases in the design space

lqd (Sep 04 2018 at 11:59, on Zulip):

sorry I wasn't able to look at it earlier, you had done a ton of work already when I was able to look at the issue

davidtwco (Sep 04 2018 at 17:18, on Zulip):

I've now had two instances where a PR (different PRs) will build locally but on Travis fails with a lifetime error - anyone know what might be causing tha?

nikomatsakis (Sep 04 2018 at 17:23, on Zulip):

@davidtwco usually this indicates that you need to rebase, as travis tests post-merge

nikomatsakis (Sep 04 2018 at 17:23, on Zulip):

could it be that?

davidtwco (Sep 04 2018 at 17:24, on Zulip):

It doesn't feel like it is. I've seen it here and here (I think this was it).

davidtwco (Sep 04 2018 at 17:25, on Zulip):

From what I can remember, in the latter PR there, I rebased locally and still couldn't reproduce, I just best-guess moved a function call and that satisfied it.

davidtwco (Sep 04 2018 at 17:26, on Zulip):

They seem like the type of errors that I wouldn't expect a rebase to cause.

davidtwco (Sep 04 2018 at 17:34, on Zulip):

In this case it might have been a rebase issue, ignore me. :face_palm:

lqd (Sep 06 2018 at 11:14, on Zulip):

@pnkfelix I think https://github.com/rust-lang/rust/issues/43234#issuecomment-419030308 should be sent to rfcbot instead of bors

pnkfelix (Sep 06 2018 at 11:14, on Zulip):

oh of course

lqd (Sep 06 2018 at 11:15, on Zulip):

we should have numbers comparing to incremental this afternoon

lqd (Sep 06 2018 at 11:19, on Zulip):

hmm is rfcbot notified when messages are edited ? looks like they didn't go through to https://github.com/rust-lang/rust/issues/43234#issuecomment-410263039

pnkfelix (Sep 06 2018 at 11:19, on Zulip):

yeah I think I'll just delete and repost

pnkfelix (Sep 06 2018 at 11:20, on Zulip):

although even that doesn't seem to have worked?

lqd (Sep 06 2018 at 11:21, on Zulip):

I think it did

lqd (Sep 06 2018 at 11:21, on Zulip):

all concerns look resolved now

pnkfelix (Sep 06 2018 at 11:21, on Zulip):

oh okay, something was not handled right in my page load

lqd (Sep 06 2018 at 12:30, on Zulip):

and here are the numbers for the migrate mode

pnkfelix (Sep 06 2018 at 13:11, on Zulip):

@WG-compiler-nll anyone want to review #53948 ? I think its "trivial" enough that anyone in the WG is qualified to look it over. (Mostly a sanity check)

pnkfelix (Sep 06 2018 at 13:14, on Zulip):

(i'm going to assign it to niko in the meantime, but my intention is that anyone can review it.)

Wesley Wiser (Sep 06 2018 at 13:27, on Zulip):

I got it. Thanks for the assist @pnkfelix!

pnkfelix (Sep 06 2018 at 13:27, on Zulip):

thanks to you Wesley. :)

davidtwco (Sep 06 2018 at 15:28, on Zulip):

Just looking through the RC milestone issues - the following issues read to me as if there are unresolved discussions or something that makes it a tad unclear what needs done:

#53114, #53040, #51269

I've got an issue to work on at the moment, but of the seven unassigned milestone issues, four aren't tracking/list issues of some kind and three of those read as unclear. IMO might be worth looking over those to clarify what is needing done since we normally point people looking for a issue at that list.

lqd (Sep 06 2018 at 18:42, on Zulip):

maybe/esp the ICE :thumbs_up:

lqd (Sep 07 2018 at 09:00, on Zulip):

(btw the last 2 of these 3 issues are now no longer on the RC milestone)

lqd (Sep 07 2018 at 16:10, on Zulip):

@nikomatsakis is it x.py test src/tools/tidy to run tidy locally that you find inconvenient ? we'd maybe want a x.py tidy ?

lqd (Sep 07 2018 at 16:15, on Zulip):

actually ignore me

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

Which complaint of mine are you referring to?

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

On the rustc-guide?

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

As it happens, I do find that annoying :)

lqd (Sep 07 2018 at 16:15, on Zulip):

https://github.com/rust-lang-nursery/rustc-guide/pull/190#issuecomment-419475202

lqd (Sep 07 2018 at 16:15, on Zulip):

right :(

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

yeah, however, the rustc-guide one is even more annoying

lqd (Sep 07 2018 at 16:15, on Zulip):

I misread it as regular rust repo sorry :((((((

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

:)

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

afaict MAX_LINE_LENGTH=80 ci/check_line_lengths.sh src/**/*.md is what you have to do there...

nikomatsakis (Sep 07 2018 at 16:15, on Zulip):

i should just make a bash script

lqd (Sep 07 2018 at 16:15, on Zulip):

something needs to be done about this lint to make it more ergonomic

nikomatsakis (Sep 07 2018 at 16:16, on Zulip):

or a makefile or something

lqd (Sep 07 2018 at 16:16, on Zulip):

alias lint_of_doom=

nikomatsakis (Sep 07 2018 at 16:25, on Zulip):

part of it is that I'm just grumpy today :) I have to go to the dentist, that never helps! :scared:

lqd (Sep 07 2018 at 16:30, on Zulip):

:/

lqd (Sep 07 2018 at 16:30, on Zulip):

hang in there :D

davidtwco (Sep 07 2018 at 17:44, on Zulip):

w/r/t being able to spot a long line:

In Vim, I have the following set which adds a vertical bar at a certain column, might be useful to some:

" Colour 40 columns after column 80.
let &colorcolumn="100,".join(range(140, 1000, 40), ",")
lqd (Sep 07 2018 at 17:50, on Zulip):

inb4 #wg-nll splits into #wg-nll-vim and #wg-nll-emacs

Keith Yeung (Sep 07 2018 at 18:40, on Zulip):

it has already split between #wg-nll-mir and #wg-nll-frog

Jake Goulding (Sep 12 2018 at 17:55, on Zulip):

Does anyone remember the magic keywords I can search for for "llvm deduplicates identical function bodies"

Jake Goulding (Sep 12 2018 at 17:55, on Zulip):

I know that it was turned off for a while, then turned back on "recently", but I cant figure out when and what that feature was called to search for it

lqd (Sep 12 2018 at 18:01, on Zulip):

yeah just a sec

lqd (Sep 12 2018 at 18:03, on Zulip):

@Jake Goulding the magic keyword is mergefunc, and the recent PR is https://github.com/rust-lang/rust/pull/49479

Jake Goulding (Sep 12 2018 at 18:04, on Zulip):

Thank you!

lqd (Sep 12 2018 at 18:04, on Zulip):

np

pnkfelix (Sep 13 2018 at 10:53, on Zulip):

hey does anyone remember if there was a github issue discussing attempting to encode things like "Option<S<'a>> cannot possibly keep the lifetime alive across a None branch of a match"?

pnkfelix (Sep 13 2018 at 10:54, on Zulip):

I've done some searching but nothings come up yet

lqd (Sep 13 2018 at 11:14, on Zulip):

no, sorry :/

pnkfelix (Sep 13 2018 at 11:14, on Zulip):

I could have sworn someone had suggested it as a future improvement and yet I cannot find a record of such discussion

pnkfelix (Sep 13 2018 at 11:14, on Zulip):

@nikomatsakis ^

nikomatsakis (Sep 13 2018 at 13:37, on Zulip):

@pnkfelix I don't understand what you mean

pnkfelix (Sep 13 2018 at 13:59, on Zulip):

@nikomatsakis I'm basically referring to my comment from 53528

nikomatsakis (Sep 13 2018 at 13:59, on Zulip):

yeah, I had that impression

pnkfelix (Sep 13 2018 at 13:59, on Zulip):

(which now has its own topic)

nikomatsakis (Sep 13 2018 at 13:59, on Zulip):

I read that afterwards and realized this must be the context

pnkfelix (Sep 18 2018 at 12:58, on Zulip):

Hmm, what am I missing here: https://play.rust-lang.org/?gist=5736ea474188c5a29de1257d790daf23&version=nightly&mode=debug&edition=2015

pnkfelix (Sep 18 2018 at 12:58, on Zulip):

OH

pnkfelix (Sep 18 2018 at 12:58, on Zulip):

So clever!

pnkfelix (Sep 18 2018 at 12:59, on Zulip):

another mut borrow could come in!

pnkfelix (Sep 18 2018 at 13:01, on Zulip):

(and in fact even the Drop could happen. Oh that's such a great example. I wish the diagnostics for it were a tiny bit better

nikomatsakis (Sep 18 2018 at 16:42, on Zulip):

it's a tricky example to explain

nikomatsakis (Sep 18 2018 at 16:42, on Zulip):

particularly since & borrows don't behave this way

lqd (Sep 20 2018 at 17:15, on Zulip):

nikomatsakis:
it might be time to rejuvenate polonius then :)

step 1: make it build

nikomatsakis (Sep 20 2018 at 18:00, on Zulip):

merged

lqd (Sep 20 2018 at 18:01, on Zulip):

awesome, thank you niko

Matthew Jasper (Sep 20 2018 at 18:13, on Zulip):

Step 2: Get facts to work on nightly?

lqd (Sep 20 2018 at 18:13, on Zulip):

Step 3: profit ?

Matthew Jasper (Sep 20 2018 at 18:17, on Zulip):

With any luck

lqd (Sep 20 2018 at 18:18, on Zulip):

Step 3: get errors to work ;)

nikomatsakis (Sep 20 2018 at 18:19, on Zulip):

there is at least one FIXME around facts and subtyping relationships

nikomatsakis (Sep 20 2018 at 18:19, on Zulip):

I forget what else I broke :P

nikomatsakis (Sep 20 2018 at 18:19, on Zulip):

the way I would figure it out is probably to run the tests

nikomatsakis (Sep 20 2018 at 18:19, on Zulip):

move fast and break things, and all that

nikomatsakis (Sep 20 2018 at 18:19, on Zulip):

or at least the second half, anyway

Jake Goulding (Sep 20 2018 at 20:08, on Zulip):

Move faster than ./x.py build at least

lqd (Sep 21 2018 at 11:26, on Zulip):

step 1.1: make it a little faster

lqd (Sep 21 2018 at 11:27, on Zulip):

gotchu @Matthew Jasper these were not integer steps :p

Matthew Jasper (Sep 21 2018 at 11:41, on Zulip):

Polonius will be so fast when we finally get it to work with rustc.

Matthew Jasper (Sep 21 2018 at 11:53, on Zulip):

I think there's also step 0. Decide what we want to do with polonius now that we don't have time constraints.

lqd (Sep 21 2018 at 11:53, on Zulip):

faster, probably. "fast", maybe, let's hope so :)

lqd (Sep 21 2018 at 11:54, on Zulip):

you have plot twisted the whole thing, these steps were not even positive floats

lqd (Sep 21 2018 at 11:55, on Zulip):

jokes aside, yes agreed

Jake Goulding (Sep 21 2018 at 14:00, on Zulip):

Step NaN; Step +Inf

Matthew Jasper (Sep 21 2018 at 18:17, on Zulip):

Step +inf: borrowck is perfect.

nikomatsakis (Sep 21 2018 at 18:57, on Zulip):

I think there's also step 0. Decide what we want to do with polonius now that we don't have time constraints.

@Matthew Jasper what are you thinking of here?

Matthew Jasper (Sep 21 2018 at 19:11, on Zulip):

At least: 1. Do we want to move initializedness checks to Polonius as well

Matthew Jasper (Sep 21 2018 at 19:11, on Zulip):

2. How do we handle liveness, given that the current NLL implementation has to not calculate it for performance reasons.

nikomatsakis (Sep 21 2018 at 19:31, on Zulip):

ah, yes. I think the answer to 1 is probably yes, but I'd probably rather wait until we get the rest up and going.

As for liveness, we are still computing it, we're doing it differently though. I don't think this matters much to polonius, actually, which doesn't have as much bias as to how the representation is setup.

The real question though is whether polonius will need to grow such a bias, since right now it just operates on pairs of tuples, but we're using bitsets for liveness at present.

Ideally, we'd move the liveness computation into polonius as well, I think

lqd (Sep 21 2018 at 19:57, on Zulip):

@nikomatsakis we don't have to merge the previous PR quickly, you can take your time to review, when things are less hectic, and then iterate on it so that it is less hacky :)

lqd (Sep 21 2018 at 20:27, on Zulip):

I'll wait for a time that is more suitable for the whole WG, to make polonius PRs, so we can all weigh in on what to do and how to do it best, without time constraints or pressure, and the end result will be better I'm sure

Matthew Jasper (Sep 22 2018 at 13:17, on Zulip):

PR for step2: #54468

blitzerr (Sep 22 2018 at 20:07, on Zulip):

Is there a way to get to (file,line,column) triplet from the BasicBlock structure ?

Matthew Jasper (Sep 22 2018 at 20:15, on Zulip):

Most likely you'll want to get a Span, and then get the error reporting functions to do the rest.

Matthew Jasper (Sep 22 2018 at 20:17, on Zulip):

So generally you want self.mir.source_info(location).span

blitzerr (Sep 22 2018 at 20:57, on Zulip):

Thanks a lot @Matthew Jasper

blitzerr (Sep 22 2018 at 22:34, on Zulip):

@Matthew Jasper
one more question,
```for moi in &self.move_data.loc_map

How can I trace a move_out index back to line/column of code ?
Matthew Jasper (Sep 22 2018 at 22:53, on Zulip):

You can do

let location = self.move_data.moves[*moi].source;
let span = self.mir.source_info(location).span;
// use span
Matthew Jasper (Sep 22 2018 at 23:00, on Zulip):

From your reply in another thread, you do can just do let span = self.mir.source_info(l).span;

blitzerr (Sep 22 2018 at 23:29, on Zulip):

thanks @Matthew Jasper

blitzerr (Sep 22 2018 at 23:30, on Zulip):

If I could also do let span = self.mir.source_info(l).span ?
Then what happens if the location is not a move location ?

blitzerr (Sep 22 2018 at 23:32, on Zulip):

I am only two weeks old in Rust; still getting my bearings right :slight_smile:

Matthew Jasper (Sep 23 2018 at 08:07, on Zulip):

If there's no move there then the for loop will be iterating over an empty list of moves, so nothing happens.

Jake Goulding (Sep 25 2018 at 18:44, on Zulip):

statementizing

new brain child

@pnkfelix I hope these aren't words that make it into the diagnostic :wink:

pnkfelix (Sep 25 2018 at 18:51, on Zulip):

My goal is Miriam Webster!!

memoryruins (Sep 25 2018 at 18:59, on Zulip):

statementize.png

Jake Goulding (Sep 25 2018 at 19:07, on Zulip):

I followed the link

pasted image

pnkfelix (Sep 27 2018 at 08:32, on Zulip):

Anyone want to review PR #54355 ? Its "just" a regression test, and it got auto-assigned to aturon who is pretty swamped.

Matthew Jasper (Sep 27 2018 at 20:53, on Zulip):

@nikomatsakis is this a know issue with type checking?

fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
    let z: Option<&'b &'a usize> = None; // Should error, don't know that 'a: 'b
}
nikomatsakis (Sep 27 2018 at 20:53, on Zulip):

Hmm, we don't check the user annot for WF I guess.

nikomatsakis (Sep 27 2018 at 20:53, on Zulip):

I feel like I did know about this

nikomatsakis (Sep 27 2018 at 20:53, on Zulip):

and had planned to fix it

nikomatsakis (Sep 27 2018 at 20:54, on Zulip):

but somehow it didn't happen

nikomatsakis (Sep 27 2018 at 20:54, on Zulip):

file a bug?

nikomatsakis (Sep 27 2018 at 20:54, on Zulip):

I can leave some notes on how to fix if you want to do so

nikomatsakis (Sep 27 2018 at 20:54, on Zulip):

and/or just give you a tip right now :)

Matthew Jasper (Sep 27 2018 at 20:59, on Zulip):

Opened #54620

pnkfelix (Sep 28 2018 at 09:38, on Zulip):

Hey @davidtwco , I'm doing some hacking that involves the BorrowExplanations you added

pnkfelix (Sep 28 2018 at 09:39, on Zulip):

and I was thinking that the name .emit is a little unfortunate, because the error objects that we create already use the name emit to mean "issue this message to the stderr now please." (rather than say, buffering it)

pnkfelix (Sep 28 2018 at 09:40, on Zulip):

So I wanted to know if you'd like to spend a moment now to help me bikeshed a different name?

davidtwco (Sep 28 2018 at 09:40, on Zulip):

Sure.

davidtwco (Sep 28 2018 at 09:41, on Zulip):

I think I experimented with a handful of names (I'm unsure if the similar change I made in the region_name module used emit too).

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

So if I understand right, the current BorrowExplanation::emit(&self, tcx, err) accumulates the explanation from self into err

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

My first thought is "report"

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

or even ... "explain" ?

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

(but having an explanation explain seems goofy)

davidtwco (Sep 28 2018 at 09:41, on Zulip):

add_explanation_to_diagnostic

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

Hah!

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

Definitely self explanatory

pnkfelix (Sep 28 2018 at 09:41, on Zulip):

I like it

pnkfelix (Sep 28 2018 at 09:42, on Zulip):

its not like this method name needs to be short

pnkfelix (Sep 28 2018 at 09:42, on Zulip):

Okay I'll throw that alpha-rename into what I'm doing.

davidtwco (Sep 28 2018 at 09:42, on Zulip):

We should check the region_name module to see if it uses emit too - we might want to change that there too?

pnkfelix (Sep 28 2018 at 09:42, on Zulip):

I'll look quickly

davidtwco (Sep 28 2018 at 09:42, on Zulip):

Ah, no, I used highlight_region_name in that case.

pnkfelix (Sep 28 2018 at 09:42, on Zulip):

great

pnkfelix (Sep 28 2018 at 09:42, on Zulip):

Also, before I waste time finding out

pnkfelix (Sep 28 2018 at 09:43, on Zulip):

was there any reason you didn't (or couldn't) send the mir along into the emit (aka add_explanation_to_diagnostic) method when you call it?

davidtwco (Sep 28 2018 at 09:43, on Zulip):

Didn't need it to do what the function did.

pnkfelix (Sep 28 2018 at 09:43, on Zulip):

Okay

pnkfelix (Sep 28 2018 at 09:44, on Zulip):

The reason I ask that is that I'm adding a variant that corresponds to "Dropping an unnamed temporary"

pnkfelix (Sep 28 2018 at 09:44, on Zulip):

and I can either have the variant carry all the spans I'm interested in

pnkfelix (Sep 28 2018 at 09:44, on Zulip):

or I could have it just carry the mir::Local

davidtwco (Sep 28 2018 at 09:44, on Zulip):

I tried to do all of the logic that would need that in creating the BorrowExplanation - leaving just a couple spans and messages left. It was really just a mechanism so I could selectively choose not to emit certain types of explanations.

pnkfelix (Sep 28 2018 at 09:44, on Zulip):

(sorry, "just the mir::Local and the Location, I think...)

pnkfelix (Sep 28 2018 at 09:45, on Zulip):

Hmm, interesting

pnkfelix (Sep 28 2018 at 09:45, on Zulip):

So your thought is that the add_explanation_to_diagnostic should itself not do much extraction of the spans ?

davidtwco (Sep 28 2018 at 09:46, on Zulip):

My intent when adding it was that it kept just what it needed to add a message to a diagnostic and that the explain_borrow function that creates it does all the working that out. If you think it makes more sense for it to do more, then feel free to change it though.

pnkfelix (Sep 28 2018 at 09:46, on Zulip):

Okay I'll play around with it

pnkfelix (Sep 28 2018 at 09:47, on Zulip):

thanks!

davidtwco (Sep 28 2018 at 09:47, on Zulip):

I figured that in 99% of cases, the explanation would have add_explaination_to_diagnostic called almost immediately after being created anyway - as it was previously. But for the PR I added it in, I wanted to be able to say "add to the diagnostic unless your explanation is X, that isn't helpful now"

davidtwco (Sep 28 2018 at 09:54, on Zulip):

I didn't even notice the indentation :face_palm:

pnkfelix (Sep 28 2018 at 09:57, on Zulip):

its easy to miss

pnkfelix (Sep 28 2018 at 09:58, on Zulip):

(maybe auto-running rustfmt as part of bors isn't such a crazy idea after all...)

davidtwco (Sep 28 2018 at 09:58, on Zulip):

(at least having tidy run rustfmt --write-mode diff would have spotted it)

pnkfelix (Sep 28 2018 at 09:58, on Zulip):

/me didn't even know about rustfmt --write-mode diff ...

pnkfelix (Sep 28 2018 at 09:59, on Zulip):

I have got to put some time aside to better acquaint myself with the various tools in the Rust ecosystem

pnkfelix (Sep 28 2018 at 09:59, on Zulip):

I only just today learned about the -W option to git log --patch

davidtwco (Sep 28 2018 at 10:03, on Zulip):

And now I have.

davidtwco (Sep 28 2018 at 10:03, on Zulip):

https://xkcd.com/1053/

pnkfelix (Sep 28 2018 at 10:05, on Zulip):

I think I need to do something structured about this problem. Like, maybe plan to write a short blog post per week (or maybe per day?!?) discussing a "favorite tool" or even "favorite option/flag/mode" for a tool

pnkfelix (Sep 28 2018 at 10:06, on Zulip):

It would be good to get in the habit of writing in a structured manner like that again. My previous blog posts were all so epic that it became daunting to attempt a new one..

pnkfelix (Sep 28 2018 at 10:07, on Zulip):

(and thus I haven't posted in literally years....)

lqd (Sep 28 2018 at 10:15, on Zulip):

@pnkfelix you need to finish your series on GCs :)

lqd (Sep 28 2018 at 10:15, on Zulip):

it was Good ™

pnkfelix (Sep 28 2018 at 10:16, on Zulip):

yeah. There was rumblings of maybe having me resume looking at GC stuff again

pnkfelix (Sep 28 2018 at 10:16, on Zulip):

Once the edition's out, we'll see

lqd (Sep 28 2018 at 10:17, on Zulip):

with josephine, and apparently Stephen Dolan's rust+ocaml shindig, the landscape has a bit changed since then as well

pnkfelix (Sep 28 2018 at 10:17, on Zulip):

and WASM is also a significant part of the picture

lqd (Sep 28 2018 at 10:18, on Zulip):

hopefully they move on with their GC / host binding plans soon indeed

memoryruins (Oct 01 2018 at 20:03, on Zulip):

dtolnay found a nll ICE this morning. the issue appears to be more about lifetime inference than nll, but tagged/linking if it's worth being on radar https://github.com/rust-lang/rust/issues/54124

lqd (Oct 01 2018 at 20:12, on Zulip):

is it #53420 / playground ?

memoryruins (Oct 01 2018 at 20:17, on Zulip):

oh yea, those are incredibly similar, except the one using PhantomData doesn't ICE on 2015 or 2018 without explictly adding #![feature(nll)]

memoryruins (Oct 01 2018 at 20:18, on Zulip):

but nearly the same code sample

nikomatsakis (Oct 01 2018 at 20:58, on Zulip):

left some comments

Jake Goulding (Oct 02 2018 at 15:05, on Zulip):

@pnkfelix in https://github.com/rust-lang/rust/issues/21232#issuecomment-426290385, do you mean to say "Our current status in Rust 2018 / with NLL"?

Jake Goulding (Oct 02 2018 at 15:06, on Zulip):

Because the first example you gave doesn't compile pre-NLL

pnkfelix (Oct 02 2018 at 15:16, on Zulip):

right, you have to use the variant that moves s away. I'll fix it.

pnkfelix (Oct 02 2018 at 15:21, on Zulip):

oh actually, it suffices to just declare s as mut.

Jake Goulding (Oct 02 2018 at 15:23, on Zulip):

Yep, which is a change from pre- / post- NLL too

pnkfelix (Oct 02 2018 at 15:28, on Zulip):

@Jake Goulding I don't understand: it seems to me like NLL also requires you declare s as mut?

pnkfelix (Oct 02 2018 at 15:28, on Zulip):

(which might not be something we stick to in the long term; but I'm not yet seeing the change in behavior you are referencing in this particular case)

pnkfelix (Oct 02 2018 at 15:29, on Zulip):

I do know that the unused_mut lint is broken for this case

pnkfelix (Oct 02 2018 at 15:29, on Zulip):

(for NLL)

pnkfelix (Oct 02 2018 at 15:29, on Zulip):

which may well be an instance of #54586

Jake Goulding (Oct 02 2018 at 15:29, on Zulip):

Oh, I was just assuming that your original code worked and that you were testing it in a different context than "stable"

pnkfelix (Oct 02 2018 at 15:29, on Zulip):

no i was just writing without testing. :)

Jake Goulding (Oct 02 2018 at 15:30, on Zulip):

I was adding the comment to the other commenter showing that let s: i32; s = 42 works today, but when I tried with a struct I got the "needs mut" error, which is the only reason I caught it in your comment

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

does Rust tests has some kind of interruption that makes the current output to be displayed?

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

so you don't need to wait until the whole thing finished to see the current failures output

Santiago Pastorino (Oct 03 2018 at 20:04, on Zulip):

I remember that minitest in Ruby handled ctrl+t in that way

Santiago Pastorino (Oct 03 2018 at 20:05, on Zulip):

@nikomatsakis, others? :point_of_information:

nikomatsakis (Oct 03 2018 at 20:05, on Zulip):

does Rust tests has some kind of interruption that makes the current output to be displayed?

I guess you mean the x.py test stuff?

Jake Goulding (Oct 03 2018 at 20:05, on Zulip):

There's cargo test -- --nocapture

Santiago Pastorino (Oct 03 2018 at 20:07, on Zulip):

does Rust tests has some kind of interruption that makes the current output to be displayed?

I guess you mean the x.py test stuff?

yep

lqd (Oct 03 2018 at 20:07, on Zulip):

I think verbose-tests in config.toml might be doing that, it's IIRC how CI runs them, and it always shows them line by line, so I assume also with errors

Santiago Pastorino (Oct 03 2018 at 20:07, on Zulip):

well the -- --nocapture could work if can be passed to x.py

nikomatsakis (Oct 03 2018 at 20:09, on Zulip):

I think you may want to tweak your config.toml

nikomatsakis (Oct 03 2018 at 20:09, on Zulip):

as @lqd said, there is this setting:

# Suppresses extraneous output from tests to ensure the output of the test
# harness is relatively clean.
#quiet-tests = true
nikomatsakis (Oct 03 2018 at 20:09, on Zulip):

I think if it is false, you get more interactive output

Santiago Pastorino (Oct 03 2018 at 20:11, on Zulip):

ahhh ok ok

Santiago Pastorino (Oct 03 2018 at 20:11, on Zulip):

cool

Jake Goulding (Oct 03 2018 at 20:12, on Zulip):

also responding to signals in a cross-platform, multi-threaded safe way is amazingly annoying

lqd (Oct 03 2018 at 20:12, on Zulip):

(it might be necessary to also nuke the built tests though)

Santiago Pastorino (Oct 03 2018 at 20:50, on Zulip):

@nikomatsakis I don't see quiet-tests on the generated config.toml.example file

Santiago Pastorino (Oct 03 2018 at 20:50, on Zulip):

is that correct?

Santiago Pastorino (Oct 03 2018 at 20:51, on Zulip):

ahh probably this ...

Santiago Pastorino (Oct 03 2018 at 20:51, on Zulip):
# Emits extraneous output from tests to ensure that failures of the test
# harness are debuggable just from logfiles.
#verbose-tests = false
nikomatsakis (Oct 03 2018 at 20:55, on Zulip):

@Santiago Pastorino ah probably changed yeah

nikomatsakis (Oct 03 2018 at 20:55, on Zulip):

since my config.toml was copie

lqd (Oct 03 2018 at 20:59, on Zulip):

@Santiago Pastorino yeah that's the one I mentioned earlier :)

Santiago Pastorino (Oct 03 2018 at 21:00, on Zulip):

:+1:

lqd (Oct 03 2018 at 21:01, on Zulip):

Felix and I used it recently when looking for the weird CI error we couldn't reproduce, I haven't seen it fail so I only can assume it does what you want (and what CI does) but I've seen it switch from using the block ...II..FF to line by line so it should work

pnkfelix (Oct 05 2018 at 05:14, on Zulip):

@nikomatsakis here is an interesting temo r-value lifetime oddity I was previously unaware of: https://github.com/rust-lang/rust/issues/21114#issuecomment-426963631

pnkfelix (Oct 05 2018 at 08:20, on Zulip):

*"temp", not "temo"

nikomatsakis (Oct 05 2018 at 15:25, on Zulip):

@pnkfelix I believe that was quite intentional: whenever there is "conditional flow", temporaries cannot escape it. It's obvious that this makes sense for loops (to prevent unbounded buildup). I'm not sure if it was necessary for if/else but...

pnkfelix (Oct 05 2018 at 15:33, on Zulip):

I certainly would understand if the temps in the test condition died early

nikomatsakis (Oct 05 2018 at 15:33, on Zulip):

I think they do, too

nikomatsakis (Oct 05 2018 at 15:34, on Zulip):

regardless, I dont' think we can/should change the rules here at the moment, right?

pnkfelix (Oct 05 2018 at 15:34, on Zulip):

But the tail of the then/else blocks strike me as analogous to “tail position”, when thinking about the space-efficiency semantics

nikomatsakis (Oct 05 2018 at 15:34, on Zulip):

i.e., didn't we rule that out of scope without careful evaluation etc?

pnkfelix (Oct 05 2018 at 15:35, on Zulip):

No I don’t think we can change the rules in time for 2018 edition

pnkfelix (Oct 05 2018 at 15:35, on Zulip):

Just wanted to note it

pnkfelix (Oct 05 2018 at 15:35, on Zulip):

Since it led people to make interestign bugs

nikomatsakis (Oct 05 2018 at 15:36, on Zulip):

k

lqd (Oct 08 2018 at 08:05, on Zulip):

(I will be having little free time in the coming weeks because of $dayjob, so if I'm less active/available for the foreseeable future, this will be why)

pnkfelix (Oct 09 2018 at 14:02, on Zulip):

Hey @davidtwco do you have any opinion on how the intermediate buffering/filtering/sorting done by the move_error_reported BTreeMap should interact with -Z dont-buffer-diagnostics and, perhaps more importantly, -Z treat-err-as-bug ?

pnkfelix (Oct 09 2018 at 14:03, on Zulip):

right now the move_error_reported intermediate map sort of messes up the workflow of using -Z treat-err-as-bug to get stack traces that point right to the place where the error was generated. But its also not clear to me whether it makes sense to adopt the strategy of immediately emitting such errors when those -Z flags are present, since the errors in question might end up getting suppressed down the road

davidtwco (Oct 09 2018 at 14:09, on Zulip):

Hmm, I'm not sure. Having an error fire straight away wouldn't work because, like you said, it might have ended up being suppressed.

w/r/t -Z dont-buffer-diagnostics, I think we consider the location where the errors are currently loaded into the buffer as the place where they should be emitted since otherwise we get the normally suppressed errors being emitted and that's not useful.

w/r/t -Z treat-err-as-bug, the move_error_reported map really messes this up. I believe there are like four maps/sets that are used to deduplicate errors but that particular one is the only one that doesn't just keep the first error IIRC.

In a previous PR, I added a debug! log to rustc_errors when a diagnostic is buffered so that I can find it in RUST_LOG output and get some idea of where it is in the compiler from the surrounding logs.

pnkfelix (Oct 09 2018 at 14:15, on Zulip):

I'm sort of tempted to try to generalize -Z treat-err-as-bug to take an optional argument. Or add a -Z treat-nth-err-as-bug=<N> and then that would cause a panic on the N'th emit() call

davidtwco (Oct 09 2018 at 14:15, on Zulip):

Unless there's some way that I'm not aware of to save the backtrace when we're buffering those errors so that we can error later with that backtrace (and I expect that this isn't possible), I'm not sure there's a nice way to have that interaction work.

pnkfelix (Oct 09 2018 at 14:16, on Zulip):

(a -Z treat-nth-err-as-bug=<N> flag wouldn't be enough on its own... I'm just musing whether its a necessity, if one wants to have any chance of debugging an error that arises after another error has been emitted ...)

pnkfelix (Oct 09 2018 at 14:17, on Zulip):

I think we could save a backtrace. I don't know whether we should...

pnkfelix (Oct 09 2018 at 14:17, on Zulip):

after all, my memory is that the RUST_BACKTRACE support is itself implemented in Rust...

davidtwco (Oct 09 2018 at 14:17, on Zulip):

I suppose it wouldn't be possible to disable the deduplication in that case and get all of the errors, each with stack traces?

davidtwco (Oct 09 2018 at 14:18, on Zulip):

With a warning: some errors might be deduplicated when rustc is run without this flag or something.

pnkfelix (Oct 09 2018 at 14:18, on Zulip):

I suppose it wouldn't be possible to disable the deduplication in that case and get all of the errors, each with stack traces?

Yeah this might be the more principled approach

davidtwco (Oct 09 2018 at 14:19, on Zulip):

The errors, as far as I can remember, were never the same, so it should be possible to ignore the ones that weren't showing up for the test case before adding that flag.

Matthew Jasper (Oct 10 2018 at 11:06, on Zulip):

Does anyone object to me removing #53114 from the RC 2 milestone (we have parity with AST borrowck)

nikomatsakis (Oct 10 2018 at 14:11, on Zulip):

I do not

Keith Yeung (Oct 11 2018 at 06:24, on Zulip):

is there a tracking issue for this? https://play.rust-lang.org/?gist=76a259242ade7730cbc0a5ad7b68c360&version=nightly&mode=debug&edition=2018

Keith Yeung (Oct 11 2018 at 06:29, on Zulip):

the x.get_mut(x.len()) is IMO a wrong error, even though it's going through a deref to get the method on slice

pnkfelix (Oct 11 2018 at 09:16, on Zulip):

@Keith Yeung my first guess is that this represents a limitation of our current implementation of two-phase borrows

pnkfelix (Oct 11 2018 at 09:17, on Zulip):

i.e. I think you've hit the nail on the head: I bet the need to go through the deref is causing the mutable borrow to be activated "earlier" than you would have hoped.

pnkfelix (Oct 11 2018 at 09:24, on Zulip):

But I do agree we should at least make sure this tracked somewhere

pnkfelix (Oct 11 2018 at 09:25, on Zulip):

There are a couple different candidate issues where one might consider filing this

pnkfelix (Oct 11 2018 at 09:26, on Zulip):

#44100 is the most obvious to me. But it was closed in favor of #43234

pnkfelix (Oct 11 2018 at 09:26, on Zulip):

There are also some issues discussing expanding/generalizing two-phase borrows, namely #51915 and #49434

pnkfelix (Oct 11 2018 at 09:27, on Zulip):

The other option is that we could just file an issue specifically about this particular case

Keith Yeung (Oct 13 2018 at 03:45, on Zulip):

i've written a comment on #49434 which describes the problem

pnkfelix (Oct 16 2018 at 14:41, on Zulip):

Hey @nikomatsakis , do you know offhand if the const-evaluator (or whatever system we use for compiling the RHS of statics) will generate different MIR depending on whether NLL is enabled or not?

nikomatsakis (Oct 16 2018 at 14:46, on Zulip):

well

nikomatsakis (Oct 16 2018 at 14:46, on Zulip):

it starts from MIR construction

nikomatsakis (Oct 16 2018 at 14:46, on Zulip):

so to the extent that MIR construction differs, it will

nikomatsakis (Oct 16 2018 at 14:46, on Zulip):

I think this is largely confined to matches right now?

pnkfelix (Oct 16 2018 at 14:47, on Zulip):

hmm okay

pnkfelix (Oct 16 2018 at 14:49, on Zulip):

(I'm trying to puzzle out the difference in behavior between the 2015 and 2018 editions on #54797 )

pnkfelix (Oct 23 2018 at 20:54, on Zulip):

@nikomatsakis do you think you'd have time to review https://github.com/rust-lang/rust/pull/55150 ? Its small. But its a patch to AST-borrowck. (or rather, mem_categorization)

pnkfelix (Oct 23 2018 at 20:55, on Zulip):

(and I think if we don't get it in for RC2, then it may be worth beta-nomination)

nikomatsakis (Oct 23 2018 at 20:56, on Zulip):

ok

pnkfelix (Oct 23 2018 at 20:57, on Zulip):

oh I guess #[thread_local] is not stabilized. so not worth beta-nomination in any circumstance

pnkfelix (Oct 23 2018 at 20:57, on Zulip):

(I kept forgetting why this wasn't higher priority for me to get someone to review)

Jake Goulding (Oct 25 2018 at 18:07, on Zulip):

I think Polonius is such a great name for that project. For those who didn't read Shakespeare's Hamlet, Polonius is known for giving the advice "Neither a borrower nor a lender be."

Jake Goulding (Oct 25 2018 at 18:07, on Zulip):

@nikomatsakis ^ someone got it ;-)

nikomatsakis (Oct 25 2018 at 18:08, on Zulip):

:tada:

Keith Yeung (Nov 16 2018 at 22:31, on Zulip):

i just got a github notification informing me that i've been added to rust-lang/compiler-team

Keith Yeung (Nov 16 2018 at 22:31, on Zulip):

did anyone receive the same notification?

davidtwco (Nov 16 2018 at 22:32, on Zulip):

I think it's a because a new repository was created, anyone in the rust-lang org gets automatically subscribed.

Keith Yeung (Nov 16 2018 at 22:32, on Zulip):

ah

lqd (Dec 05 2018 at 11:03, on Zulip):

:frog: 1.0 :tada:

davidtwco (Dec 06 2018 at 15:08, on Zulip):

What happened to compare mode NLL? It doesn't get run by default in the UI suite unless I pass the --compare-mode flag now.

davidtwco (Dec 06 2018 at 15:09, on Zulip):

Is it some side effect of the change to disable it on Windows to speed up CI?

davidtwco (Dec 06 2018 at 15:09, on Zulip):

(note, not on Windows, well, I'm ssh'd into a Arch server from Windows, but I doubt x.py has figured that out)

kennytm (Dec 06 2018 at 15:10, on Zulip):

#56391

kennytm (Dec 06 2018 at 15:10, on Zulip):

it is disabled by default and only enabled on x86_64-gnu-nopt now.

davidtwco (Dec 06 2018 at 15:10, on Zulip):

Ah, I assumed that change would have only applied to the CI and the default on dev machines would remain the same.

davidtwco (Dec 06 2018 at 15:11, on Zulip):

Thanks, I'll update my config.toml.

lqd (Dec 06 2018 at 19:57, on Zulip):

@WG-compiler-nll (and other contributors of course) congrats on shipping NLL to the world :tada: you've done it! Thanks for all the hard work and talent and countless other things :clap:

Santiago Pastorino (Dec 06 2018 at 21:46, on Zulip):

everyone, as some people know I'm organizing Rust Latam and we have opened the cfp

Santiago Pastorino (Dec 06 2018 at 21:46, on Zulip):

https://cfp.rustlatam.org/events/rust-latam

Santiago Pastorino (Dec 06 2018 at 21:47, on Zulip):

it would be nice if someone from this group want to send a proposal and maybe, why not, talk about the process of building NLL or something else that you want :)

Santiago Pastorino (Dec 06 2018 at 21:48, on Zulip):

/cc @WG-compiler-nll

nikomatsakis (Dec 07 2018 at 10:10, on Zulip):

it would be nice if someone from this group want to send a proposal and maybe, why not, talk about the process of building NLL or something else that you want :)

I love that idea

pnkfelix (Dec 11 2018 at 11:56, on Zulip):

We probably should have advertised this PR (and how to "undo" its effects locally) quite a bit more within this WG: #56391 "ci: Only run compare-mode tests on one builder"

pnkfelix (Dec 11 2018 at 11:57, on Zulip):

because its phrased as if it only affects the ci system, but I think its better phrased as a global effect (especially to us) that is undone on a single ci builder, I think.

lqd (Dec 21 2018 at 00:42, on Zulip):

I've forgotten, looking at mir dumps, how do we map back from inference variables (I think it's their name, eg _#1r) to named lifetimes again ? I'm not sure where to look in the mir dump (I wanted to check and generate NLL facts so I wanted to verify if a specific free region in the source was present in the facts)

pnkfelix (Dec 21 2018 at 11:05, on Zulip):

I don't know if the current mir dumps include that info. I would have expected to see it somewhere in the *.nll.0.mir dump, but I don't see it in one I have handy here.

lqd (Dec 21 2018 at 11:05, on Zulip):

same

lqd (Dec 21 2018 at 11:08, on Zulip):

@pnkfelix for instance I'm looking at code like this and was wondering to which region they were mapped, especially since the same lifetime can be seen multiple times, and there are 6-8 regions for this function

pnkfelix (Dec 21 2018 at 11:09, on Zulip):

it would be good to try to fix this

pnkfelix (Dec 21 2018 at 11:09, on Zulip):

maybe open an issue and tag it A-NLL for now

lqd (Dec 21 2018 at 11:09, on Zulip):

so, say, I was wondering whether the &'a for the return type was the same inference variabla as the first argument

lqd (Dec 21 2018 at 11:09, on Zulip):

ok will do, thanks Felix :)

pnkfelix (Dec 21 2018 at 11:10, on Zulip):

At this point the way I've been dealing with Q's like that

pnkfelix (Dec 21 2018 at 11:10, on Zulip):

is staring at RUST_LOG output

pnkfelix (Dec 21 2018 at 11:10, on Zulip):

for far too long

lqd (Dec 21 2018 at 11:11, on Zulip):

yeah we can do that, but requires a custom rustc build for "regular users"

pnkfelix (Dec 21 2018 at 11:11, on Zulip):

oh right

pnkfelix (Dec 21 2018 at 11:11, on Zulip):

"sigh"

pnkfelix (Dec 21 2018 at 11:11, on Zulip):

I wonder if we could get our CI to make a debug-build variant of the nightly channel added to rustup

lqd (Dec 21 2018 at 11:12, on Zulip):

yeah like the llvm-assertions enabled one, ALT I guess

pnkfelix (Dec 21 2018 at 11:12, on Zulip):

does that exist? An llvm-assertions enabled build?

lqd (Dec 21 2018 at 11:12, on Zulip):

I'm not sure it does, it was talked about at some point

pnkfelix (Dec 21 2018 at 11:12, on Zulip):

if so we might be able to convince T-infra to just fold the two ideas into one build

pnkfelix (Dec 21 2018 at 11:13, on Zulip):

since if you're paying for debug=true, you might also be willing to pay for LLVM assertions

lqd (Dec 21 2018 at 11:13, on Zulip):

but surely did not end up as a rustup channel

pnkfelix (Dec 21 2018 at 11:13, on Zulip):

(the main issue I could imagine is LLVM-assertions causing an early failure and thus causing one to be unable to recreate a problem of interest)

lqd (Dec 21 2018 at 14:33, on Zulip):

@pnkfelix sorry to bother you Felix, do you know of documentation about the NLL mir dump format ? sections are generally named, but not columns, so I was wondering what some of those were. Or should I maybe more simply look for the code that generates it ?

pnkfelix (Dec 21 2018 at 14:35, on Zulip):

@lqd I don't know offhand, sorry. You should probably look for the code that generates them.

lqd (Dec 21 2018 at 14:36, on Zulip):

alright, thank you

Santiago Pastorino (Dec 24 2018 at 17:54, on Zulip):

Merry Christmas to everyone!!!

Matthew Jasper (Jan 02 2019 at 18:56, on Zulip):

Meeting today?

nikomatsakis (Jan 02 2019 at 19:46, on Zulip):

I'm around but still in general "catch up mode"

nikomatsakis (Jan 02 2019 at 19:46, on Zulip):

so I could go either way

Matthew Jasper (Jan 02 2019 at 20:09, on Zulip):

I'll add a heading in the paper doc for people to write down any status updates, but I'm OK with no meeting.

nikomatsakis (Jan 02 2019 at 20:14, on Zulip):

:+1: cc @WG-compiler-nll :point_up:

lqd (Jan 18 2019 at 09:56, on Zulip):

for people following at home, niko has a new polonius post

lqd (Apr 22 2019 at 15:08, on Zulip):

@Matthew Jasper yay :tada: for #59114

Matthew Jasper (Apr 22 2019 at 15:09, on Zulip):

:tada: :party_ball: :sunglasses:

lqd (Apr 22 2019 at 15:10, on Zulip):

awesome job :)

centril (Apr 22 2019 at 18:42, on Zulip):

Well done Matthew!

Santiago Pastorino (Apr 22 2019 at 19:47, on Zulip):

:tada:

pnkfelix (Jun 27 2019 at 09:05, on Zulip):

okay, embarrassing question time: Who wants to remind me why I'm totally wrong on #62170 "match guard is lengthening borrow unexpectedly under NLL" ?

lqd (Jun 27 2019 at 20:32, on Zulip):

isn't that a case for Polonius ?

lqd (Jun 27 2019 at 20:33, on Zulip):

à la #47680 ?

pnkfelix (Jun 28 2019 at 00:56, on Zulip):

yes I think that is @Matthew Jasper 's assertion as well, since they added that as a tag to the issue I fild

pnkfelix (Jun 28 2019 at 00:57, on Zulip):

for some reason I thought this case wouldn't require going all the way to polonius, but I am too tired to think straight about this right now

lqd (Jun 28 2019 at 07:12, on Zulip):

ah right I hadn’t seen Matthew’s tag, I’m just staring at -z polonius bugs in loops at the moment :) (and whenever I see a loop borrowing + killing the same variable + control flow, I think it’s probably a job for polonius more so than NLLs) it’s an interesting thought to try supporting these simpler cases (but as they work in Polonius today, maybe we wait a bit to see how that evolves and then revisit ?)

Last update: Nov 21 2019 at 23:45UTC