From 5605d58fc79e1cdacfbf01266a2d46b76df53ede Mon Sep 17 00:00:00 2001 From: "Zack M. Davis" Date: Thu, 27 Jul 2017 15:08:29 -0700 Subject: [PATCH] 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.) --- src/librustc_typeck/diagnostics.rs | 42 ++++++++++++++++-------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index a1ac89051c84..3037e8d4a160 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -2631,26 +2631,6 @@ struct Bar { x: Foo } ``` "##, -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); -impl<#[may_dangle] X> Drop for Foo { - 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); +impl<#[may_dangle] X> Drop for Foo { + 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.