]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/ufcs-polymorphic-paths.rs
std: Clean out deprecated APIs
[rust.git] / src / test / run-pass / ufcs-polymorphic-paths.rs
index 685ce589bfa0349b1065c7dbd40fd01e72986f9f..491045564ce222b6f81d2530311feaf5b1d34e66 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(into_cow)]
-
-use std::borrow::{Cow, IntoCow};
+use std::borrow::{Cow, ToOwned};
 use std::default::Default;
 use std::iter::FromIterator;
 use std::ops::Add;
@@ -25,6 +23,16 @@ fn rand<R: Rng>(_rng: &mut R) -> Self { Default::default() }
 }
 impl Rand for i32 { }
 
+pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
+    fn into_cow(self) -> Cow<'a, B>;
+}
+
+impl<'a> IntoCow<'a, str> for String {
+    fn into_cow(self) -> Cow<'a, str> {
+        Cow::Owned(self)
+    }
+}
+
 #[derive(PartialEq, Eq)]
 struct Newt<T>(T);