From c2d44b2286ecf84103e2c66237f578212cd9d8fe Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Sat, 30 Jun 2018 22:08:27 -0700 Subject: in which the private/restricted-in-public error messaging gets specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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/test/ui/error-codes/E0446.stderr | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/test/ui/error-codes') diff --git a/src/test/ui/error-codes/E0446.stderr b/src/test/ui/error-codes/E0446.stderr index bb5ae494d6c..6c7f3785464 100644 --- a/src/test/ui/error-codes/E0446.stderr +++ b/src/test/ui/error-codes/E0446.stderr @@ -1,6 +1,9 @@ error[E0446]: private type `Foo::Bar` in public interface --> $DIR/E0446.rs:14:5 | +LL | struct Bar(u32); + | - `Foo::Bar` declared as private +LL | LL | / pub fn bar() -> Bar { //~ ERROR E0446 LL | | Bar(0) LL | | } -- cgit 1.4.1-3-g733a5