summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes.rs4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0038.md7
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0094.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0191.md6
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0211.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0401.md6
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0445.md8
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0446.md46
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0647.md2
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0691.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0698.md4
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0760.md2
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0788.md16
13 files changed, 61 insertions, 52 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs
index d104ff089..89c44c6ec 100644
--- a/compiler/rustc_error_codes/src/error_codes.rs
+++ b/compiler/rustc_error_codes/src/error_codes.rs
@@ -516,7 +516,8 @@ E0793: include_str!("./error_codes/E0793.md"),
E0794: include_str!("./error_codes/E0794.md"),
}
-// Undocumented removed error codes. Note that many removed error codes are documented.
+// Undocumented removed error codes. Note that many removed error codes are kept in the list above
+// and marked as no-longer emitted with a note in the markdown file (see E0001 for an example).
// E0006, // merged with E0005
// E0008, // cannot bind by-move into a pattern guard
// E0019, // merged into E0015
@@ -607,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/E0038.md b/compiler/rustc_error_codes/src/error_codes/E0038.md
index 584b78554..8f8eabb15 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0038.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0038.md
@@ -162,14 +162,13 @@ fn foo<T>(x: T) {
```
The machine code for `foo::<u8>()`, `foo::<bool>()`, `foo::<String>()`, or any
-other type substitution is different. Hence the compiler generates the
+other instantiation is different. Hence the compiler generates the
implementation on-demand. If you call `foo()` with a `bool` parameter, the
compiler will only generate code for `foo::<bool>()`. When we have additional
type parameters, the number of monomorphized implementations the compiler
generates does not grow drastically, since the compiler will only generate an
-implementation if the function is called with unparameterized substitutions
-(i.e., substitutions where none of the substituted types are themselves
-parameterized).
+implementation if the function is called with fully concrete arguments
+(i.e., arguments which do not contain any generic parameters).
However, with trait objects we have to make a table containing _every_ object
that implements the trait. Now, if it has type parameters, we need to add
diff --git a/compiler/rustc_error_codes/src/error_codes/E0094.md b/compiler/rustc_error_codes/src/error_codes/E0094.md
index 67a8c3678..d8c1a3cb5 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0094.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0094.md
@@ -3,7 +3,7 @@ An invalid number of generic parameters was passed to an intrinsic function.
Erroneous code example:
```compile_fail,E0094
-#![feature(intrinsics)]
+#![feature(intrinsics, rustc_attrs)]
#![allow(internal_features)]
extern "rust-intrinsic" {
@@ -18,7 +18,7 @@ and verify with the function declaration in the Rust source code.
Example:
```
-#![feature(intrinsics)]
+#![feature(intrinsics, rustc_attrs)]
#![allow(internal_features)]
extern "rust-intrinsic" {
diff --git a/compiler/rustc_error_codes/src/error_codes/E0191.md b/compiler/rustc_error_codes/src/error_codes/E0191.md
index 46b773bdc..344ac2216 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0191.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0191.md
@@ -7,8 +7,8 @@ trait Trait {
type Bar;
}
-type Foo = Trait; // error: the value of the associated type `Bar` (from
- // the trait `Trait`) must be specified
+type Foo = dyn Trait; // error: the value of the associated type `Bar` (from
+ // the trait `Trait`) must be specified
```
Trait objects need to have all associated types specified. Please verify that
@@ -20,5 +20,5 @@ trait Trait {
type Bar;
}
-type Foo = Trait<Bar=i32>; // ok!
+type Foo = dyn Trait<Bar=i32>; // ok!
```
diff --git a/compiler/rustc_error_codes/src/error_codes/E0211.md b/compiler/rustc_error_codes/src/error_codes/E0211.md
index 70f14fffa..19a482f6c 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0211.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0211.md
@@ -4,7 +4,7 @@ You used a function or type which doesn't fit the requirements for where it was
used. Erroneous code examples:
```compile_fail
-#![feature(intrinsics)]
+#![feature(intrinsics, rustc_attrs)]
#![allow(internal_features)]
extern "rust-intrinsic" {
@@ -41,7 +41,7 @@ impl Foo {
For the first code example, please check the function definition. Example:
```
-#![feature(intrinsics)]
+#![feature(intrinsics, rustc_attrs)]
#![allow(internal_features)]
extern "rust-intrinsic" {
diff --git a/compiler/rustc_error_codes/src/error_codes/E0401.md b/compiler/rustc_error_codes/src/error_codes/E0401.md
index 4c93053d5..45d083681 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0401.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0401.md
@@ -1,4 +1,4 @@
-Inner items do not inherit type or const parameters from the functions
+Inner items do not inherit the generic parameters from the items
they are embedded in.
Erroneous code example:
@@ -32,8 +32,8 @@ fn foo<T>(x: T) {
}
```
-Items inside functions are basically just like top-level items, except
-that they can only be used from the function they are in.
+Items nested inside other items are basically just like top-level items, except
+that they can only be used from the item they are in.
There are a couple of solutions for this.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0445.md b/compiler/rustc_error_codes/src/error_codes/E0445.md
index e6a28a9c2..d47393194 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 6ec47c496..ebbd83c68 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() {}
diff --git a/compiler/rustc_error_codes/src/error_codes/E0647.md b/compiler/rustc_error_codes/src/error_codes/E0647.md
index 8ca6e777f..59bb47ba6 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0647.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0647.md
@@ -7,7 +7,7 @@ Erroneous code example:
#[start]
fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
- //^ error: start function is not allowed to have a where clause
+ //^ error: `#[start]` function is not allowed to have a where clause
0
}
```
diff --git a/compiler/rustc_error_codes/src/error_codes/E0691.md b/compiler/rustc_error_codes/src/error_codes/E0691.md
index 483c74c0f..a5bedd61e 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0691.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0691.md
@@ -1,9 +1,11 @@
+#### Note: this error code is no longer emitted by the compiler.
+
A struct, enum, or union with the `repr(transparent)` representation hint
contains a zero-sized field that requires non-trivial alignment.
Erroneous code example:
-```compile_fail,E0691
+```ignore (error is no longer emitted)
#![feature(repr_align)]
#[repr(align(32))]
diff --git a/compiler/rustc_error_codes/src/error_codes/E0698.md b/compiler/rustc_error_codes/src/error_codes/E0698.md
index 3ba992a84..9bc652e64 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0698.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0698.md
@@ -1,9 +1,11 @@
+#### Note: this error code is no longer emitted by the compiler.
+
When using generators (or async) all type variables must be bound so a
generator can be constructed.
Erroneous code example:
-```edition2018,compile_fail,E0698
+```edition2018,compile_fail,E0282
async fn bar<T>() -> () {}
async fn foo() {
diff --git a/compiler/rustc_error_codes/src/error_codes/E0760.md b/compiler/rustc_error_codes/src/error_codes/E0760.md
index 85e5faada..9c4739f0d 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0760.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0760.md
@@ -5,7 +5,7 @@ or `Self` that references lifetimes from a parent scope.
Erroneous code example:
-```compile_fail,edition2018
+```ignore,edition2018
struct S<'a>(&'a i32);
impl<'a> S<'a> {
diff --git a/compiler/rustc_error_codes/src/error_codes/E0788.md b/compiler/rustc_error_codes/src/error_codes/E0788.md
index d26f9b594..d655e51fa 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0788.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0788.md
@@ -1,4 +1,4 @@
-A `#[no_coverage]` attribute was applied to something which does not show up
+A `#[coverage]` attribute was applied to something which does not show up
in code coverage, or is too granular to be excluded from the coverage report.
For now, this attribute can only be applied to function, method, and closure
@@ -9,18 +9,18 @@ will just emit an `unused_attributes` lint instead of this error.
Example of erroneous code:
```compile_fail,E0788
-#[no_coverage]
+#[coverage(off)]
struct Foo;
-#[no_coverage]
+#[coverage(on)]
const FOO: Foo = Foo;
```
-`#[no_coverage]` tells the compiler to not generate coverage instrumentation for
-a piece of code when the `-C instrument-coverage` flag is passed. Things like
-structs and consts are not coverable code, and thus cannot do anything with this
-attribute.
+`#[coverage(off)]` tells the compiler to not generate coverage instrumentation
+for a piece of code when the `-C instrument-coverage` flag is passed. Things
+like structs and consts are not coverable code, and thus cannot do anything
+with this attribute.
If you wish to apply this attribute to all methods in an impl or module,
manually annotate each method; it is not possible to annotate the entire impl
-with a `#[no_coverage]` attribute.
+with a `#[coverage]` attribute.