summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2019-12-06 15:37:03 +0900
committerGitHub <noreply@github.com>2019-12-06 15:37:03 +0900
commitc31773cece7b33b6bbb683e9e122084deb0ac260 (patch)
tree94896a47d2d928004aec65cc16560391829e0649
parentRollup merge of #66764 - estebank:reword-bad-collect, r=alexcrichton (diff)
parentclean up E0107 error explanation (diff)
downloadrust-c31773cece7b33b6bbb683e9e122084deb0ac260.tar.gz
rust-c31773cece7b33b6bbb683e9e122084deb0ac260.tar.bz2
rust-c31773cece7b33b6bbb683e9e122084deb0ac260.tar.xz
Rollup merge of #66900 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
Clean up error codes r? @Dylan-DPC
-rw-r--r--src/librustc_error_codes/error_codes/E0092.md7
-rw-r--r--src/librustc_error_codes/error_codes/E0093.md8
-rw-r--r--src/librustc_error_codes/error_codes/E0094.md3
-rw-r--r--src/librustc_error_codes/error_codes/E0106.md4
-rw-r--r--src/librustc_error_codes/error_codes/E0107.md23
5 files changed, 33 insertions, 12 deletions
diff --git a/src/librustc_error_codes/error_codes/E0092.md b/src/librustc_error_codes/error_codes/E0092.md
index 2750a7d..e289534 100644
--- a/src/librustc_error_codes/error_codes/E0092.md
+++ b/src/librustc_error_codes/error_codes/E0092.md
@@ -1,4 +1,5 @@
1You tried to declare an undefined atomic operation function. 1An undefined atomic operation function was declared.
2
2Erroneous code example: 3Erroneous code example:
3 4
4```compile_fail,E0092 5```compile_fail,E0092
@@ -11,8 +12,8 @@ extern "rust-intrinsic" {
11``` 12```
12 13
13Please check you didn't make a mistake in the function's name. All intrinsic 14Please check you didn't make a mistake in the function's name. All intrinsic
14functions are defined in librustc_codegen_llvm/intrinsic.rs and in 15functions are defined in `librustc_codegen_llvm/intrinsic.rs` and in
15libcore/intrinsics.rs in the Rust source code. Example: 16`libcore/intrinsics.rs` in the Rust source code. Example:
16 17
17``` 18```
18#![feature(intrinsics)] 19#![feature(intrinsics)]
diff --git a/src/librustc_error_codes/error_codes/E0093.md b/src/librustc_error_codes/error_codes/E0093.md
index 9633f79..8e7de1a 100644
--- a/src/librustc_error_codes/error_codes/E0093.md
+++ b/src/librustc_error_codes/error_codes/E0093.md
@@ -1,4 +1,6 @@
1You declared an unknown intrinsic function. Erroneous code example: 1An unknown intrinsic function was declared.
2
3Erroneous code example:
2 4
3```compile_fail,E0093 5```compile_fail,E0093
4#![feature(intrinsics)] 6#![feature(intrinsics)]
@@ -15,8 +17,8 @@ fn main() {
15``` 17```
16 18
17Please check you didn't make a mistake in the function's name. All intrinsic 19Please check you didn't make a mistake in the function's name. All intrinsic
18functions are defined in librustc_codegen_llvm/intrinsic.rs and in 20functions are defined in `librustc_codegen_llvm/intrinsic.rs` and in
19libcore/intrinsics.rs in the Rust source code. Example: 21`libcore/intrinsics.rs` in the Rust source code. Example:
20 22
21``` 23```
22#![feature(intrinsics)] 24#![feature(intrinsics)]
diff --git a/src/librustc_error_codes/error_codes/E0094.md b/src/librustc_error_codes/error_codes/E0094.md
index 4d27f61..42baa65 100644
--- a/src/librustc_error_codes/error_codes/E0094.md
+++ b/src/librustc_error_codes/error_codes/E0094.md
@@ -1,4 +1,5 @@
1You gave an invalid number of type parameters to an intrinsic function. 1An invalid number of type parameters was given to an intrinsic function.
2
2Erroneous code example: 3Erroneous code example:
3 4
4```compile_fail,E0094 5```compile_fail,E0094
diff --git a/src/librustc_error_codes/error_codes/E0106.md b/src/librustc_error_codes/error_codes/E0106.md
index 8a49c1f..60ca1dd 100644
--- a/src/librustc_error_codes/error_codes/E0106.md
+++ b/src/librustc_error_codes/error_codes/E0106.md
@@ -2,7 +2,7 @@ This error indicates that a lifetime is missing from a type. If it is an error
2inside a function signature, the problem may be with failing to adhere to the 2inside a function signature, the problem may be with failing to adhere to the
3lifetime elision rules (see below). 3lifetime elision rules (see below).
4 4
5Here are some simple examples of where you'll run into this error: 5Erroneous code examples:
6 6
7```compile_fail,E0106 7```compile_fail,E0106
8struct Foo1 { x: &bool } 8struct Foo1 { x: &bool }
@@ -27,7 +27,7 @@ function signatures which allows you to leave out lifetimes in certain cases.
27For more background on lifetime elision see [the book][book-le]. 27For more background on lifetime elision see [the book][book-le].
28 28
29The lifetime elision rules require that any function signature with an elided 29The lifetime elision rules require that any function signature with an elided
30output lifetime must either have 30output lifetime must either have:
31 31
32 - exactly one input lifetime 32 - exactly one input lifetime
33 - or, multiple input lifetimes, but the function must also be a method with a 33 - or, multiple input lifetimes, but the function must also be a method with a
diff --git a/src/librustc_error_codes/error_codes/E0107.md b/src/librustc_error_codes/error_codes/E0107.md
index bfe0d21..4d22b17 100644
--- a/src/librustc_error_codes/error_codes/E0107.md
+++ b/src/librustc_error_codes/error_codes/E0107.md
@@ -1,4 +1,6 @@
1This error means that an incorrect number of generic arguments were provided: 1An incorrect number of generic arguments were provided.
2
3Erroneous code example:
2 4
3```compile_fail,E0107 5```compile_fail,E0107
4struct Foo<T> { x: T } 6struct Foo<T> { x: T }
@@ -9,6 +11,7 @@ struct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:
9 // expected 1, found 2 11 // expected 1, found 2
10 12
11fn foo<T, U>(x: T, y: U) {} 13fn foo<T, U>(x: T, y: U) {}
14fn f() {}
12 15
13fn main() { 16fn main() {
14 let x: bool = true; 17 let x: bool = true;
@@ -16,12 +19,26 @@ fn main() {
16 // expected 2, found 1 19 // expected 2, found 1
17 foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments: 20 foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:
18 // expected 2, found 3 21 // expected 2, found 3
22 f::<'static>(); // error: wrong number of lifetime arguments
23 // expected 0, found 1
19} 24}
25```
26
27When using/declaring an item with generic arguments, you must provide the exact
28same number:
29
30```
31struct Foo<T> { x: T }
32
33struct Bar<T> { x: Foo<T> } // ok!
34struct Baz<S, T> { x: Foo<S>, y: Foo<T> } // ok!
20 35
36fn foo<T, U>(x: T, y: U) {}
21fn f() {} 37fn f() {}
22 38
23fn main() { 39fn main() {
24 f::<'static>(); // error: wrong number of lifetime arguments: 40 let x: bool = true;
25 // expected 0, found 1 41 foo::<bool, u32>(x, 12); // ok!
42 f(); // ok!
26} 43}
27``` 44```