rust/src/test
bors 59d484575a Auto merge of #45569 - zackmdavis:unexported_pub_lint, r=petrochenkov
`unreachable-pub` lint (as authorized by RFC 2126)

To whom it may concern:

RFC 2126 commissions the creation of a lint for `pub` items that are not visible from crate root (#45521). We understand (but seek confirmation from more knowledgable compiler elders) that this can be implemented by linting HIR items that are _not_ ~~`cx.access_levels.is_exported`~~ `cx.access_levels.is_reachable` but have a `vis` (-ibility) field of `hir::Visibility::Public`.

The lint, tentatively called ~~`unexported-pub`~~ `unreachable-pub` (with the understanding that much could be written on the merits of various names, as it is said of the colors of bicycle-sheds), suggests `crate` as a replacement for `pub` if the `crate_visibility_modifier` feature is enabled (see #45388), and `pub(crate)` otherwise. We also use help messaging to suggest the other potential fix of exporting the item; feedback is desired as to whether this may be confusing or could be worded better.

As a preview of what respecting the proposed lint would look like (and to generate confirmatory evidence that this implementation doesn't issue false positives), ~~we take its suggestions for `libcore`~~ (save one, which is deferred to another pull request because it brings up an unrelated technical matter). I remain your obedient servant.

![unexported_pub](https://user-images.githubusercontent.com/1076988/32089794-fbd02420-baa0-11e7-87e5-3ec01f18924a.png)

r? @petrochenkov
2017-11-03 16:28:24 +00:00
..
codegen Avoid unnecessary copies of arguments that are simple bindings 2017-10-26 12:54:34 +02:00
codegen-units rustc: Handle #[inline(always)] at -O0 2017-10-11 17:12:29 -07:00
compile-fail Auto merge of #45409 - tamird:suggest-match-default-bindings, r=nikomatsakis 2017-11-02 16:28:16 +00:00
compile-fail-fulldeps Add several lints into unused lint group 2017-10-29 22:14:23 +03:00
debuginfo Implement display_hint in gdb pretty printers 2017-10-06 13:05:53 -06:00
incremental Auto merge of #45472 - michaelwoerister:incr-comp-caching-base, r=nikomatsakis 2017-11-01 14:28:11 +00:00
mir-opt patch mir-opt reference files 2017-10-31 14:02:31 -04:00
parse-fail crate shorthand visibility modifier 2017-10-22 23:58:13 -07:00
pretty Fix tests 2017-10-08 23:52:15 +09:00
run-fail rustc_typeck: use subtyping on the LHS of binops. 2017-10-31 17:34:46 +02:00
run-fail-fulldeps Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
run-make Auto merge of #45647 - nrc:rls-bugs, r=eddyb 2017-11-02 12:34:13 +00:00
run-pass Auto merge of #45435 - eddyb:binop-subtype-lhs, r=nikomatsakis 2017-11-01 09:40:15 +00:00
run-pass-fulldeps Add several lints into unused lint group 2017-10-29 22:14:23 +03:00
run-pass-valgrind Add a run-pass-valgrind test for vecdeque issue 2017-09-24 10:56:08 -07:00
rustdoc modify tests to use new flag 2017-10-17 15:38:52 -04:00
ui Auto merge of #45569 - zackmdavis:unexported_pub_lint, r=petrochenkov 2017-11-03 16:28:24 +00:00
ui-fulldeps Add several lints into unused lint group 2017-10-29 22:14:23 +03:00
COMPILER_TESTS.md Merge ui/README.md into COMPILER_TESTS.md and describe how custom UI normalization works. 2017-07-11 16:57:53 +08:00