Skip to content

Commit 9593637

Browse files
committed
Auto merge of #43709 - zackmdavis:de-orphan_extended_information, r=GuillaumeGomez
de-orphan extended information Bizarrely, librustc_passes, librustc_plugin, librustc_mir, and libsyntax [weren't getting their error explanations registered](#35284) (leaving _several_ error codes absent from [the index](https://doc.rust-lang.org/nightly/error-index.html) and `--explain`). This surfaced a few latent doctest failures that were fixed where readily possible and ignored (with a recorded excuse) if not. Also, we don't issue E0563 anymore. r? @GuillaumeGomez
2 parents 3de807a + 75b7a6f commit 9593637

File tree

9 files changed

+46
-16
lines changed

9 files changed

+46
-16
lines changed

src/librustc_driver/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,10 @@ pub fn diagnostics_registry() -> errors::registry::Registry {
12071207
all_errors.extend_from_slice(&rustc_trans::DIAGNOSTICS);
12081208
all_errors.extend_from_slice(&rustc_const_eval::DIAGNOSTICS);
12091209
all_errors.extend_from_slice(&rustc_metadata::DIAGNOSTICS);
1210+
all_errors.extend_from_slice(&rustc_passes::DIAGNOSTICS);
1211+
all_errors.extend_from_slice(&rustc_plugin::DIAGNOSTICS);
1212+
all_errors.extend_from_slice(&rustc_mir::DIAGNOSTICS);
1213+
all_errors.extend_from_slice(&syntax::DIAGNOSTICS);
12101214

12111215
Registry::new(&all_errors)
12121216
}

src/librustc_mir/diagnostics.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,8 @@ On the other hand, static and constant pointers can point either to
122122
a known numeric address or to the address of a symbol.
123123
124124
```
125+
static MY_STATIC: u32 = 42;
125126
static MY_STATIC_ADDR: &'static u32 = &MY_STATIC;
126-
// ... and also
127-
static MY_STATIC_ADDR2: *const u32 = &MY_STATIC;
128-
129127
const CONST_ADDR: *const u8 = 0x5f3759df as *const u8;
130128
```
131129
@@ -160,6 +158,16 @@ Remember: you can't use a function call inside a const's initialization
160158
expression! However, you can totally use it anywhere else:
161159
162160
```
161+
enum Test {
162+
V1
163+
}
164+
165+
impl Test {
166+
fn func(&self) -> i32 {
167+
12
168+
}
169+
}
170+
163171
fn main() {
164172
const FOO: Test = Test::V1;
165173

src/librustc_mir/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ pub fn provide(providers: &mut Providers) {
5757
shim::provide(providers);
5858
transform::provide(providers);
5959
}
60+
61+
__build_diagnostic_array! { librustc_mir, DIAGNOSTICS }

src/librustc_passes/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ while break {}
221221
222222
To fix this, add a label specifying which loop is being broken out of:
223223
```
224-
`foo: while break `foo {}
224+
'foo: while break 'foo {}
225225
```
226226
"##
227227
}

src/librustc_passes/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ pub mod loops;
4545
pub mod mir_stats;
4646
pub mod no_asm;
4747
pub mod static_recursion;
48+
49+
__build_diagnostic_array! { librustc_passes, DIAGNOSTICS }

src/librustc_plugin/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,5 @@ pub mod diagnostics;
8484
pub mod registry;
8585
pub mod load;
8686
pub mod build;
87+
88+
__build_diagnostic_array! { librustc_plugin, DIAGNOSTICS }

src/librustc_typeck/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4765,7 +4765,7 @@ register_diagnostics! {
47654765
// between structures with the same definition
47664766
E0521, // redundant default implementations of trait
47674767
E0533, // `{}` does not name a unit variant, unit struct or a constant
4768-
E0563, // cannot determine a type for this `impl Trait`: {}
4768+
// E0563, // cannot determine a type for this `impl Trait`: {} // removed in 6383de15
47694769
E0564, // only named lifetimes are allowed in `impl Trait`,
47704770
// but `{}` was found in the type `{}`
47714771
E0567, // auto traits can not have type parameters

src/libsyntax/diagnostic_list.rs

+22-10
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The `inline` attribute was malformed.
4242
4343
Erroneous code example:
4444
45-
```compile_fail,E0534
45+
```ignore (compile_fail not working here; see Issue #43707)
4646
#[inline()] // error: expected one argument
4747
pub fn something() {}
4848
@@ -80,7 +80,7 @@ An unknown argument was given to the `inline` attribute.
8080
8181
Erroneous code example:
8282
83-
```compile_fail,E0535
83+
```ignore (compile_fail not working here; see Issue #43707)
8484
#[inline(unknown)] // error: invalid argument
8585
pub fn something() {}
8686
@@ -190,7 +190,9 @@ A literal was used in an attribute that doesn't support literals.
190190
191191
Erroneous code example:
192192
193-
```compile_fail,E0565
193+
```ignore (compile_fail not working here; see Issue #43707)
194+
#![feature(attr_literals)]
195+
194196
#[inline("always")] // error: unsupported literal
195197
pub fn something() {}
196198
```
@@ -209,7 +211,7 @@ A file wasn't found for an out-of-line module.
209211
210212
Erroneous code example:
211213
212-
```compile_fail,E0583
214+
```ignore (compile_fail not working here; see Issue #43707)
213215
mod file_that_doesnt_exist; // error: file not found for module
214216
215217
fn main() {}
@@ -251,23 +253,33 @@ An inclusive range was used with no end.
251253
Erroneous code example:
252254
253255
```compile_fail,E0586
254-
let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
255-
let x = &tmp[1...]; // error: inclusive range was used with no end
256+
#![feature(inclusive_range_syntax)]
257+
258+
fn main() {
259+
let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
260+
let x = &tmp[1...]; // error: inclusive range was used with no end
261+
}
256262
```
257263
258264
An inclusive range needs an end in order to *include* it. If you just need a
259265
start and no end, use a non-inclusive range (with `..`):
260266
261267
```
262-
let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
263-
let x = &tmp[1..]; // ok!
268+
fn main() {
269+
let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
270+
let x = &tmp[1..]; // ok!
271+
}
264272
```
265273
266274
Or put an end to your inclusive range:
267275
268276
```
269-
let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
270-
let x = &tmp[1...3]; // ok!
277+
#![feature(inclusive_range_syntax)]
278+
279+
fn main() {
280+
let tmp = vec![0, 1, 2, 3, 4, 4, 3, 3, 2, 1];
281+
let x = &tmp[1...3]; // ok!
282+
}
271283
```
272284
"##,
273285

src/libsyntax/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ pub mod ext {
148148
#[cfg(test)]
149149
mod test_snippet;
150150

151-
// __build_diagnostic_array! { libsyntax, DIAGNOSTICS }
151+
__build_diagnostic_array! { libsyntax, DIAGNOSTICS }

0 commit comments

Comments
 (0)