move extended info for E0569 to numerical-order location in file

We want the error explanations to appear in numerical order so that
they're easy to find. (Also, any other order would be arbitrary and thus
not constitute a Schelling point.) Bizarrely, the extended information
for E0569 was placed between E0244 and E0318 in
librustc_typeck/diagnostics.rs (when the code was introduced in
9a649c32). This commit moves it to be between E0562 and E0570, where it
belongs.

(Also, at reviewer request, say "Erroneous code example", the standard
verbiage that it has been decided that we say everywhere.)
This commit is contained in:
Zack M. Davis 2017-07-27 15:08:29 -07:00
parent 6f14ff105f
commit 5605d58fc7

View file

@ -2631,26 +2631,6 @@ struct Bar<S, T> { x: Foo<S, T> }
```
"##,
E0569: r##"
If an impl has a generic parameter with the `#[may_dangle]` attribute, then
that impl must be declared as an `unsafe impl. For example:
```compile_fail,E0569
#![feature(generic_param_attrs)]
#![feature(dropck_eyepatch)]
struct Foo<X>(X);
impl<#[may_dangle] X> Drop for Foo<X> {
fn drop(&mut self) { }
}
```
In this example, we are asserting that the destructor for `Foo` will not
access any data of type `X`, and require this assertion to be true for
overall safety in our program. The compiler does not currently attempt to
verify this assertion; therefore we must tag this `impl` as unsafe.
"##,
E0318: r##"
Default impls for a trait must be located in the same crate where the trait was
defined. For more information see the [opt-in builtin traits RFC][RFC 19].
@ -3976,6 +3956,28 @@ See [RFC 1522] for more details.
[RFC 1522]: https://github.com/rust-lang/rfcs/blob/master/text/1522-conservative-impl-trait.md
"##,
E0569: r##"
If an impl has a generic parameter with the `#[may_dangle]` attribute, then
that impl must be declared as an `unsafe impl.
Erroneous code example:
```compile_fail,E0569
#![feature(generic_param_attrs)]
#![feature(dropck_eyepatch)]
struct Foo<X>(X);
impl<#[may_dangle] X> Drop for Foo<X> {
fn drop(&mut self) { }
}
```
In this example, we are asserting that the destructor for `Foo` will not
access any data of type `X`, and require this assertion to be true for
overall safety in our program. The compiler does not currently attempt to
verify this assertion; therefore we must tag this `impl` as unsafe.
"##,
E0570: r##"
The requested ABI is unsupported by the current target.