about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-04-02 00:40:38 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-04-02 00:40:38 +0530
commit9eb0bab9dee6e650ce6f9e01f0e3eb22ca302790 (patch)
tree7563298341e5828d924b91686298b9bdfc2172e9 /src/libcore
parentabd747cd153c1ef3648831916017fb692200387d (diff)
parent15b58fedcacba7d10a9f7d460a83da645a09ad3e (diff)
downloadrust-9eb0bab9dee6e650ce6f9e01f0e3eb22ca302790.tar.gz
rust-9eb0bab9dee6e650ce6f9e01f0e3eb22ca302790.zip
Rollup merge of #23867 - nikomatsakis:issue-23086-take-3, r=pnkfelix
This PR implements rust-lang/rfcs#1023. In the process it fixes #23086 and #23516. A few impls in libcore had to be updated, but the impact is generally pretty minimal. Most of the fallout is in the tests that probed the limits of today's coherence.

I tested and we were able to build the most popular crates along with iron (modulo errors around errors being sendable).

Fixes #23918.

Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/any.rs8
-rw-r--r--src/libcore/fmt/mod.rs6
-rw-r--r--src/libcore/lib.rs2
-rw-r--r--src/libcore/marker.rs1
-rw-r--r--src/libcore/ops.rs3
5 files changed, 14 insertions, 6 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index 0ffc4a229b5..320fdd50b35 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -71,6 +71,7 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
+use fmt;
 use marker::Send;
 use mem::transmute;
 use option::Option::{self, Some, None};
@@ -105,6 +106,13 @@ impl<T> Any for T
 // Extension methods for Any trait objects.
 ///////////////////////////////////////////////////////////////////////////////
 
+#[stable(feature = "rust1", since = "1.0.0")]
+impl fmt::Debug for Any {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        f.pad("Any")
+    }
+}
+
 impl Any {
     /// Returns true if the boxed type is the same as `T`
     #[stable(feature = "rust1", since = "1.0.0")]
diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs
index ffb358cdac8..3f8bbeb1feb 100644
--- a/src/libcore/fmt/mod.rs
+++ b/src/libcore/fmt/mod.rs
@@ -12,7 +12,6 @@
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
-use any;
 use cell::{Cell, RefCell, Ref, RefMut, BorrowState};
 use char::CharExt;
 use iter::Iterator;
@@ -998,11 +997,6 @@ macro_rules! tuple {
 tuple! { T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, }
 
 #[stable(feature = "rust1", since = "1.0.0")]
-impl<'a> Debug for &'a (any::Any+'a) {
-    fn fmt(&self, f: &mut Formatter) -> Result { f.pad("&Any") }
-}
-
-#[stable(feature = "rust1", since = "1.0.0")]
 impl<T: Debug> Debug for [T] {
     fn fmt(&self, f: &mut Formatter) -> Result {
         self.iter().fold(f.debug_list(), |b, e| b.entry(e)).finish()
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index 5e8b7fba1f1..3a9af50fefb 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -70,8 +70,10 @@
 #![feature(unboxed_closures)]
 #![feature(rustc_attrs)]
 #![feature(optin_builtin_traits)]
+#![feature(fundamental)]
 #![feature(concat_idents)]
 #![feature(reflect)]
+#![feature(custom_attribute)]
 
 #[macro_use]
 mod macros;
diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs
index f755c912fcd..97bde9fc96e 100644
--- a/src/libcore/marker.rs
+++ b/src/libcore/marker.rs
@@ -49,6 +49,7 @@ impl !Send for Managed { }
 #[stable(feature = "rust1", since = "1.0.0")]
 #[lang="sized"]
 #[rustc_on_unimplemented = "`{Self}` does not have a constant size known at compile-time"]
+#[fundamental] // for Default, for example, which requires that `[T]: !Default` be evaluatable
 pub trait Sized : MarkerTrait {
     // Empty.
 }
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 862eb16d0bf..399aec9afd4 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -1117,6 +1117,7 @@ impl<'a, T: ?Sized> DerefMut for &'a mut T {
 #[lang="fn"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_paren_sugar]
+#[fundamental] // so that regex can rely that `&str: !FnMut`
 pub trait Fn<Args> : FnMut<Args> {
     /// This is called when the call operator is used.
     extern "rust-call" fn call(&self, args: Args) -> Self::Output;
@@ -1126,6 +1127,7 @@ pub trait Fn<Args> : FnMut<Args> {
 #[lang="fn_mut"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_paren_sugar]
+#[fundamental] // so that regex can rely that `&str: !FnMut`
 pub trait FnMut<Args> : FnOnce<Args> {
     /// This is called when the call operator is used.
     extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
@@ -1135,6 +1137,7 @@ pub trait FnMut<Args> : FnOnce<Args> {
 #[lang="fn_once"]
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_paren_sugar]
+#[fundamental] // so that regex can rely that `&str: !FnMut`
 pub trait FnOnce<Args> {
     /// The returned type after the call operator is used.
     type Output;