@@ -2631,26 +2631,6 @@ struct Bar<S, T> { x: Foo<S, T> }
26312631```
26322632"## ,
26332633
2634- E0569 : r##"
2635- If an impl has a generic parameter with the `#[may_dangle]` attribute, then
2636- that impl must be declared as an `unsafe impl. For example:
2637-
2638- ```compile_fail,E0569
2639- #![feature(generic_param_attrs)]
2640- #![feature(dropck_eyepatch)]
2641-
2642- struct Foo<X>(X);
2643- impl<#[may_dangle] X> Drop for Foo<X> {
2644- fn drop(&mut self) { }
2645- }
2646- ```
2647-
2648- In this example, we are asserting that the destructor for `Foo` will not
2649- access any data of type `X`, and require this assertion to be true for
2650- overall safety in our program. The compiler does not currently attempt to
2651- verify this assertion; therefore we must tag this `impl` as unsafe.
2652- "## ,
2653-
26542634E0318 : r##"
26552635Default impls for a trait must be located in the same crate where the trait was
26562636defined. For more information see the [opt-in builtin traits RFC][RFC 19].
@@ -3457,6 +3437,56 @@ impl Foo for i32 {
34573437```
34583438"## ,
34593439
3440+ E0436 : r##"
3441+ The functional record update syntax is only allowed for structs. (Struct-like
3442+ enum variants don't qualify, for example.)
3443+
3444+ Erroneous code example:
3445+
3446+ ```compile_fail,E0436
3447+ enum PublicationFrequency {
3448+ Weekly,
3449+ SemiMonthly { days: (u8, u8), annual_special: bool },
3450+ }
3451+
3452+ fn one_up_competitor(competitor_frequency: PublicationFrequency)
3453+ -> PublicationFrequency {
3454+ match competitor_frequency {
3455+ PublicationFrequency::Weekly => PublicationFrequency::SemiMonthly {
3456+ days: (1, 15), annual_special: false
3457+ },
3458+ c @ PublicationFrequency::SemiMonthly{ .. } =>
3459+ PublicationFrequency::SemiMonthly {
3460+ annual_special: true, ..c // error: functional record update
3461+ // syntax requires a struct
3462+ }
3463+ }
3464+ }
3465+ ```
3466+
3467+ Rewrite the expression without functional record update syntax:
3468+
3469+ ```
3470+ enum PublicationFrequency {
3471+ Weekly,
3472+ SemiMonthly { days: (u8, u8), annual_special: bool },
3473+ }
3474+
3475+ fn one_up_competitor(competitor_frequency: PublicationFrequency)
3476+ -> PublicationFrequency {
3477+ match competitor_frequency {
3478+ PublicationFrequency::Weekly => PublicationFrequency::SemiMonthly {
3479+ days: (1, 15), annual_special: false
3480+ },
3481+ PublicationFrequency::SemiMonthly{ days, .. } =>
3482+ PublicationFrequency::SemiMonthly {
3483+ days, annual_special: true // ok!
3484+ }
3485+ }
3486+ }
3487+ ```
3488+ "## ,
3489+
34603490E0439 : r##"
34613491The length of the platform-intrinsic function `simd_shuffle`
34623492wasn't specified. Erroneous code example:
@@ -3926,6 +3956,28 @@ See [RFC 1522] for more details.
39263956[RFC 1522]: https://github.com/rust-lang/rfcs/blob/master/text/1522-conservative-impl-trait.md
39273957"## ,
39283958
3959+ E0569 : r##"
3960+ If an impl has a generic parameter with the `#[may_dangle]` attribute, then
3961+ that impl must be declared as an `unsafe impl.
3962+
3963+ Erroneous code example:
3964+
3965+ ```compile_fail,E0569
3966+ #![feature(generic_param_attrs)]
3967+ #![feature(dropck_eyepatch)]
3968+
3969+ struct Foo<X>(X);
3970+ impl<#[may_dangle] X> Drop for Foo<X> {
3971+ fn drop(&mut self) { }
3972+ }
3973+ ```
3974+
3975+ In this example, we are asserting that the destructor for `Foo` will not
3976+ access any data of type `X`, and require this assertion to be true for
3977+ overall safety in our program. The compiler does not currently attempt to
3978+ verify this assertion; therefore we must tag this `impl` as unsafe.
3979+ "## ,
3980+
39293981E0570 : r##"
39303982The requested ABI is unsupported by the current target.
39313983
@@ -4655,7 +4707,6 @@ register_diagnostics! {
46554707// E0372, // coherence not object safe
46564708 E0377 , // the trait `CoerceUnsized` may only be implemented for a coercion
46574709 // between structures with the same definition
4658- E0436 , // functional record update requires a struct
46594710 E0521 , // redundant default implementations of trait
46604711 E0533 , // `{}` does not name a unit variant, unit struct or a constant
46614712 E0563 , // cannot determine a type for this `impl Trait`: {}
0 commit comments