rust/src/test/ui/nll
David Wood 299a452a75
Ignore never-initialized locals for unused_mut.
This commit filters out locals that have never been initialized for
consideration in the `unused_mut` lint.

This is intended to detect when the statement that would have
initialized the local was removed as unreachable code. In these cases,
we would not want to lint. This is the same behaviour as the AST borrow
checker.

This is achieved by taking advantage of an existing pass over the MIR
for the `unused_mut` lint and creating a set of those locals that were
never initialized.
2018-11-07 16:10:40 +01:00
..
closure-requirements stop reporting "unsatisfied lifetime bounds" errors after the first 2018-10-22 11:41:46 -04:00
relate_tys Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
ty-outlives Update output for borrowck=migrate compare mode. 2018-10-17 00:57:32 +02:00
user-annotations allow canonicalized regions to carry universe and track max-universe 2018-10-27 09:06:01 -04:00
borrow-use-issue-46875.rs Make killing of out-of-scope borrows a pre-statement effect 2017-12-24 14:56:52 +02:00
borrowck-thread-local-static-mut-borrow-outlives-fn.rs Add regression test for thread local static mut borrows 2018-09-19 17:54:24 -03:00
borrowed-local-error.rs Remove nll-dump-cause flag and always track causes 2018-03-06 10:34:46 -03:00
borrowed-local-error.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
borrowed-match-issue-45045.rs Update ui tests 2018-09-24 23:33:13 +01:00
borrowed-match-issue-45045.stderr Update ui tests 2018-09-24 23:33:13 +01:00
borrowed-referent-issue-38899.rs remove unnecessary compile-flags comments 2018-01-12 10:38:28 -05:00
borrowed-referent-issue-38899.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
borrowed-temporary-error.rs Change the diagnostic number from 714 to 716. 2018-09-25 15:23:57 +01:00
borrowed-temporary-error.stderr Change the diagnostic number from 714 to 716. 2018-09-25 15:23:57 +01:00
borrowed-universal-error-2.rs Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
borrowed-universal-error-2.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
borrowed-universal-error.rs Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
borrowed-universal-error.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
cannot-move-block-spans.nll.stderr Don't emit cannot move errors twice in migrate mode 2018-10-29 20:22:01 +00:00
cannot-move-block-spans.rs Use better spans for cannot-move errors 2018-07-26 22:06:12 +01:00
cannot-move-block-spans.stderr Use better spans for cannot-move errors 2018-07-26 22:06:12 +01:00
capture-mut-ref.rs Fix various nll unused mut errors 2018-07-03 20:12:09 +01:00
capture-mut-ref.stderr Fix various nll unused mut errors 2018-07-03 20:12:09 +01:00
capture-ref-in-struct.rs Remove nll-dump-cause flag and always track causes 2018-03-06 10:34:46 -03:00
capture-ref-in-struct.stderr Don't match on region kinds when reporting NLL errors 2018-07-23 20:54:09 +01:00
closure-access-spans.rs Tests for closure spans 2018-08-03 23:00:27 +01:00
closure-access-spans.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
closure-borrow-spans.rs Tests for closure spans 2018-08-03 23:00:27 +01:00
closure-borrow-spans.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
closure-captures.rs Update tests for new spans for nll errors involving closures 2018-08-03 23:00:27 +01:00
closure-captures.stderr Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
closure-move-spans.rs Tests for closure spans 2018-08-03 23:00:27 +01:00
closure-move-spans.stderr Tests for closure spans 2018-08-03 23:00:27 +01:00
closure-use-spans.rs Tests for closure spans 2018-08-03 23:00:27 +01:00
closure-use-spans.stderr Tests for closure spans 2018-08-03 23:00:27 +01:00
closures-in-loops.rs Tests for closure spans 2018-08-03 23:00:27 +01:00
closures-in-loops.stderr Test fixes for the change of error message for issue #54015 2018-09-28 09:25:14 -07:00
constant-thread-locals-issue-47053.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
constant-thread-locals-issue-47053.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
constant.rs For some reason, on my linux box, using -Zverbose here is causing a linker failure. 2018-07-20 14:26:44 +02:00
decl-macro-illegal-copy.rs Regression test for #46314 2018-04-04 11:36:38 +03:00
decl-macro-illegal-copy.stderr Regression test for #46314 2018-04-04 11:36:38 +03:00
do-not-ignore-lifetime-bounds-in-copy.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
do-not-ignore-lifetime-bounds-in-copy.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
drop-may-dangle.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
drop-no-may-dangle.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
drop-no-may-dangle.stderr Updates to .stderr output in ui tests from earlier changes. 2018-10-05 12:04:53 +02:00
enum-drop-access.rs Rework checking for borrows conflicting with drops 2018-09-23 20:27:41 +01:00
enum-drop-access.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
extra-unused-mut.rs Don't make "fake" match variables mutable 2018-07-28 21:18:34 +01:00
generator-distinct-lifetime.rs Rename must-compile-successfully into compile-pass 2018-04-13 23:28:03 +02:00
generator-upvar-mutability.rs Fix various nll unused mut errors 2018-07-03 20:12:09 +01:00
generator-upvar-mutability.stderr Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
get_default.nll.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
get_default.rs ignore the point where the outlives requirement was added 2018-05-09 23:21:24 -03:00
get_default.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
guarantor-issue-46974.rs Updated other tests affected by change. 2018-01-10 19:12:57 +00:00
guarantor-issue-46974.stderr #52413: addressed @estebank's Nit 2018-08-06 17:56:24 +00:00
issue-16223.rs Rename must-compile-successfully into compile-pass 2018-04-13 23:28:03 +02:00
issue-21114-ebfull.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-21114-kixunil.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-21232-partial-init-and-erroneous-use.rs Some new tests I added. 2018-10-17 02:33:03 +02:00
issue-21232-partial-init-and-erroneous-use.stderr Some new tests I added. 2018-10-17 02:33:03 +02:00
issue-21232-partial-init-and-use.rs fix typos in various places 2018-10-23 15:56:25 +02:00
issue-21232-partial-init-and-use.stderr Some new tests I added. 2018-10-17 02:33:03 +02:00
issue-22323-temp-destruction.rs Regression test for rust-lang/rust#22323. 2018-09-19 14:33:11 +02:00
issue-27868.rs [nll] add regression test for issue #27868 2018-08-13 22:45:02 -04:00
issue-27868.stderr [nll] add regression test for issue #27868 2018-08-13 22:45:02 -04:00
issue-30104.rs Add regression test for issue #30104 2018-08-14 10:26:47 -04:00
issue-31567.rs Updates to tests reflecting the diangostic changes in previous commit. 2018-09-18 02:06:45 +02:00
issue-31567.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
issue-32382-index-assoc-type-with-lifetime.rs Regression test for #32382. 2018-10-04 13:03:24 +02:00
issue-43058.rs Rename must-compile-successfully into compile-pass 2018-04-13 23:28:03 +02:00
issue-47022.rs Rename must-compile-successfully into compile-pass 2018-04-13 23:28:03 +02:00
issue-47388.rs fix ui test 2018-04-06 23:03:20 +05:30
issue-47388.stderr NLL: Updates to diagnostic output in test/ui. 2018-06-19 19:38:37 +02:00
issue-47470.rs Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
issue-47470.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
issue-48070.rs Move 48070 test to ui 2018-03-13 14:52:11 -04:00
issue-48238.rs write code to extract region names and emit new style message 2018-07-04 05:09:33 -04:00
issue-48238.stderr Update tests 2018-08-14 20:35:47 +01:00
issue-48697.rs Add regression test for issue #48697 2018-08-14 10:25:54 -04:00
issue-50716-1.rs Fix the error of selecting obligation by not running the borrow checker. 2018-06-27 18:14:00 +02:00
issue-50716.rs write code to extract region names and emit new style message 2018-07-04 05:09:33 -04:00
issue-50716.stderr Update ui tests 2018-09-19 20:50:09 +01:00
issue-51191.rs Rewrite the UnconditionalRecursion lint to use MIR 2018-10-03 21:29:07 -04:00
issue-51191.stderr Rewrite the UnconditionalRecursion lint to use MIR 2018-10-03 21:29:07 -04:00
issue-51244.rs Bless tests and update ERROR 2018-07-12 22:51:30 -07:00
issue-51244.stderr Bless tests and update ERROR 2018-07-12 22:51:30 -07:00
issue-51268.rs Fix variable name in E0502 double borrow error 2018-06-20 09:04:52 -03:00
issue-51268.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
issue-51351.rs fix issues #51351 and #52133 2018-07-29 11:42:50 +01:00
issue-51512.rs updates to expected output for other ui tests. 2018-10-16 17:11:36 +02:00
issue-51512.stderr updates to expected output for other ui tests. 2018-10-16 17:11:36 +02:00
issue-52059-report-when-borrow-and-drop-conflict.rs fix typos in various places 2018-10-23 15:56:25 +02:00
issue-52059-report-when-borrow-and-drop-conflict.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
issue-52078.rs add regression test for #52078 2018-07-21 15:56:47 +03:00
issue-52086.rs Add special cases for move from Rc/Arc errors. 2018-10-01 13:50:22 +02:00
issue-52086.stderr Add special cases for move from Rc/Arc errors. 2018-10-01 13:50:22 +02:00
issue-52113.rs Update ui tests 2018-09-19 20:50:09 +01:00
issue-52113.stderr Update ui tests 2018-09-19 20:50:09 +01:00
issue-52534-1.rs Correctly handle named lifetimes. 2018-09-23 14:18:35 +02:00
issue-52534-1.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
issue-52534-2.rs Only annotate if borrow is returned. 2018-09-23 14:18:35 +02:00
issue-52534-2.stderr Only annotate if borrow is returned. 2018-09-23 14:18:35 +02:00
issue-52534.rs Added multiple parameter closure test. 2018-09-23 14:18:34 +02:00
issue-52534.stderr Only annotate if borrow is returned. 2018-09-23 14:18:35 +02:00
issue-52663-span-decl-captured-variable.rs Improved how upvars are detected when presenting errors using prefixes. 2018-08-14 18:38:57 +02:00
issue-52663-span-decl-captured-variable.stderr Improved how upvars are detected when presenting errors using prefixes. 2018-08-14 18:38:57 +02:00
issue-52663-trait-object.rs Update logic to search for casts. 2018-10-07 16:14:22 +02:00
issue-52663-trait-object.stderr Update logic to search for casts. 2018-10-07 16:14:22 +02:00
issue-52669.rs Inspect parents paths when checking for moves 2018-09-17 13:38:04 -03:00
issue-52669.stderr Inspect parents paths when checking for moves 2018-09-17 13:38:04 -03:00
issue-52742.rs Stabilize impl_header_lifetime_elision in 2015 2018-10-19 21:57:52 -07:00
issue-52742.stderr Stabilize impl_header_lifetime_elision in 2015 2018-10-19 21:57:52 -07:00
issue-53040.rs Improve errors for FnMut closures. 2018-10-09 12:31:47 +02:00
issue-53040.stderr Improve message for closure returning a closure. 2018-10-09 12:31:51 +02:00
issue-53119.rs Fixes #53119. 2018-08-08 08:02:47 +01:00
issue-53570.rs avoid propagating outlives obligations on locals if we can 2018-09-07 17:08:22 -04:00
issue-53807.nll.stderr Test fixes for the change of error message for issue #54015 2018-09-28 09:25:14 -07:00
issue-53807.rs De-duplicate moved variable errors. 2018-09-18 13:51:41 +02:00
issue-53807.stderr De-duplicate moved variable errors. 2018-09-18 13:51:41 +02:00
issue-54556-niconii.nll.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-niconii.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-niconii.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-stephaneyfx.nll.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-stephaneyfx.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-stephaneyfx.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-temps-in-tail-diagnostic.nll.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-temps-in-tail-diagnostic.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-temps-in-tail-diagnostic.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-used-vs-unused-tails.nll.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-used-vs-unused-tails.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-used-vs-unused-tails.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-wrap-it-up.nll.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-wrap-it-up.rs Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-54556-wrap-it-up.stderr Unit tests for issue #54556. Some were also taken from issues #21114, #46413. 2018-10-05 12:04:53 +02:00
issue-55288.rs Test for cast causing static promotion failure. 2018-10-27 12:11:02 +02:00
issue-55344.rs Ignore never-initialized locals for unused_mut. 2018-11-07 16:10:40 +01:00
loan_ends_mid_block_pair.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
loan_ends_mid_block_pair.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
loan_ends_mid_block_vec.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
loan_ends_mid_block_vec.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
match-guards-always-borrow.ast.nll.stderr Don't emit cannot move errors twice in migrate mode 2018-10-29 20:22:01 +00:00
match-guards-always-borrow.ast.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
match-guards-always-borrow.mir.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
match-guards-always-borrow.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
match-guards-partially-borrow.rs Prefer #![feature(bind_by_move_pattern_guards)] over -Z disable_ast_check_for_mutation_in_guard 2018-09-28 15:40:10 +02:00
match-guards-partially-borrow.stderr Add tests for new match borrows 2018-09-24 23:33:13 +01:00
match-on-borrowed.rs Add tests for new match borrows 2018-09-24 23:33:13 +01:00
match-on-borrowed.stderr Add tests for new match borrows 2018-09-24 23:33:13 +01:00
maybe-initialized-drop-implicit-fragment-drop.rs implement liveness tracing, remove old liveness system 2018-08-27 13:57:55 -04:00
maybe-initialized-drop-implicit-fragment-drop.stderr Updates to .stderr output in ui tests from earlier changes. 2018-10-05 12:04:53 +02:00
maybe-initialized-drop-uninitialized.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
maybe-initialized-drop-with-fragment.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
maybe-initialized-drop-with-fragment.stderr Updates to .stderr output in ui tests from earlier changes. 2018-10-05 12:04:53 +02:00
maybe-initialized-drop-with-uninitialized-fragments.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
maybe-initialized-drop-with-uninitialized-fragments.stderr Updates to .stderr output in ui tests from earlier changes. 2018-10-05 12:04:53 +02:00
maybe-initialized-drop.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
maybe-initialized-drop.stderr Updates to .stderr output in ui tests from earlier changes. 2018-10-05 12:04:53 +02:00
mir_check_cast_closure.rs Update tests 2018-09-01 12:58:18 +02:00
mir_check_cast_closure.stderr Update tests 2018-09-01 12:58:18 +02:00
mir_check_cast_reify.rs Update ui tests 2018-09-19 20:50:09 +01:00
mir_check_cast_reify.stderr Update ui tests 2018-09-19 20:50:09 +01:00
mir_check_cast_unsafe_fn.rs Update ui tests 2018-09-19 20:50:09 +01:00
mir_check_cast_unsafe_fn.stderr Update ui tests 2018-09-19 20:50:09 +01:00
mir_check_cast_unsize.rs Update tests 2018-09-01 12:58:18 +02:00
mir_check_cast_unsize.stderr Update ui tests 2018-09-19 20:50:09 +01:00
move-errors.rs Update tests for grouped nll move errors 2018-06-27 22:46:58 +01:00
move-errors.stderr Add special cases for move from Rc/Arc errors. 2018-10-01 13:50:22 +02:00
move-subpaths-moves-root.rs Inspect parents paths when checking for moves 2018-09-17 13:38:04 -03:00
move-subpaths-moves-root.stderr Inspect parents paths when checking for moves 2018-09-17 13:38:04 -03:00
normalization-bounds-error.rs Register outlives predicates from queries the right way around. 2018-05-31 20:40:25 +01:00
normalization-bounds-error.stderr Point to lifetime in fn definition on lifetime error note 2018-06-28 11:12:42 -07:00
normalization-bounds.rs Register outlives predicates from queries the right way around. 2018-05-31 20:40:25 +01:00
polonius-smoke-test.rs Get Polonius borrow check to work in simple cases 2018-09-26 22:03:56 +01:00
polonius-smoke-test.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
projection-return.rs remove -Znll -- borrowck=mir implies nll now 2018-04-15 07:13:42 -04:00
promotable-mutable-zst-doesnt-conflict.rs Allow borrow conflicts for promoted length 0 arrays 2018-07-31 21:35:22 +01:00
reference-carried-through-struct-field.ast.nll.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
reference-carried-through-struct-field.ast.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
reference-carried-through-struct-field.mir.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
reference-carried-through-struct-field.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
region-ends-after-if-condition.nll.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
region-ends-after-if-condition.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
region-ends-after-if-condition.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
return-ref-mut-issue-46557.rs Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
return-ref-mut-issue-46557.stderr Use new region infer errors for explaining borrows 2018-10-21 12:35:00 +01:00
return_from_loop.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
return_from_loop.stderr Clearer later use messages for calls 2018-10-03 20:32:38 +01:00
trait-associated-constant.rs mir: Fix DefiningTy::Const 2018-02-06 23:42:05 -05:00
trait-associated-constant.stderr Extend support to get_generics for all NodeItems 2018-06-28 11:12:43 -07:00
type-alias-free-regions.rs Don't try to use a path to a type alias as a path to the adt it aliases 2018-09-19 19:52:55 +01:00
type-alias-free-regions.stderr Don't try to use a path to a type alias as a path to the adt it aliases 2018-09-19 19:52:55 +01:00
unused-mut-issue-50343.rs Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
unused-mut-issue-50343.stderr Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
where_clauses_in_functions.rs Update tests 2018-09-01 12:58:18 +02:00
where_clauses_in_functions.stderr Prefer type annotations and returns in free region errors 2018-10-20 23:11:30 +01:00
where_clauses_in_structs.rs Update tests 2018-09-01 12:58:18 +02:00
where_clauses_in_structs.stderr Update tests 2018-09-01 12:58:18 +02:00