Stream: t-compiler/wg-nll

Topic: various region bugs


nikomatsakis (Dec 04 2018 at 12:57, on Zulip):

@pnkfelix so in going through the polonius results, I'm encountering a number of test cases that don't seem to error in NLL mode, but I .. think they should. Did you notice these before?

Two examples:

nikomatsakis (Dec 04 2018 at 12:57, on Zulip):

(cc @davidtwco)

nikomatsakis (Dec 04 2018 at 12:57, on Zulip):

is there an issue about this?

davidtwco (Dec 04 2018 at 12:58, on Zulip):

Do you mean NLL mode as in NLL compare mode (ie. migrate) or with actual NLL?

nikomatsakis (Dec 04 2018 at 12:58, on Zulip):

actual NLL

nikomatsakis (Dec 04 2018 at 12:58, on Zulip):

I think in compare mode they .. probably still error

davidtwco (Dec 04 2018 at 12:58, on Zulip):

Just checking - I've tripped myself up more than once.

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

actually

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

they don't

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

er, wait

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

in migrate they do

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

but not in NLL

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

(as expected, as these are region errors)

nikomatsakis (Dec 04 2018 at 12:59, on Zulip):

I may try to fix these during the plenary today

nikomatsakis (Dec 04 2018 at 13:00, on Zulip):

speaking of which, oh, shoot, I should go get breakfast

davidtwco (Dec 04 2018 at 13:00, on Zulip):

links to save others time: regions-assoc-type-in-supertrait-outlives-container.rs and regions-free-region-ordering-caller.rs

davidtwco (Dec 04 2018 at 13:01, on Zulip):

I recognize that first test as something that changed (IIRC) on my type annot unreachable code branch.

davidtwco (Dec 04 2018 at 13:02, on Zulip):
~/projects/rust/issue-54943 issue-54943* david@dtw-avendahl
❯ ./build/x86_64-unknown-linux-gnu/stage2/bin/rustc -Z borrowck=mir -Z two-phase-borrows src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs
error: unsatisfied lifetime constraints
  --> src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs:52:13
   |
44 | fn with_assoc<'a,'b>() {
   |               -- -- lifetime `'b` defined here
   |               |
   |               lifetime `'a` defined here
...
52 |     let _x: &'a WithAssoc<TheType<'b>> = loop { };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`

error: aborting due to previous error
davidtwco (Dec 04 2018 at 13:03, on Zulip):

Now I think about it though, I think I expected that test to change and it didn't.

davidtwco (Dec 04 2018 at 13:04, on Zulip):

I also get errors for the other test (on that branch, not sure if it is that branch's changes causing it).

davidtwco (Dec 04 2018 at 13:05, on Zulip):
~/projects/rust/issue-54943 issue-54943* david@dtw-avendahl
❯ ./build/x86_64-unknown-linux-gnu/stage2/bin/rustc -Z borrowck=mir -Z two-phase-borrows src/test/ui/regions/regions-free-region-ordering-caller.rs
[...I removed some warnings here...]
error: unsatisfied lifetime constraints
  --> src/test/ui/regions/regions-free-region-ordering-caller.rs:18:12
   |
17 | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) {
   |          --  -- lifetime `'b` defined here
   |          |
   |          lifetime `'a` defined here
18 |     let z: Option<&'b &'a usize> = None;//~ ERROR E0623
   |            ^^^^^^^^^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`

error: unsatisfied lifetime constraints
  --> src/test/ui/regions/regions-free-region-ordering-caller.rs:23:12
   |
21 | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) {
   |          --  -- lifetime `'b` defined here
   |          |
   |          lifetime `'a` defined here
22 |     let y: Paramd<'a> = Paramd { x: a };
23 |     let z: Option<&'b Paramd<'a>> = None;//~ ERROR E0623
   |            ^^^^^^^^^^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b`

error: unsatisfied lifetime constraints
  --> src/test/ui/regions/regions-free-region-ordering-caller.rs:27:12
   |
26 | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) {
   |          --  -- lifetime `'b` defined here
   |          |
   |          lifetime `'a` defined here
27 |     let z: Option<&'a &'b usize> = None;//~ ERROR E0623
   |            ^^^^^^^^^^^^^^^^^^^^^ assignment requires that `'b` must outlive `'a`

error: aborting due to 3 previous errors
davidtwco (Dec 04 2018 at 13:06, on Zulip):

Unless of course I'm misunderstanding what you are expecting.

davidtwco (Dec 04 2018 at 13:16, on Zulip):

That said, I can confirm that there are no errors at all on the playground: regions-assoc-type-in-supertrait-outlives-container.rs and regions-free-region-ordering-caller.rs

nikomatsakis (Dec 04 2018 at 14:23, on Zulip):

Now I think about it though, I think I expected that test to change and it didn't.

( I added a fix that makes it not dead code and it still does not error for me)

nikomatsakis (Dec 04 2018 at 14:27, on Zulip):

do we have a bug for "weak tests"? I did a bit more detailed review and found that I would classify as "weak":

sorry @pnkfelix I can't remember :)

pnkfelix (Dec 04 2018 at 14:28, on Zulip):

i don't think we have a dedicated bug anymore; the review project would say for sure

pnkfelix (Dec 04 2018 at 14:28, on Zulip):

let me go find the link for that

pnkfelix (Dec 04 2018 at 14:28, on Zulip):

diagnostic review project: https://github.com/rust-lang/rust/projects/10

pnkfelix (Dec 04 2018 at 14:28, on Zulip):

maybe this: https://github.com/rust-lang/rust/projects/10#column-3663841

pnkfelix (Dec 04 2018 at 14:29, on Zulip):

but I certainly don't object to making such a bug

pnkfelix (Dec 04 2018 at 14:30, on Zulip):

and there was this issue #51025

pnkfelix (Dec 04 2018 at 14:30, on Zulip):

but I think that (#51025) was meant to just capture the cases I was able to identify at that time

davidtwco (Dec 04 2018 at 14:47, on Zulip):

It's possible that I get errors on that branch because it isn't based on HEAD and not because of any changes it includes (which is more likely).

Last update: Nov 22 2019 at 01:00UTC