Stream: t-compiler/wg-nll

Topic: #44844-compile-fail-to-ui


davidtwco (Aug 08 2018 at 08:29, on Zulip):

Is there anything blocking this happening? I should catch up with the conversation in T-compiler about this.

nikomatsakis (Aug 08 2018 at 08:40, on Zulip):

not really

nikomatsakis (Aug 08 2018 at 08:40, on Zulip):

afaik

davidtwco (Aug 08 2018 at 08:41, on Zulip):

I could take a look at that today if nobody else is doing it already.

nikomatsakis (Aug 08 2018 at 08:49, on Zulip):

afaik nobody is doing anything

davidtwco (Aug 08 2018 at 09:43, on Zulip):

@nikomatsakis https://github.com/rust-lang/rust/issues/52531 might be problematic?

nikomatsakis (Aug 08 2018 at 09:43, on Zulip):

hmm yes

nikomatsakis (Aug 08 2018 at 09:43, on Zulip):

we should fix that I guess

nikomatsakis (Aug 08 2018 at 09:44, on Zulip):

would you like to know how to fix it? :)

davidtwco (Aug 08 2018 at 09:45, on Zulip):

Yeah, that would be helpful. I've spotted this in the ui test code.

nikomatsakis (Aug 08 2018 at 09:47, on Zulip):

let's move to another topic..

davidtwco (Aug 08 2018 at 09:48, on Zulip):

I was already in the process of doing that.

nikomatsakis (Aug 08 2018 at 09:48, on Zulip):

oh... just did :)

davidtwco (Aug 08 2018 at 09:48, on Zulip):

I guess this still works, since your topic is more specific to the error-pattern comments.

davidtwco (Aug 08 2018 at 11:44, on Zulip):

@nikomatsakis These tests fail to compile in normal compare-mode but compile in nll compare-mode - I'm not sure if that is necessarily correct or not, should I just add // ignore-compare-mode-nll?

    [ui (nll)] ui/compile-fail-migration/associated-types-subtyping-1.rs
    [ui (nll)] ui/compile-fail-migration/borrow-tuple-fields.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-closures-unique.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-issue-2657-1.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-lend-flow-if.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-lend-flow.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move-cc.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-move-mut-base-ptr.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-object-lifetime.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-overloaded-index-autoderef.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-swap-mut-base-ptr.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-union-borrow-nested.rs
    [ui (nll)] ui/compile-fail-migration/borrowck/borrowck-uniq-via-lend.rs
    [ui (nll)] ui/compile-fail-migration/cleanup-rvalue-scopes-cf.rs
    [ui (nll)] ui/compile-fail-migration/closure_promotion.rs
    [ui (nll)] ui/compile-fail-migration/hashmap-lifetimes.rs
    [ui (nll)] ui/compile-fail-migration/issue-28848.rs
    [ui (nll)] ui/compile-fail-migration/issue-5500-1.rs#ast
    [ui (nll)] ui/compile-fail-migration/method-self-arg-2.rs
    [ui (nll)] ui/compile-fail-migration/mut-cant-alias.rs
    [ui (nll)] ui/compile-fail-migration/regions-assoc-type-in-supertrait-outlives-container.rs
    [ui (nll)] ui/compile-fail-migration/regions-bounded-by-trait-requiring-static.rs
    [ui (nll)] ui/compile-fail-migration/regions-bounded-method-type-parameters.rs
    [ui (nll)] ui/compile-fail-migration/regions-free-region-ordering-caller.rs
    [ui (nll)] ui/compile-fail-migration/regions-implied-bounds-projection-gap-1.rs
    [ui (nll)] ui/compile-fail-migration/regions-infer-contravariance-due-to-decl.rs
    [ui (nll)] ui/compile-fail-migration/regions-infer-covariance-due-to-decl.rs
    [ui (nll)] ui/compile-fail-migration/regions-outlives-projection-container-wc.rs
    [ui (nll)] ui/compile-fail-migration/regions-outlives-projection-container.rs
    [ui (nll)] ui/compile-fail-migration/regions-variance-contravariant-use-covariant-in-second-position.rs
    [ui (nll)] ui/compile-fail-migration/regions-variance-contravariant-use-covariant.rs
    [ui (nll)] ui/compile-fail-migration/regions-variance-covariant-use-contravariant.rs
    [ui (nll)] ui/compile-fail-migration/regions-variance-invariant-use-contravariant.rs
    [ui (nll)] ui/compile-fail-migration/regions-variance-invariant-use-covariant.rs
    [ui (nll)] ui/compile-fail-migration/unboxed-closure-region.rs
    [ui (nll)] ui/compile-fail-migration/unboxed-closures-borrow-conflict.rs
    [ui (nll)] ui/compile-fail-migration/variance-cell-is-invariant.rs
    [ui (nll)] ui/compile-fail-migration/variance-contravariant-arg-trait-match.rs
    [ui (nll)] ui/compile-fail-migration/variance-contravariant-self-trait-match.rs
    [ui (nll)] ui/compile-fail-migration/variance-covariant-arg-trait-match.rs
    [ui (nll)] ui/compile-fail-migration/variance-covariant-self-trait-match.rs
    [ui (nll)] ui/compile-fail-migration/variance-invariant-arg-trait-match.rs
    [ui (nll)] ui/compile-fail-migration/variance-invariant-self-trait-match.rs

