Auto merge of #17554 - mbrubeck:oibit, r=ManishEarth

Stop using the unstable optin_builtin_traits feature

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix part of #5286.
- [x] These changes do not require tests because they are refactoring only.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17554)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-06-28 19:11:08 -07:00 committed by GitHub
commit 6d7fdb484b
2 changed files with 6 additions and 8 deletions

View file

@ -11,6 +11,7 @@ use std::ascii::AsciiExt;
use std::borrow::{Borrow, Cow, ToOwned};
use std::fmt;
use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
use std::ops;
use std::ops::{Deref, DerefMut};
use std::str;
@ -152,19 +153,17 @@ pub fn is_token(s: &[u8]) -> bool {
/// This type is currently `!Send`, in order to help with an independent
/// experiment to store `JSString`s rather than Rust `String`s.
#[derive(Clone, Debug, Eq, Hash, HeapSizeOf, Ord, PartialEq, PartialOrd)]
pub struct DOMString(String);
impl !Send for DOMString {}
pub struct DOMString(String, PhantomData<*const ()>);
impl DOMString {
/// Creates a new `DOMString`.
pub fn new() -> DOMString {
DOMString(String::new())
DOMString(String::new(), PhantomData)
}
/// Creates a new `DOMString` from a `String`.
pub fn from_string(s: String) -> DOMString {
DOMString(s)
DOMString(s, PhantomData)
}
/// Appends a given string slice onto the end of this String.
@ -197,7 +196,7 @@ impl Borrow<str> for DOMString {
impl Default for DOMString {
fn default() -> Self {
DOMString(String::new())
DOMString(String::new(), PhantomData)
}
}
@ -244,7 +243,7 @@ impl<'a> PartialEq<&'a str> for DOMString {
impl From<String> for DOMString {
fn from(contents: String) -> DOMString {
DOMString(contents)
DOMString(contents, PhantomData)
}
}

View file

@ -9,7 +9,6 @@
#![feature(mpsc_select)]
#![feature(nonzero)]
#![feature(on_unimplemented)]
#![feature(optin_builtin_traits)]
#![feature(option_entry)]
#![feature(plugin)]
#![feature(proc_macro)]