Skip to content

Commit b202beb

Browse files
committed
Auto merge of #51475 - GuillaumeGomez:fix-error-codes, r=Manishearth
Fix error codes
2 parents a805a2a + f2349d5 commit b202beb

File tree

11 files changed

+23
-24
lines changed

11 files changed

+23
-24
lines changed

src/librustc/diagnostics.rs

+7-8
Original file line numberDiff line numberDiff line change
@@ -2011,13 +2011,13 @@ a (non-transparent) struct containing a single float, while `Grams` is a
20112011
transparent wrapper around a float. This can make a difference for the ABI.
20122012
"##,
20132013

2014-
E0909: r##"
2014+
E0700: r##"
20152015
The `impl Trait` return type captures lifetime parameters that do not
20162016
appear within the `impl Trait` itself.
20172017
20182018
Erroneous code example:
20192019
2020-
```compile-fail,E0909
2020+
```compile-fail,E0700
20212021
use std::cell::Cell;
20222022
20232023
trait Trait<'a> { }
@@ -2058,27 +2058,27 @@ where 'x: 'y
20582058
```
20592059
"##,
20602060

2061-
E0910: r##"
2061+
E0701: r##"
20622062
This error indicates that a `#[non_exhaustive]` attribute was incorrectly placed
20632063
on something other than a struct or enum.
20642064
20652065
Examples of erroneous code:
20662066
2067-
```compile_fail,E0910
2067+
```compile_fail,E0701
20682068
# #![feature(non_exhaustive)]
20692069
20702070
#[non_exhaustive]
20712071
trait Foo { }
20722072
```
20732073
"##,
20742074

2075-
E0911: r##"
2075+
E0702: r##"
20762076
This error indicates that a `#[non_exhaustive]` attribute had a value. The
20772077
`#[non_exhaustive]` should be empty.
20782078
20792079
Examples of erroneous code:
20802080
2081-
```compile_fail,E0911
2081+
```compile_fail,E0702
20822082
# #![feature(non_exhaustive)]
20832083
20842084
#[non_exhaustive(anything)]
@@ -2139,6 +2139,5 @@ register_diagnostics! {
21392139
E0657, // `impl Trait` can only capture lifetimes bound at the fn level
21402140
E0687, // in-band lifetimes cannot be used in `fn`/`Fn` syntax
21412141
E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders
2142-
2143-
E0906, // closures cannot be static
2142+
E0697, // closures cannot be static
21442143
}

src/librustc/hir/check_attr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
126126
_ => {
127127
struct_span_err!(self.tcx.sess,
128128
attr.span,
129-
E0910,
129+
E0701,
130130
"attribute can only be applied to a struct or enum")
131131
.span_label(item.span, "not a struct or enum")
132132
.emit();
@@ -137,7 +137,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
137137
if attr.meta_item_list().is_some() || attr.value_str().is_some() {
138138
struct_span_err!(self.tcx.sess,
139139
attr.span,
140-
E0911,
140+
E0702,
141141
"attribute should be empty")
142142
.span_label(item.span, "not empty")
143143
.emit();

src/librustc/hir/lowering.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3093,7 +3093,7 @@ impl<'a> LoweringContext<'a> {
30933093
span_err!(
30943094
this.sess,
30953095
fn_decl_span,
3096-
E0906,
3096+
E0697,
30973097
"closures cannot be static"
30983098
);
30993099
}

src/librustc/infer/anon_types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for ReverseMapper<'cx, 'gcx, 'tcx>
556556
let mut err = struct_span_err!(
557557
self.tcx.sess,
558558
span,
559-
E0909,
559+
E0700,
560560
"hidden type for `impl Trait` captures lifetime that \
561561
does not appear in bounds",
562562
);

src/librustc_typeck/check/generator_interior.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a, 'gcx, 'tcx> InteriorVisitor<'a, 'gcx, 'tcx> {
6565
expr, scope, ty, self.expr_count, yield_span);
6666

6767
if self.fcx.any_unresolved_type_vars(&ty) {
68-
let mut err = struct_span_err!(self.fcx.tcx.sess, source_span, E0907,
68+
let mut err = struct_span_err!(self.fcx.tcx.sess, source_span, E0698,
6969
"type inside generator must be known in this context");
7070
err.span_note(yield_span,
7171
"the type is part of the generator because of this `yield`");

src/librustc_typeck/check/method/probe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
335335
// so we do a future-compat lint here for the 2015 edition
336336
// (see https://github.com/rust-lang/rust/issues/46906)
337337
if self.tcx.sess.rust_2018() {
338-
span_err!(self.tcx.sess, span, E0908,
338+
span_err!(self.tcx.sess, span, E0699,
339339
"the type of this value must be known \
340340
to call a method on a raw pointer on it");
341341
} else {

src/librustc_typeck/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4668,7 +4668,7 @@ alignment.
46684668
"##,
46694669

46704670

4671-
E0908: r##"
4671+
E0699: r##"
46724672
A method was called on a raw pointer whose inner type wasn't completely known.
46734673
46744674
For example, you may have done something like:
@@ -4797,5 +4797,5 @@ register_diagnostics! {
47974797
E0640, // infer outlives requirements
47984798
E0641, // cannot cast to/from a pointer with an unknown kind
47994799
E0645, // trait aliases not finished
4800-
E0907, // type inside generator must be known in this context
4800+
E0698, // type inside generator must be known in this context
48014801
}

src/test/compile-fail/edition-raw-pointer-method-2018.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ fn main() {
1818
let x = 0;
1919
let y = &x as *const _;
2020
let _ = y.is_null();
21-
//~^ error: the type of this value must be known to call a method on a raw pointer on it [E0908]
21+
//~^ error: the type of this value must be known to call a method on a raw pointer on it [E0699]
2222
}

src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
#![feature(non_exhaustive)]
1212

1313
#[non_exhaustive(anything)]
14-
//~^ ERROR attribute should be empty [E0911]
14+
//~^ ERROR attribute should be empty [E0702]
1515
struct Foo;
1616

1717
#[non_exhaustive]
18-
//~^ ERROR attribute can only be applied to a struct or enum [E0910]
18+
//~^ ERROR attribute can only be applied to a struct or enum [E0701]
1919
trait Bar { }
2020

2121
#[non_exhaustive]
22-
//~^ ERROR attribute can only be applied to a struct or enum [E0910]
22+
//~^ ERROR attribute can only be applied to a struct or enum [E0701]
2323
union Baz {
2424
f1: u16,
2525
f2: u16

src/test/ui/impl-trait/region-escape-via-bound.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ trait Trait<'a> { }
2424
impl Trait<'b> for Cell<&'a u32> { }
2525

2626
fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
27-
//~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0909]
27+
//~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]
2828
where 'x: 'y
2929
{
3030
x
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0909]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
1+
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
22
--> $DIR/region-escape-via-bound.rs:26:29
33
|
44
LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
@@ -8,7 +8,7 @@ note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined
88
--> $DIR/region-escape-via-bound.rs:26:1
99
|
1010
LL | / fn foo(x: Cell<&'x u32>) -> impl Trait<'y>
11-
LL | | //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0909]
11+
LL | | //~^ ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds [E0700]
1212
LL | | where 'x: 'y
1313
LL | | {
1414
LL | | x
@@ -17,4 +17,4 @@ LL | | }
1717

1818
error: aborting due to previous error
1919

20-
For more information about this error, try `rustc --explain E0909`.
20+
For more information about this error, try `rustc --explain E0700`.

0 commit comments

Comments
 (0)