Skip to content

Instantly share code, notes, and snippets.

@pnkfelix
Last active July 7, 2017 13:30
Show Gist options
  • Save pnkfelix/e6efd1da14ed27920d9c3f73394132d7 to your computer and use it in GitHub Desktop.
Save pnkfelix/e6efd1da14ed27920d9c3f73394132d7 to your computer and use it in GitHub Desktop.
MIR borrowck status

Branch: https://github.com/pnkfelix/rust/tree/mir-borrowck3c

Opt-in methods: -Z borrowck-mir or #[rustc_mir_borrowck]

Big Picture Issues

  • No Notes emitted yet
  • Path rendering differs between Ast and Mir. (Mostly minor, but replacement of field names with indices is bad.)
  • Lots of ICEs (presumably because some MIR operations used here have well-formedness assumptions that are violated in borrowck-broken code)
  • Conflates lots of cases that are distinguished by AST-borrowck
  • Conflates "uninitialized" with "moved" (special case of previous bullet, one that I think should be fixed ASAP)

Specific commit for report below

commit 76531597e21664c59cc962de4ccd2d0fffb9e7db (HEAD -> mir-borrowck3c, pnk-gh/mir-borrowck3c)
Author: Felix S. Klock II <[email protected]>
Date:   Tue May 2 17:00:31 2017 +0200

    Fix for old bug in dataflow: the `Box` mir-statement initializes the container, not the contents.

ICEs

compile-fail/borrowck/borrowck-bad-nested-calls-free.rs
compile-fail/borrowck/borrowck-borrow-from-owned-ptr.rs
compile-fail/borrowck/borrowck-borrow-from-stack-variable.rs
compile-fail/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs
compile-fail/borrowck/borrowck-closures-use-after-free.rs
compile-fail/borrowck/borrowck-fn-in-const-a.rs
compile-fail/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs
compile-fail/borrowck/borrowck-insert-during-each.rs
compile-fail/borrowck/borrowck-issue-2657-2.rs
compile-fail/borrowck/borrowck-lend-flow-if.rs
compile-fail/borrowck/borrowck-lend-flow-loop.rs
compile-fail/borrowck/borrowck-lend-flow.rs
compile-fail/borrowck/borrowck-loan-blocks-mut-uniq.rs
compile-fail/borrowck/borrowck-move-by-capture.rs
compile-fail/borrowck/borrowck-move-error-with-note.rs
compile-fail/borrowck/borrowck-move-in-irrefut-pat.rs
compile-fail/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs
compile-fail/borrowck/borrowck-move-out-of-overloaded-deref.rs
compile-fail/borrowck/borrowck-move-out-of-static-item.rs
compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs
compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs
compile-fail/borrowck/borrowck-move-out-of-vec-tail.rs
compile-fail/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs
compile-fail/borrowck/borrowck-object-lifetime.rs
compile-fail/borrowck/borrowck-overloaded-index-move-from-vec.rs
compile-fail/borrowck/borrowck-reborrow-from-mut.rs
compile-fail/borrowck/borrowck-struct-update-with-dtor.rs
compile-fail/borrowck/borrowck-swap-mut-base-ptr.rs
compile-fail/borrowck/borrowck-uniq-via-lend.rs
compile-fail/borrowck/borrowck-vec-pattern-nesting.rs
compile-fail/borrowck/move-in-static-initializer-issue-38520.rs

False Failures

