diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs index 75c708e33929d..05c93d4aa57dc 100644 --- a/compiler/rustc_hir/src/lang_items.rs +++ b/compiler/rustc_hir/src/lang_items.rs @@ -437,13 +437,51 @@ language_item_table! { Reborrow, sym::reborrow, reborrow, Target::Trait, GenericRequirement::Exact(0); CoerceShared, sym::coerce_shared, coerce_shared, Target::Trait, GenericRequirement::Exact(0); - // Field representing types. + // # Experimental lang-items for field projections . + + // ## Field representing types. FieldRepresentingType, sym::field_representing_type, field_representing_type, Target::Struct, GenericRequirement::Exact(3); Field, sym::field, field, Target::Trait, GenericRequirement::Exact(0); FieldBase, sym::field_base, field_base, Target::AssocTy, GenericRequirement::Exact(0); FieldType, sym::field_type, field_type, Target::AssocTy, GenericRequirement::Exact(0); FieldOffset, sym::field_offset, field_offset, Target::AssocConst, GenericRequirement::Exact(0); + // ## Virtual places. + Subplace, sym::subplace, subplace, Target::Trait, GenericRequirement::Exact(0); + SubplaceSource, sym::subplace_source, subplace_source, Target::AssocTy, GenericRequirement::Exact(0); + SubplaceTarget, sym::subplace_target, subplace_target, Target::AssocTy, GenericRequirement::Exact(0); + SubplaceOffset, sym::subplace_offset, subplace_offset, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(0); + + PlaceProxy, sym::place_proxy, place_proxy, Target::Trait, GenericRequirement::Exact(0); + PlaceProxyTarget, sym::place_proxy_target, place_proxy_target, Target::AssocTy, GenericRequirement::Exact(0); + + ReadPlace, sym::read_place, read_place, Target::Trait, GenericRequirement::Exact(1); + ReadPlaceSafety, sym::read_place_safe, read_place_safe, Target::AssocConst, GenericRequirement::Exact(1); + ReadPlaceRead, sym::read_place_read, read_place_read, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(1); + + WritePlace, sym::write_place, write_place, Target::Trait, GenericRequirement::Exact(1); + WritePlaceSafety, sym::write_place_safe, write_place_safe, Target::AssocConst, GenericRequirement::Exact(1); + WritePlaceWrite, sym::write_place_write, write_place_write, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(1); + + MovePlace, sym::move_place, move_place, Target::Trait, GenericRequirement::Exact(1); + + DropPlace, sym::drop_place, drop_place, Target::Trait, GenericRequirement::Exact(1); + DropPlaceDrop, sym::drop_place_drop, drop_place_drop, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(1); + + DropHusk, sym::drop_husk, drop_husk, Target::Trait, GenericRequirement::Exact(0); + DropHuskDropHusk, sym::drop_husk_drop_husk, drop_husk_drop_husk, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(0); + + BorrowPlace, sym::borrow_place, borrow_place, Target::Trait, GenericRequirement::Exact(2); + BorrowPlaceSafety, sym::borrow_place_safe, borrow_place_safe, Target::AssocConst, GenericRequirement::Exact(2); + BorrowPlaceBorrow, sym::borrow_place_borrow, borrow_place_borrow, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(2); + + DerefPlace, sym::deref_place, deref_place, Target::Trait, GenericRequirement::Exact(1); + DerefPlaceNested, sym::deref_place_deref, deref_place_deref, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(1); + + WrapPlace, sym::wrap_place, wrap_place, Target::Trait, GenericRequirement::Exact(1); + WrapPlaceWrapped, sym::wrap_place_wrapped, wrap_place_wrapped, Target::AssocTy, GenericRequirement::Exact(1); + WrapPlaceWrap, sym::wrap_place_wrap, wrap_place_wrap, Target::Method(MethodKind::Trait { body: false }), GenericRequirement::Exact(1); + // Used to fallback `{float}` to `f32` when `f32: From<{float}>` From, sym::From, from_trait, Target::Trait, GenericRequirement::Exact(1); } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 9cd66bc1604d1..ec25ec4079963 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -528,6 +528,9 @@ symbols! { block, blocking, bool, + borrow_place, + borrow_place_borrow, + borrow_place_safe, borrowck_graphviz_format, borrowck_graphviz_postflow, box_new, @@ -788,6 +791,8 @@ symbols! { deref_method, deref_mut, deref_patterns, + deref_place, + deref_place_deref, deref_pure, deref_target, derive, @@ -832,7 +837,11 @@ symbols! { dreg_low8, dreg_low16, drop, + drop_husk, + drop_husk_drop_husk, drop_in_place, + drop_place, + drop_place_drop, drop_types_in_const, dropck_eyepatch, dropck_parametricity, @@ -1318,6 +1327,7 @@ symbols! { more_qualified_paths, more_struct_aliases, movbe_target_feature, + move_place, move_ref_pattern, move_size_limit, movrs_target_feature, @@ -1514,6 +1524,9 @@ symbols! { pin, pin_ergonomics, pin_v2, + place, + place_proxy, + place_proxy_target, platform_intrinsics, plugin, plugin_registrar, @@ -1609,6 +1622,9 @@ symbols! { raw_identifiers, raw_ref_op, re_rebalance_coherence, + read_place, + read_place_read, + read_place_safe, read_via_copy, readonly, realloc, @@ -1990,6 +2006,10 @@ symbols! { sub, sub_assign, sub_with_overflow, + subplace, + subplace_offset, + subplace_source, + subplace_target, suggestion, super_let, supertrait_item_shadowing, @@ -2260,6 +2280,9 @@ symbols! { windows_subsystem, with_negative_coherence, wrap_binder, + wrap_place, + wrap_place_wrap, + wrap_place_wrapped, wrapping_add, wrapping_div, wrapping_mul, @@ -2271,6 +2294,9 @@ symbols! { write_bytes, write_fmt, write_macro, + write_place, + write_place_safe, + write_place_write, write_str, write_via_move, writeln_macro, diff --git a/library/core/src/ops/mod.rs b/library/core/src/ops/mod.rs index ab1ad407ee282..c4d84a1faae4a 100644 --- a/library/core/src/ops/mod.rs +++ b/library/core/src/ops/mod.rs @@ -153,6 +153,8 @@ mod reborrow; mod try_trait; mod unsize; +#[unstable(feature = "field_projections", issue = "145383")] +pub mod place; #[stable(feature = "rust1", since = "1.0.0")] pub use self::arith::{Add, Div, Mul, Neg, Rem, Sub}; #[stable(feature = "op_assign_traits", since = "1.8.0")] diff --git a/library/core/src/ops/place.rs b/library/core/src/ops/place.rs new file mode 100644 index 0000000000000..babb652bb90a1 --- /dev/null +++ b/library/core/src/ops/place.rs @@ -0,0 +1,420 @@ +//! Operations on places. +//! +//! # Operations on Places +//! +//! This module contains traits to customize the place operations of Rust: +//! - reading, +//! - writing, and +//! - borrowing. +//! +//! This is part of the language experiment for field projections +//! . The specific design that +//! is currently being implemented is explained in detail in the latest [design +//! meeting document](https://hackmd.io/H5d2-83ER2ymNPZVIWCYWg?view). Note that +//! several types and traits have been renamed. Further modifications pending +//! experiment results are expected to occur. +//! +//! ## Places +//! +//! A *place* in Rust is a particular location in memory. They are represented +//! by [*place expressions*][ref-place-exprs], which take on the following form: +//! - `$path`: paths that refer to locals variables (also parameters) and +//! statics, +//! - `*$place`: dereferences of another place expression, +//! - `$place[$expr]`: indexing operation of another place expression, +//! - `$place.$ident`: field access of another place expression, +//! - `($place)`: parenthesized place expressions, +//! - `$value`: value expressions can be coerced to a temporary place whose +//! lifetime is determined from its context, +//! +//! Further reading: +//! - +//! - +//! +//! [ref-place-exprs]: https://doc.rust-lang.org/reference/expressions.html#r-expr.place-value.place-expr-kinds +//! +//! ## Place Proxies +//! +//! Places and place expressions are not part of the type system of Rust and +//! therefore cannot implement traits. To still be able to customize place +//! operations via traits, they are implemented for types that act as a proxy +//! for the place. Such types are called *place proxies* and they implement the +//! [`PlaceProxy`] trait. Elements of a place proxy type denote/represent one +//! specific place. Such an element can be dereferenced, which results in a +//! place expression denoting the represented place. This is a normal place +//! expression that can be used to perform place operations or can be composed +//! into a bigger place expression. +//! +//! Place operations performed on the represented place are implemented by the +//! corresponding place operation trait of this module. This trait must be +//! implemented for the place's proxy type, otherwise the compiler will emit an +//! error: +//! +//! - reading [`ReadPlace`], +//! - writing [`WritePlace`], and +//! - borrowing [`BorrowPlace`]. +//! +//! Examples of types that implement some of these operations are smart & dumb +//! pointers like `Box`, `Arc`, [`&mut T`](primitive@reference), +//! [`*mut T`](primitive@pointer), and [`NonNull`](core::ptr::NonNull). +//! +//! ### Subplaces +//! +//! Place operations are allowed to target only a *subplace*. For example +//! `my_struct.field = 42;` writes to only the `field` subplace. Since places +//! are operated upon through their proxy, which represents the *entire* place, +//! each operation has a generic parameter denoting the subplace the operation +//! is targeting. This generic implements the [`Subplace`] trait, which contains +//! all the information describing the targeted subplace. +//! +//! Note that the [`Subplace`] trait also can represent the entire place in case +//! the operation affects the entire place (for example `let x = *ptr;`). +//! +//! This generic argument is supplied by the compiler when desugaring a place +//! operation into the corresponding place operation trait function call. There +//! is a direct translation from place expressions to types implementing the +//! [`Subplace`] trait. +//! +//! ### Implicit Operations +//! +//! In addition to the three visible operations, there are several other +//! *implicit* operations that can be implemented for place proxies: +//! +//! - moving out of a subplace [`MovePlace`], +//! - dropping a subplace [`DropPlace`] and dropping a fully moved-out pointer +//! [`DropHusk`], and +//! - support for accessing a nested pointer [`DerefPlace`]. +//! +//! ### Place Wrappers +//! +//! Place wrappers are a special kind of place proxy. They "physically contain" +//! the place they are proxying for. A good example is [`MaybeUninit`]. To +//! support subplaces of these place wrappers, the [`WrapPlace`] trait exists. +//! It allows forwarding subplaces to the proxy and changing the subplace access +//! information. With [`MaybeUninit`], this allows accessing any subplace +//! under the transformation that it's type is wrapped in `MaybeUninit`. So +//! Given `&MaybeUninit`, the `field` subplace can be borrowed using `&` +//! and it has type `&MaybeUninit`. +//! +//! [`MaybeUninit`]: crate::mem::MaybeUninit +//! +//! ### Safety +//! +//! All operation functions are `unsafe`, since they have raw pointer arguments +//! that have safety preconditions. The arguments are raw pointers, because the +//! values they point to need not be in a valid state (they may be partially +//! moved out or borrowed). +//! +//! The safety requirements for the operation functions have not been figured +//! out at this point in time. Since we expect several changes to the design, we +//! do not want to commit to writing down good safety documentation before +//! having finished the design. +//! +//! What is clear at the moment is that the safety requirements will heavily +//! interact with the borrow checker. It will ensure that simultaneous place +//! operations on the same value are allowed, since they either affect disjoint +//! subplaces, or because they both only require shared access. For example: +//! - reading `ptr.field.subfield` and borrowing `ptr.field` with `&T` are +//! allowed to happen at the same time, +//! - writing `ptr.field` and borrowing `ptr.field.subfield` at the same time is +//! not allowed. +//! +//! The safety of using the place operations via the operators will depend on +//! the value of the `SAFE` constant in the operation traits. At the moment we +//! will only permit a literal value of `true` or `false` in implementations. It +//! will dictate if people have to write for example `unsafe { &*ptr }` or if +//! `*ptr` is allowed. It should be set to `true` when the borrow checker's +//! guarantees of either disjoint subplaces or "all concurrent operations are +//! shared" are enough to calling the operations' function correctly. If there +//! are additional requirements, such as "ptr is valid", then `SAFE` should be +//! set to `false`. For example, `&mut T` will have `SAFE = true` in +//! [`ReadPlace`], but `NonNull` will set it to `false`. + +use crate::ptr::Pointee; + +/// A subplace of [`Self::Source`] with the type [`Self::Target`]. +/// +/// A subplace is always within the same allocation as the base place. A +/// subplace is described by a chain of +/// - field accesses, and +/// - array/slice indexes. +/// +/// Note that a subplace can also be the entire original place. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[rustc_deny_explicit_impl] +#[rustc_dyn_incompatible_trait] +#[lang = "subplace"] +pub unsafe trait Subplace: Sized { + /// The type of the base place this subplace is a part of. + #[lang = "subplace_source"] + type Source: ?Sized; + + /// The type of this subplace. + #[lang = "subplace_target"] + type Target: ?Sized; + + /// The offset of this subplace. + #[lang = "subplace_offset"] + fn offset( + &self, + metadata: ::Metadata, + ) -> (usize, ::Metadata); +} + +/// Marks a type as a place proxy. +/// +/// A place proxy can be dereferenced (`*val`). This results in a place for +/// which any place operation is implemented by this type. The operation is +/// available only if the corresponding place operation trait is implemented: +/// +/// - [`ReadPlace`] +/// - [`WritePlace`] +/// - [`BorrowPlace`] +/// +/// Furthermore, there are implicit place operations that can be supported by +/// types implementing this trait: +/// +/// - [`MovePlace`] +/// - [`DropPlace`] +/// - [`DropHusk`] +/// - [`DerefPlace`] +/// - [`WrapPlace`] +/// +/// Read the [module](self) description for more information. +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "place_proxy"] +pub trait PlaceProxy { + /// The type of the contained place. + #[lang = "place_proxy_target"] + type Target: ?Sized; +} + +/// Reading a place `let val = *x;`. +/// +/// When `x: Self`, then `let val = *x;` will be desugared into [`ReadPlace::read`]. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "read_place"] +pub unsafe trait ReadPlace: PlaceProxy +where + S: Subplace, + S::Target: Sized, +{ + /// Whether the read operation is safe when used through the operator. + /// + /// When the operator is used, the borrow checker follows its usual rules to + /// ensure that no other operation conflicts with this one. If that alone is + /// sufficient to make this operation sound, then this should be `true`. + #[lang = "read_place_safe"] + const SAFE: bool; + + /// Reads the subplace pointed to by `this`. + /// + /// # Safety + /// + /// See the module-level section on [safety](crate::ops::place#safety). + #[lang = "read_place_read"] + unsafe fn read(this: *const Self, sub: S) -> S::Target; +} + +/// Writing a place `*x = val;`. +/// +/// When `x: Self`, then `*x = val;` will be desugared into +/// [`WritePlace::write`]. +/// +/// When a value already exists at the subplace, it is dropped with +/// [`DropPlace`] before it is written to. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "write_place"] +pub unsafe trait WritePlace: PlaceProxy +where + S: Subplace, + S::Target: Sized, +{ + /// Whether the write operation is safe when used through the operator. + /// + /// When the operator is used, the borrow checker follows its usual rules to + /// ensure that no other operation conflicts with this one. If that alone is + /// sufficient to make this operation sound, then this should be `true`. + #[lang = "write_place_safe"] + const SAFE: bool; + + /// Writes to the subplace pointed to by `this`. + /// + /// # Safety + /// + /// See the module-level section on [safety](crate::ops::place#safety). + #[lang = "write_place_write"] + unsafe fn write(this: *const Self, sub: S, value: S::Target); +} + +/// Borrowing a place with `X`. +/// +/// When `y: Self`, then `let x = @ *y;` will be desugared into +/// [`BorrowPlace::borrow`]. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "borrow_place"] +pub unsafe trait BorrowPlace: PlaceProxy +where + S: Subplace, + X: PlaceProxy, +{ + /// Whether the borrow operation is safe when used through the operator. + /// + /// When the operator is used, the borrow checker follows its usual rules to + /// ensure that no other operation conflicts with this one. If that alone is + /// sufficient to make this operation sound, then this should be `true`. + #[lang = "borrow_place_safe"] + const SAFE: bool; + + // FIXME: this is missing some associated items related to controlling the + // borrow checker. The details need to still be worked out in a-mir-formality. + + /// Borrow the subplace pointed to by `this` with `X`. + /// + /// # Safety + /// + /// See the module-level section on [safety](crate::ops::place#safety). + #[lang = "borrow_place_borrow"] + unsafe fn borrow(this: *const Self, sub: S) -> X; +} + +/// Moving out of a place. +/// +/// When `x: Self` and one performs a [`ReadPlace::read`] where the target value +/// is not [`Copy`], then the compiler checks if this trait is implemented and +/// if so, moves the value out by reading it and adjusting the borrow checker +/// state of the place. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "move_place"] +pub unsafe trait MovePlace: ReadPlace +where + S: Subplace, + S::Target: Sized, +{ +} + +/// Dropping a place. +/// +/// Emitted by the compiler before a new value is written ([`WritePlace`]) to +/// this subplace, or when a pointer to a partially moved out place is dropped. +/// See the documentation of [`DropHusk`] for more on the exact details of that +/// last case. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "drop_place"] +pub unsafe trait DropPlace: PlaceProxy +where + S: Subplace, +{ + /// Drop the subplace pointed to by `this`. + /// + /// # Safety + /// + /// See the module-level section on [safety](crate::ops::place#safety). + #[lang = "drop_place_drop"] + unsafe fn drop(this: *const Self, sub: S); +} + +/// Dropping an empty place proxy. +/// +/// This operation is emitted by the compiler when a place proxy is being +/// dropped where all fields of the represented place were moved out. +/// +/// If no fields or only some fields have been moved out, all not yet moved out +/// fields are dropped with the [`DropPlace`] trait. After that this pointer is +/// dropped by calling [`DropHusk::drop_husk`]. +/// +/// Note that a write operation ([`WritePlace`]) can move a value into a +/// previously moved-out field. +/// +/// This trait cannot be implemented at the same time as [`Drop`], since it +/// generalizes it. When this trait is implemented, dropping a value of type +/// `Self` is done by first dropping the represented place using [`DropPlace`] +/// and then calling drop_husk. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "drop_husk"] +pub unsafe trait DropHusk: PlaceProxy { + /// Drops the + /// + /// # Safety + /// + /// See the module-level section on [safety](crate::ops::place#safety). + #[lang = "drop_husk_drop_husk"] + unsafe fn drop_husk(this: *const Self); +} + +/// Accessing a nested proxy. +/// +/// When `x: Self`, then nested dereferences `let _ = **x;` are desugared into a +/// combination of the corresponding operation and [`DerefPlace::deref`]. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "deref_place"] +pub unsafe trait DerefPlace: PlaceProxy +where + S: Subplace, + S::Target: PlaceProxy, +{ + /// Obtain a raw pointer to the subplace contained by `this`. + /// + /// # Safety + /// + /// See the module-level section on [safety](crate::ops::place#safety). + #[lang = "deref_place_deref"] + unsafe fn deref(this: *const Self, sub: S) -> *const S::Target; +} + +/// Forwards the subplace `S` of the place contained by this. +/// +/// When `x: Self` and `Self::Target` has a subplace `S` accessible via +/// `.foo.bar`, then `x.foo.bar` is also valid, has type `::Target` and any place operation on it uses +/// [Self::wrap]\(sub\) as the subplace instead of `sub`. +/// +/// # Safety +/// +/// See the module-level section on [safety](crate::ops::place#safety). +#[unstable(feature = "field_projections", issue = "145383")] +#[lang = "wrap_place"] +pub unsafe trait WrapPlace: PlaceProxy +where + S: Subplace, +{ + /// The subplace to use instead of `S` for any place operations on `Self`. + #[lang = "wrap_place_wrapped"] + type Wrapped: Subplace; + + /// Turn a subplace of type `S` into [`Self::Wrapped`]. + #[lang = "wrap_place_wrap"] + fn wrap(sub: S) -> Self::Wrapped; +} diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff index 62cce84f69560..437fb1d3cd4ef 100644 --- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff +++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-abort.diff @@ -13,7 +13,7 @@ _3 = copy _1; StorageLive(_4); _4 = copy _2; -- _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; +- _0 = std::intrinsics::offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; + _0 = Offset(move _3, move _4); + goto -> bb1; } diff --git a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff index 62cce84f69560..437fb1d3cd4ef 100644 --- a/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff +++ b/tests/mir-opt/lower_intrinsics.ptr_offset.LowerIntrinsics.panic-unwind.diff @@ -13,7 +13,7 @@ _3 = copy _1; StorageLive(_4); _4 = copy _2; -- _0 = offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; +- _0 = std::intrinsics::offset::<*const i32, isize>(move _3, move _4) -> [return: bb1, unwind unreachable]; + _0 = Offset(move _3, move _4); + goto -> bb1; } diff --git a/tests/ui/feature-gates/feature-gate-field-projections.rs b/tests/ui/feature-gates/feature-gate-field-projections.rs index 9cc219460c37b..a5123987a8541 100644 --- a/tests/ui/feature-gates/feature-gate-field-projections.rs +++ b/tests/ui/feature-gates/feature-gate-field-projections.rs @@ -1,6 +1,19 @@ -use std::field::{Field, field_of}; //~ ERROR: use of unstable library feature `field_projections` [E0658] -//~^ ERROR: use of unstable library feature `field_projections` [E0658] +#![feature(ptr_metadata)] + +use std::field::Field; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::Subplace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::field::field_of; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::DropHusk; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::PlaceProxy; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::BorrowPlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::DerefPlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::DropPlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::MovePlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::ReadPlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::WrapPlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] +use std::ops::place::WritePlace; //~ ERROR: use of unstable library feature `field_projections` [E0658] use std::ptr; +use std::ptr::Pointee; fn project_ref( //~^ ERROR: use of unstable library feature `field_projections` [E0658] @@ -13,6 +26,198 @@ where unsafe { &*ptr::from_ref(r).byte_add(F::OFFSET).cast() } //~ ERROR: use of unstable library feature `field_projections` [E0658] } +struct MyPtr(*mut T); + +impl PlaceProxy for MyPtr { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + type Target = T; //~ ERROR: use of unstable library feature `field_projections` [E0658] +} + +unsafe impl ReadPlace for MyPtr +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +where + T: ?Sized, + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + S::Target: Sized, //~ ERROR: use of unstable library feature `field_projections` [E0658] +{ + const SAFE: bool = true; //~ ERROR: use of unstable library feature `field_projections` [E0658] + + unsafe fn read(this: *const Self, sub: S) -> S::Target { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = (this, sub); + todo!() + } +} + +unsafe impl WritePlace for MyPtr +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +where + T: ?Sized, + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + S::Target: Sized, //~ ERROR: use of unstable library feature `field_projections` [E0658] +{ + const SAFE: bool = true; //~ ERROR: use of unstable library feature `field_projections` [E0658] + + unsafe fn write(this: *const Self, sub: S, value: S::Target) { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = (this, sub, value); + todo!() + } +} + +unsafe impl MovePlace for MyPtr +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +where + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + S::Target: Sized, //~ ERROR: use of unstable library feature `field_projections` [E0658] +{ +} + +unsafe impl DropPlace for MyPtr +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +where + T: ?Sized, + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] +{ + unsafe fn drop(this: *const Self, sub: S) { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = (this, sub); + todo!() + } +} + +unsafe impl DropHusk for MyPtr { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + + unsafe fn drop_husk(this: *const Self) { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = this; + todo!() + } +} + +unsafe impl BorrowPlace> for MyPtr +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +//~^^ ERROR: use of unstable library feature `field_projections` [E0658] +where + T: ?Sized, + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] +{ + const SAFE: bool = true; //~ ERROR: use of unstable library feature `field_projections` [E0658] + + unsafe fn borrow(this: *const Self, sub: S) -> MyPtr { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = (this, sub); + todo!() + } +} + +unsafe impl DerefPlace for MyPtr +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +where + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + S::Target: PlaceProxy, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] +{ + unsafe fn deref(this: *const Self, sub: S) -> *const S::Target { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = (this, sub); + todo!() + } +} + +unsafe fn using_place_ops(place: *const MyPtr, sub: impl Fn() -> S) +where + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + //~^^ ERROR: use of unstable library feature `field_projections` [E0658] + S::Target: Sized + PlaceProxy, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] +{ + unsafe { + let value = ReadPlace::read(place, sub()); //~ ERROR: use of unstable library feature `field_projections` [E0658] + WritePlace::write(place, sub(), value); //~ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = BorrowPlace::<_, MyPtr<_>>::borrow(place, sub()); //~ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = DerefPlace::deref(place, sub()); //~ ERROR: use of unstable library feature `field_projections` [E0658] + DropPlace::drop(place, sub()); //~ ERROR: use of unstable library feature `field_projections` [E0658] + DropHusk::drop_husk(place); //~ ERROR: use of unstable library feature `field_projections` [E0658] + } +} + +struct MyWrapper(T); + +impl PlaceProxy for MyWrapper { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + type Target = T; //~ ERROR: use of unstable library feature `field_projections` [E0658] +} + +unsafe impl WrapPlace for MyWrapper +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +where + T: ?Sized, + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] +{ + type Wrapped = MyWrapped; //~ ERROR: use of unstable library feature `field_projections` [E0658] + + fn wrap(sub: S) -> MyWrapped { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + MyWrapped(sub) + } +} + +#[derive(Copy, Clone)] +struct MyWrapped(S); + +unsafe impl Subplace for MyWrapped +//~^ ERROR: use of unstable library feature `field_projections` [E0658] +//~^^ ERROR: explicit impls for the `Subplace` trait are not permitted [E0322] +where + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] +{ + type Source = MyWrapper; //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + type Target = MyWrapper; //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + + fn offset( + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + self, + metadata: ::Metadata, + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + ) -> (usize, ::Metadata) { + //~^ ERROR: use of unstable library feature `field_projections` [E0658] + let _ = (self, metadata); + todo!() + } +} + +unsafe fn using_wrapper_ops(sub: S) +where + T: ?Sized, + S: Subplace, //~ ERROR: use of unstable library feature `field_projections` [E0658] + //~^ ERROR: use of unstable library feature `field_projections` [E0658] +{ + unsafe { + let _ = as WrapPlace>::wrap(sub); //~ ERROR: use of unstable library feature `field_projections` [E0658] + } +} + fn main() { struct Foo(()); let _ = project_ref::(&Foo(())); //~ ERROR: use of unstable library feature `field_projections` [E0658] diff --git a/tests/ui/feature-gates/feature-gate-field-projections.stderr b/tests/ui/feature-gates/feature-gate-field-projections.stderr index 935e968c5b8ed..e67bc79ca070e 100644 --- a/tests/ui/feature-gates/feature-gate-field-projections.stderr +++ b/tests/ui/feature-gates/feature-gate-field-projections.stderr @@ -1,5 +1,5 @@ error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:18:27 + --> $DIR/feature-gate-field-projections.rs:223:27 | LL | let _ = project_ref::(&Foo(())); | ^^^^^^^^ @@ -9,27 +9,127 @@ LL | let _ = project_ref::(&Foo(())); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:1:18 + --> $DIR/feature-gate-field-projections.rs:3:5 | -LL | use std::field::{Field, field_of}; - | ^^^^^ +LL | use std::field::Field; + | ^^^^^^^^^^^^^^^^^ | = note: see issue #145383 for more information = help: add `#![feature(field_projections)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:1:25 + --> $DIR/feature-gate-field-projections.rs:4:5 | -LL | use std::field::{Field, field_of}; - | ^^^^^^^^ +LL | use std::ops::place::Subplace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #145383 for more information = help: add `#![feature(field_projections)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:5:19 + --> $DIR/feature-gate-field-projections.rs:5:5 + | +LL | use std::field::field_of; + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:6:5 + | +LL | use std::ops::place::DropHusk; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:7:5 + | +LL | use std::ops::place::PlaceProxy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:8:5 + | +LL | use std::ops::place::BorrowPlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:9:5 + | +LL | use std::ops::place::DerefPlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:10:5 + | +LL | use std::ops::place::DropPlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:11:5 + | +LL | use std::ops::place::MovePlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:12:5 + | +LL | use std::ops::place::ReadPlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:13:5 + | +LL | use std::ops::place::WrapPlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:14:5 + | +LL | use std::ops::place::WritePlace; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:18:19 | LL | fn project_ref( | ^^^^^ @@ -39,7 +139,472 @@ LL | fn project_ref( = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:11:5 + --> $DIR/feature-gate-field-projections.rs:33:5 + | +LL | type Target = T; + | ^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:31:17 + | +LL | impl PlaceProxy for MyPtr { + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:45:5 + | +LL | const SAFE: bool = true; + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:47:5 + | +LL | unsafe fn read(this: *const Self, sub: S) -> S::Target { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:40:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:36:19 + | +LL | unsafe impl ReadPlace for MyPtr + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:64:5 + | +LL | const SAFE: bool = true; + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:66:5 + | +LL | unsafe fn write(this: *const Self, sub: S, value: S::Target) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:59:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:55:19 + | +LL | unsafe impl WritePlace for MyPtr + | ^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:77:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:74:19 + | +LL | unsafe impl MovePlace for MyPtr + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:91:5 + | +LL | unsafe fn drop(this: *const Self, sub: S) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:88:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:84:19 + | +LL | unsafe impl DropPlace for MyPtr + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:101:5 + | +LL | unsafe fn drop_husk(this: *const Self) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:98:16 + | +LL | unsafe impl DropHusk for MyPtr { + | ^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:117:5 + | +LL | const SAFE: bool = true; + | ^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:119:5 + | +LL | unsafe fn borrow(this: *const Self, sub: S) -> MyPtr { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:113:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:108:19 + | +LL | unsafe impl BorrowPlace> for MyPtr + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:136:5 + | +LL | unsafe fn deref(this: *const Self, sub: S) -> *const S::Target { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:130:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:133:16 + | +LL | S::Target: PlaceProxy, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:127:19 + | +LL | unsafe impl DerefPlace for MyPtr + | ^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:146:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:149:24 + | +LL | S::Target: Sized + PlaceProxy, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:153:21 + | +LL | let value = ReadPlace::read(place, sub()); + | ^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:154:9 + | +LL | WritePlace::write(place, sub(), value); + | ^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:155:17 + | +LL | ... let _ = BorrowPlace::<_, MyPtr<_>>::borrow(place, sub()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:156:17 + | +LL | let _ = DerefPlace::deref(place, sub()); + | ^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:157:9 + | +LL | DropPlace::drop(place, sub()); + | ^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:158:9 + | +LL | DropHusk::drop_husk(place); + | ^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:166:5 + | +LL | type Target = T; + | ^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:164:17 + | +LL | impl PlaceProxy for MyWrapper { + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:176:5 + | +LL | type Wrapped = MyWrapped; + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:178:5 + | +LL | fn wrap(sub: S) -> MyWrapped { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:173:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:169:19 + | +LL | unsafe impl WrapPlace for MyWrapper + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:193:5 + | +LL | type Source = MyWrapper; + | ^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:195:5 + | +LL | type Target = MyWrapper; + | ^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:198:5 + | +LL | / fn offset( +LL | | +LL | | self, +LL | | metadata: ::Metadata, +LL | | +LL | | ) -> (usize, ::Metadata) { + | |_____________________________________________________^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:191:8 + | +LL | S: Subplace, + | ^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:187:16 + | +LL | unsafe impl Subplace for MyWrapped + | ^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:213:8 + | +LL | S: Subplace, + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:217:17 + | +LL | let _ = as WrapPlace>::wrap(sub); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:24:5 | LL | F::Type: Sized, | ^^^^^^^ @@ -49,7 +614,7 @@ LL | F::Type: Sized, = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:7:9 + --> $DIR/feature-gate-field-projections.rs:20:9 | LL | r: &F::Base, | ^^^^^^^ @@ -59,7 +624,7 @@ LL | r: &F::Base, = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:8:7 + --> $DIR/feature-gate-field-projections.rs:21:7 | LL | ) -> &F::Type | ^^^^^^^ @@ -69,7 +634,313 @@ LL | ) -> &F::Type = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0658]: use of unstable library feature `field_projections` - --> $DIR/feature-gate-field-projections.rs:13:42 + --> $DIR/feature-gate-field-projections.rs:40:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:47:50 + | +LL | unsafe fn read(this: *const Self, sub: S) -> S::Target { + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:59:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:66:55 + | +LL | unsafe fn write(this: *const Self, sub: S, value: S::Target) { + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:113:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:119:58 + | +LL | unsafe fn borrow(this: *const Self, sub: S) -> MyPtr { + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:130:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:136:58 + | +LL | unsafe fn deref(this: *const Self, sub: S) -> *const S::Target { + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:201:20 + | +LL | metadata: ::Metadata, + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:203:19 + | +LL | ) -> (usize, ::Metadata) { + | ^^^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:40:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:43:5 + | +LL | S::Target: Sized, + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:59:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:62:5 + | +LL | S::Target: Sized, + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:77:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:77:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:80:5 + | +LL | S::Target: Sized, + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:88:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:113:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:108:40 + | +LL | unsafe impl BorrowPlace> for MyPtr + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:130:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:133:5 + | +LL | S::Target: PlaceProxy, + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:146:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:146:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:149:5 + | +LL | S::Target: Sized + PlaceProxy, + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:173:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:193:29 + | +LL | type Source = MyWrapper; + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0322]: explicit impls for the `Subplace` trait are not permitted + --> $DIR/feature-gate-field-projections.rs:187:1 + | +LL | / unsafe impl Subplace for MyWrapped +LL | | +LL | | +LL | | where +LL | | S: Subplace, + | |________________^ impl of `Subplace` not allowed + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:195:29 + | +LL | type Target = MyWrapper; + | ^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:213:17 + | +LL | S: Subplace, + | ^^^^^^^^^^ + | + = note: see issue #145383 for more information + = help: add `#![feature(field_projections)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error[E0658]: use of unstable library feature `field_projections` + --> $DIR/feature-gate-field-projections.rs:26:42 | LL | unsafe { &*ptr::from_ref(r).byte_add(F::OFFSET).cast() } | ^^^^^^^^^ @@ -78,6 +949,7 @@ LL | unsafe { &*ptr::from_ref(r).byte_add(F::OFFSET).cast() } = help: add `#![feature(field_projections)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 8 previous errors +error: aborting due to 94 previous errors -For more information about this error, try `rustc --explain E0658`. +Some errors have detailed explanations: E0322, E0658. +For more information about an error, try `rustc --explain E0322`.