]> git.lizzy.rs Git - rust.git/commit
in which the private/restricted-in-public error messaging gets specific
authorZack M. Davis <code@zackmdavis.net>
Sun, 1 Jul 2018 05:08:27 +0000 (22:08 -0700)
committerZack M. Davis <code@zackmdavis.net>
Sun, 1 Jul 2018 05:48:05 +0000 (22:48 -0700)
commitc2d44b2286ecf84103e2c66237f578212cd9d8fe
tree33b09018beaa22f2cfcb029bb1144d99db704d2d
parent8d1cbb018e7643e9e8d1d25b8b7de8a2b0671f2d
in which the private/restricted-in-public error messaging gets specific

April 2016's Issue #33174 called out the E0446 diagnostics as
confusing. While adding the name of the restricted type to the message
(548e681f) clarified matters somewhat, Esteban Küber pointed out that we
could stand to place a secondary span on the restricted type.

Here, we differentiate between crate-visible, truly private, and
otherwise restricted types, and place a secondary span specifically on
the visibility modifier of the restricted type's declaration (which we
can do now that HIR visibilities have spans!).

At long last, this resolves #33174.
src/librustc_privacy/lib.rs
src/test/ui/error-codes/E0446.stderr
src/test/ui/pub/issue-33174-restricted-type-in-public-interface.rs [new file with mode: 0644]
src/test/ui/pub/issue-33174-restricted-type-in-public-interface.stderr [new file with mode: 0644]