run-pass/borrowck/borrowck-field-sensitivity.rs
run-pass/borrowck/borrowck-mut-vec-as-imm-slice.rs
run-pass/borrowck/borrowck-use-mut-borrow.rs
compile-fail/borrowck/borrowck-bad-nested-calls-move.rs              (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-for-loop-head-linkage.rs              (NOTE: (Mir) reporting strange re-assignment error in for-loop)
compile-fail/borrowck/borrowck-issue-2657-1.rs                       (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-loan-blocks-move-cc.rs                (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-loan-blocks-move.rs                   (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-move-subcomponent.rs                  (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs           (NOTE: "cannot assign to `_` because it is borrowed")
compile-fail/borrowck/borrowck-no-cycle-in-exchange-heap.rs          (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-overloaded-index-move-index.rs        (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-partial-reinit-1.rs                   (NOTE: partial reinit misreported as potential use)
compile-fail/borrowck/borrowck-partial-reinit-2.rs                   (NOTE: partial reinit misreported as potential use)
compile-fail/borrowck/borrowck-partial-reinit-3.rs                   (NOTE: partial reinit misreported as potential use)
compile-fail/borrowck/borrowck-partial-reinit-4.rs                   (NOTE: partial reinit misreported as potential use)
compile-fail/borrowck/borrowck-return-variable-on-stack-via-clone.rs (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-unary-move.rs                         (NOTE: (Mir) reported additional spurious move(s))
compile-fail/borrowck/borrowck-uninit-in-assignop.rs                 (NOTE: (Mir) has double-reports, perhaps from assign-op desugar?)

False Successes

compile-fail/borrowck/borrowck-box-insensitivity.rs                (NOTE: (Mir) is not assigning blame to place where (Ast) does)
compile-fail/borrowck/borrowck-init-in-fru.rs                      (NOTE: (Mir) completely misses the error!)
compile-fail/borrowck/borrowck-union-borrow-nested.rs              (NOTE: (Mir) completely misses the error!)
compile-fail/borrowck/borrowck-union-borrow.rs                     (NOTE: (Mir) emits far fewer errrors than (Ast), suspicious)
compile-fail/borrowck/borrowck-union-move.rs                       (NOTE: (Mir) emits far fewer errrors than (Ast), suspicious)
compile-fail/borrowck/borrowck-union-uninitialized.rs              (NOTE: (Mir) completely misses the error!)
compile-fail/borrowck/borrowck-use-in-index-lvalue.rs              (NOTE: (Mir) completely misses the error!)
compile-fail/borrowck/borrowck-use-uninitialized-in-cast.rs        (NOTE: (Mir) completely misses the error!)
compile-fail/borrowck/borrowck-use-uninitialized-in-cast-trait.rs  (NOTE: (Mir) completely misses the error!)
compile-fail/borrowck/borrowck-vec-pattern-element-loan.rs         (NOTE: (Mir) is not assigning blame to place where (Ast) does)
compile-fail/borrowck/borrowck-vec-pattern-move-tail.rs            (NOTE: (Mir) completely misses the error!)



Potentially not borrowck concern

compile-fail/borrowck/borrowck-argument.rs
compile-fail/borrowck/borrowck-auto-mut-ref-to-immut-var.rs
compile-fail/borrowck/borrowck-borrow-from-temporary.rs
compile-fail/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs
compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref.rs
compile-fail/borrowck/borrowck-borrow-overloaded-deref.rs
compile-fail/borrowck/borrowck-mut-addr-of-imm-var.rs
compile-fail/borrowck/borrowck-mutate-in-guard.rs
compile-fail/borrowck/borrowck-mut-slice-of-imm-vec.rs
compile-fail/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs
compile-fail/borrowck/borrowck-ref-mut-of-imm.rs
compile-fail/borrowck/borrowck-union-move-assign.rs

Unaccounted For (e.g. not seeing expected "(Ast)"/"(Mir)" suffix)

compile-fail/borrowck/borrowck-assign-to-constants.rs              (NOTE: (Mir) reported correctly)
compile-fail/borrowck/borrowck-borrowed-uniq-rvalue-2.rs           (NOTE: at least some (Mir) reported correctly; some (Ast) reports missing)
compile-fail/borrowck/borrowck-borrowed-uniq-rvalue.rs
compile-fail/borrowck/borrowck-consume-unsize-vec.rs
compile-fail/borrowck/borrowck-consume-upcast-box.rs
compile-fail/borrowck/borrowck-escaping-closure-error-1.rs
compile-fail/borrowck/borrowck-escaping-closure-error-2.rs
compile-fail/borrowck/borrowck-field-sensitivity.rs                (NOTE: errors reported in differing orders. Paths like `x.b` reported as such in (Ast), but as `x.1` in (Mir).)
compile-fail/borrowck/borrowck-fn-in-const-c.rs
compile-fail/borrowck/borrowck-loan-in-overloaded-op.rs            (NOTE: (Mir) fails to report the location where value moved, and the ast result is missing (Ast) suffix)
compile-fail/borrowck/borrowck-move-from-unsafe-ptr.rs
compile-fail/borrowck/borrowck-move-moved-value-into-closure.rs
compile-fail/borrowck/borrowck-multiple-captures.rs

"Fixes"

compile-fail/borrowck/borrowck-overloaded-call.rs                  (NOTE: double-report from Ast is correctly reduced to one in Mir)
compile-fail/borrowck/borrowck-unboxed-closures.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment