rust/tests/ui/reachable
Esteban Küber 7dffd24da5 Tweak privacy errors to account for reachable items
Suggest publicly accessible paths for items in private mod:

  When encountering a path in non-import situations that are not reachable
  due to privacy constraints, search for any public re-exports that the
  user could use instead.

Track whether an import suggestion is offering a re-export.

When encountering a path with private segments, mention if the item at
the final path segment is not publicly accessible at all.

Add item visibility metadata to privacy errors from imports:

  On unreachable imports, record the item that was being imported in order
  to suggest publicly available re-exports or to be explicit that the item
  is not available publicly from any path.

  In order to allow this, we add a mode to `resolve_path` that will not
  add new privacy errors, nor return early if it encounters one. This way
  we can get the `Res` corresponding to the final item in the import,
  which is used in the privacy error machinery.
2023-06-22 16:50:31 +00:00
..
auxiliary test for reachable private impl 2023-05-08 21:44:21 +00:00
expr_add.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_add.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_again.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_again.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_andand.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_array.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_array.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_assign.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_assign.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_block.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_block.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_call.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_call.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_cast.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_cast.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_if.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_if.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_loop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_loop.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_match.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_match.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_method.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_method.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_oror.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_repeat.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_repeat.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_return_in_macro.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_return_in_macro.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_return.rs Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
expr_return.stderr Adjust UI tests for unit_bindings 2023-06-12 20:24:48 +08:00
expr_struct.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_struct.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_tup.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_tup.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_type.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_type.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_unary.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_unary.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_while.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
expr_while.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
foreign-priv.rs test for reachable private impl 2023-05-08 21:44:21 +00:00
issue-948.rs Move tests 2023-05-08 17:58:01 -03:00
issue-11225-1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11225-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11225-3.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
reachable-unnameable-type-alias.rs Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
README.md Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-arm.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-arm.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-code-ret.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-code-ret.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-code.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-code.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-in-call.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-in-call.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-loop-patterns.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-loop-patterns.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-try-pattern.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-try-pattern.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-variant.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unreachable-variant.stderr Tweak privacy errors to account for reachable items 2023-06-22 16:50:31 +00:00
unwarned-match-on-never.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unwarned-match-on-never.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00

A variety of tests around reachability. These tests in general check two things:

  • that we get unreachable code warnings in reasonable locations;
  • that we permit coercions into ! from expressions which diverge, where an expression "diverges" if it must execute some subexpression of type !, or it has type ! itself.