Skip to content

Commit 3217d4a

Browse files
committed
Move one of Archetype's bounds to where
This improves the rendering of rustdoc, and leaves us free to remove that bound if need be without violating stability.
1 parent 61448fb commit 3217d4a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

rfcs/0000-safe-transmute.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -418,17 +418,17 @@ The question is, then: *how can the author of a type reason about transmutations
418418
You may declare the stability guarantees of your type by implementing one or both of two traits:
419419
```rust
420420
pub trait PromiseTransmutableFrom
421+
where
422+
Self::Archetype: PromiseTransmutableFrom
421423
{
422-
type Archetype
423-
: TransmuteInto<Self, NeglectStability>
424-
+ PromiseTransmutableFrom;
424+
type Archetype: TransmuteInto<Self, NeglectStability>
425425
}
426426

427427
pub trait PromiseTransmutableInto
428+
where
429+
Self::Archetype: PromiseTransmutableInto,
428430
{
429-
type Archetype
430-
: TransmuteFrom<Self, NeglectStability>
431-
+ PromiseTransmutableInto;
431+
type Archetype: TransmuteFrom<Self, NeglectStability>
432432
}
433433
```
434434

@@ -810,13 +810,13 @@ This [minimal implementation][minimal-impl] is sufficient for convincing the com
810810

811811
### Listing for Initial, Minimal Implementation
812812
[minimal-impl]: #Listing-for-Initial-Minimal-Implementation
813-
This listing is both a minimal implementation of this RFC (excepting the automatic derives) and the **canonical specification** of this RFC's API surface ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=22a5ae2d502ede826392ea4044d48b84)):
813+
This listing is both a minimal implementation of this RFC (excepting the automatic derives) and the **canonical specification** of this RFC's API surface ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=1ff1700e6dba595f1e600d20da5d6387)):
814814
```rust
815815
#![feature(untagged_unions,const_fn,const_fn_union)] // for the impl of transmute free functions
816816
#![feature(const_generics)] // for stability declarations on `[T; N]`
817817
#![feature(decl_macro)] // for stub implementations of derives
818818
#![feature(never_type)] // for stability declarations on `!`
819-
#![allow(unused_unsafe, incomplete_features)]
819+
#![allow(warnings)]
820820

821821
/// Transmutation conversions.
822822
// suggested location: `core::convert`
@@ -964,20 +964,20 @@ pub mod transmute {
964964

965965
/// Declare that transmuting `Self` into `Archetype` is SemVer-stable.
966966
pub trait PromiseTransmutableInto
967+
where
968+
Self::Archetype: PromiseTransmutableInto
967969
{
968970
/// The `Archetype` must be safely transmutable from `Self`.
969-
type Archetype
970-
: TransmuteFrom<Self, NeglectStability>
971-
+ PromiseTransmutableInto;
971+
type Archetype: TransmuteFrom<Self, NeglectStability>;
972972
}
973973

974974
/// Declare that transmuting `Self` from `Archetype` is SemVer-stable.
975975
pub trait PromiseTransmutableFrom
976+
where
977+
Self::Archetype: PromiseTransmutableFrom
976978
{
977979
/// The `Archetype` must be safely transmutable into `Self`.
978-
type Archetype
979-
: TransmuteInto<Self, NeglectStability>
980-
+ PromiseTransmutableFrom;
980+
type Archetype: TransmuteInto<Self, NeglectStability>;
981981
}
982982

983983

0 commit comments

Comments
 (0)