After that, all the compile-fail tests will be working as UI tests. (Then I'll look into moving them into the main src/test/ui folder rather than src/test/ui/compile-fail-migration and organizing them slightly as per #46841).

davidtwco (Aug 08 2018 at 11:47, on Zulip):

I should clarify, they pass in normal compare-mode, but they fail in NLL compare-mode because they compile successfully.

davidtwco (Aug 08 2018 at 11:50, on Zulip):

There are some (like issue-550-1.rs#ast) that I can see are fine but others where I'm not sure if it is a NLL bug that they compile or if it is NLL being great.

nikomatsakis (Aug 08 2018 at 12:06, on Zulip):

@davidtwco I think in such cases we did ignore the compare mode, yes -- or maybe we added #[cfg_attr(nll, rustc_error)] to the main, actually? @pnkfelix would remember

davidtwco (Aug 08 2018 at 12:18, on Zulip):

@pnkfelix mentioned // ignore-compare-mode-nll to me here. I just wasn't sure whether or not these tests were correct in compiling with NLL or whether that is a bug.

davidtwco (Aug 08 2018 at 12:19, on Zulip):

Figured I'd need to check that before just marking them all as OK.

nikomatsakis (Aug 08 2018 at 12:38, on Zulip):

well

nikomatsakis (Aug 08 2018 at 12:38, on Zulip):

I can check if you want

nikomatsakis (Aug 08 2018 at 12:38, on Zulip):

they might just need to be changed

nikomatsakis (Aug 08 2018 at 12:40, on Zulip):

OK so -- the associated-types-sutyping-1.rs I think can be fixed if you change from let _: ... to let _c: .. =

nikomatsakis (Aug 08 2018 at 12:40, on Zulip):

or let c

nikomatsakis (Aug 08 2018 at 12:40, on Zulip):

the problem is that the type annot is being ignored

nikomatsakis (Aug 08 2018 at 12:41, on Zulip):

borrow-tuple-fields.rs needs to be changed to use the reference

nikomatsakis (Aug 08 2018 at 12:41, on Zulip):

so e.g.

    let x: (Box<_>, _) = (box 1, 2);
    let r = &x.0;
    let y = x; //~ ERROR cannot move out of `x` because it is borrowed

becomes

    let x: (Box<_>, _) = (box 1, 2);
    let r = &x.0;
    let y = x; //~ ERROR cannot move out of `x` because it is borrowed
    drop(r);
nikomatsakis (Aug 08 2018 at 12:41, on Zulip):

same with borrowck-borrow-mut-object-twice.rs

nikomatsakis (Aug 08 2018 at 12:42, on Zulip):

ok, I'm going to stop there because I have to do something else, but maybe that helps @davidtwco :)

davidtwco (Aug 08 2018 at 12:44, on Zulip):

Thanks. I'll change those two and any others I can spot, otherwise I'll add an ignore comment to them in a separate commit so it's easy to differentiate the tests I changed due to this and everything else moving around.

nikomatsakis (Aug 08 2018 at 12:47, on Zulip):

one possibility: open a tracking issue and dump them in a checklist

nikomatsakis (Aug 08 2018 at 12:47, on Zulip):

they are almost certainly what @pnkfelix calls "weak tests"

davidtwco (Aug 08 2018 at 12:48, on Zulip):

Sounds good.

davidtwco (Aug 08 2018 at 14:48, on Zulip):

@nikomatsakis #53196

davidtwco (Aug 08 2018 at 14:48, on Zulip):

It already has merge conflicts, which is annoying.

nikomatsakis (Aug 08 2018 at 14:54, on Zulip):

lol

davidtwco (Aug 08 2018 at 14:54, on Zulip):

It's _huge_.

davidtwco (Aug 08 2018 at 14:55, on Zulip):

I'm not even sure how to keep this mergable - it'll get conflicts every day.

nikomatsakis (Aug 08 2018 at 14:59, on Zulip):

well probably I'll r+ with p=10 or something

davidtwco (Aug 08 2018 at 15:06, on Zulip):

Rebasing this is so very confusing.

davidtwco (Aug 08 2018 at 15:09, on Zulip):

Yeah, I messed up a little and my "update NLL tests" commit has a bunch of deletions and the next commit has the additions.

davidtwco (Aug 08 2018 at 15:09, on Zulip):

Where that commit should only have a handful (~40 or so) test/stderr changes.

davidtwco (Aug 08 2018 at 15:14, on Zulip):

I'm going to fix the commits in the PR before attempting to rebase it - should make it much simpler and it's kind-of required so that those tests that got the ignore-compare-mode-nll can be checked.

lqd (Aug 08 2018 at 17:48, on Zulip):

@davidtwco hum, tidy looks for the compile-fail directory apparently

davidtwco (Aug 08 2018 at 18:41, on Zulip):

@lqd I noticed, not had a chance to fix it yet.

Last update: Nov 21 2019 at 23:25UTC