about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-03 07:35:33 +0000
committerbors <bors@rust-lang.org>2023-09-03 07:35:33 +0000
commitf2568c8316805749fe616e3de08c3f7c2bec3680 (patch)
tree62acd3e15506a4b53b29a70b7882c0c2fa0352b4 /compiler/rustc_error_codes/src
parentd2f5dc9745defa7cb90a88dd8adc7d347f42d0bc (diff)
parentfb26c21c356075c0cd35d98fa0b786b7633249d8 (diff)
downloadrust-f2568c8316805749fe616e3de08c3f7c2bec3680.tar.gz
rust-f2568c8316805749fe616e3de08c3f7c2bec3680.zip
Auto merge of #3050 - RalfJung:rustup, r=RalfJung
Rustup
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes.rs1
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0445.md8
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0446.md46
3 files changed, 30 insertions, 25 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs
index 2daf591bd65..89c44c6ec8a 100644
--- a/compiler/rustc_error_codes/src/error_codes.rs
+++ b/compiler/rustc_error_codes/src/error_codes.rs
@@ -608,6 +608,7 @@ E0794: include_str!("./error_codes/E0794.md"),
 //  E0420, // merged into 532
 //  E0421, // merged into 531
 //  E0427, // merged into 530
+//  E0445, // merged into 446 and type privacy lints
 //  E0456, // plugin `..` is not available for triple `..`
 //  E0465, // removed: merged with E0464
 //  E0467, // removed
diff --git a/compiler/rustc_error_codes/src/error_codes/E0445.md b/compiler/rustc_error_codes/src/error_codes/E0445.md
index e6a28a9c2c4..d47393194c5 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0445.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0445.md
@@ -1,10 +1,10 @@
-A private trait was used on a public type parameter bound.
+#### Note: this error code is no longer emitted by the compiler.
 
-Erroneous code examples:
+A private trait was used on a public type parameter bound.
 
-```compile_fail,E0445
-#![deny(private_in_public)]
+Previously erroneous code examples:
 
+```
 trait Foo {
     fn dummy(&self) { }
 }
diff --git a/compiler/rustc_error_codes/src/error_codes/E0446.md b/compiler/rustc_error_codes/src/error_codes/E0446.md
index 6ec47c4962c..ebbd83c683c 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0446.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0446.md
@@ -1,16 +1,16 @@
-A private type was used in a public type signature.
+A private type or trait was used in a public associated type signature.
 
 Erroneous code example:
 
 ```compile_fail,E0446
-#![deny(private_in_public)]
-struct Bar(u32);
-
-mod foo {
-    use crate::Bar;
-    pub fn bar() -> Bar { // error: private type in public interface
-        Bar(0)
-    }
+struct Bar;
+
+pub trait PubTr {
+    type Alias;
+}
+
+impl PubTr for u8 {
+    type Alias = Bar; // error private type in public interface
 }
 
 fn main() {}
@@ -22,13 +22,14 @@ This is done by using pub(crate) or pub(in crate::my_mod::etc)
 Example:
 
 ```
-struct Bar(u32);
+struct Bar;
+
+pub(crate) trait PubTr { // only public to crate root
+    type Alias;
+}
 
-mod foo {
-    use crate::Bar;
-    pub(crate) fn bar() -> Bar { // only public to crate root
-        Bar(0)
-    }
+impl PubTr for u8 {
+    type Alias = Bar;
 }
 
 fn main() {}
@@ -38,12 +39,15 @@ The other way to solve this error is to make the private type public.
 Example:
 
 ```
-pub struct Bar(u32); // we set the Bar type public
-mod foo {
-    use crate::Bar;
-    pub fn bar() -> Bar { // ok!
-        Bar(0)
-    }
+
+pub struct Bar; // we set the Bar trait public
+
+pub trait PubTr {
+    type Alias;
+}
+
+impl PubTr for u8 {
+    type Alias = Bar;
 }
 
 fn main() {}