diff options
| author | bors <bors@rust-lang.org> | 2014-12-17 02:42:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-12-17 02:42:57 +0000 |
| commit | 4265e86844b6f328ed8a0d144d02a935706c35ee (patch) | |
| tree | a5459481d02303fe3d3cc025dc037eaa16f4d7c5 /src/libstd | |
| parent | 42deaa5e42c0b8a9e305aa5de5d6953b24b77aca (diff) | |
| parent | 769aa0a7b378a7b71f5bcbec3485fe171ff4f3b9 (diff) | |
| download | rust-4265e86844b6f328ed8a0d144d02a935706c35ee.tar.gz rust-4265e86844b6f328ed8a0d144d02a935706c35ee.zip | |
auto merge of #19761 : nick29581/rust/coerce-double, r=nikomatsakis
Part of #18469 [breaking-change] A receiver will only ever get a single auto-reference. Previously arrays and strings would get two, e.g., [T] would be auto-ref'ed to &&[T]. This is usually apparent when a trait is implemented for `&[T]` and has a method takes self by reference. The usual solution is to implement the trait for `[T]` (the DST form). r? @nikomatsakis (or anyone else, really)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/ascii.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/ascii.rs b/src/libstd/ascii.rs index 342f5b87bd8..edf88a84893 100644 --- a/src/libstd/ascii.rs +++ b/src/libstd/ascii.rs @@ -170,7 +170,7 @@ impl<'a> fmt::Show for Ascii { /// Trait for converting into an ascii type. #[experimental = "may be replaced by generic conversion traits"] -pub trait AsciiCast<T> { +pub trait AsciiCast<T> for Sized? { /// Convert to an ascii type, panic on non-ASCII input. #[inline] fn to_ascii(&self) -> T { @@ -196,10 +196,10 @@ pub trait AsciiCast<T> { } #[experimental = "may be replaced by generic conversion traits"] -impl<'a> AsciiCast<&'a[Ascii]> for &'a [u8] { +impl<'a> AsciiCast<&'a[Ascii]> for [u8] { #[inline] unsafe fn to_ascii_nocheck(&self) -> &'a[Ascii] { - mem::transmute(*self) + mem::transmute(self) } #[inline] @@ -212,10 +212,10 @@ impl<'a> AsciiCast<&'a[Ascii]> for &'a [u8] { } #[experimental = "may be replaced by generic conversion traits"] -impl<'a> AsciiCast<&'a [Ascii]> for &'a str { +impl<'a> AsciiCast<&'a [Ascii]> for str { #[inline] unsafe fn to_ascii_nocheck(&self) -> &'a [Ascii] { - mem::transmute(*self) + mem::transmute(self) } #[inline] |
