]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #23749: alexcrichton/remove-old-impl-check
authorAlex Crichton <alex@alexcrichton.com>
Fri, 27 Mar 2015 17:10:38 +0000 (10:10 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 27 Mar 2015 17:10:38 +0000 (10:10 -0700)
Conflicts:
src/libsyntax/feature_gate.rs

src/librustc_typeck/collect.rs
src/libstd/lib.rs
src/libstd/old_io/mod.rs
src/libstd/old_io/net/pipe.rs
src/libstd/old_io/net/tcp.rs
src/libstd/old_io/result.rs
src/libsyntax/feature_gate.rs

index 5816fe58bc9b1b25948ae56670bb2032fb94470e..abb68d8fe0dc2a369b3f34363846f8ae90cd3cc4 100644 (file)
@@ -2208,18 +2208,10 @@ fn enforce_impl_ty_params_are_constrained<'tcx>(tcx: &ty::ctxt<'tcx>,
                                      idx: index as u32,
                                      name: ty_param.ident.name };
         if !input_parameters.contains(&param_ty) {
-            if ty::has_attr(tcx, impl_def_id, "old_impl_check") {
-                tcx.sess.span_warn(
-                    ty_param.span,
-                    &format!("the type parameter `{}` is not constrained by the \
-                              impl trait, self type, or predicates",
-                             param_ty.user_string(tcx)));
-            } else {
-                span_err!(tcx.sess, ty_param.span, E0207,
-                    "the type parameter `{}` is not constrained by the \
-                             impl trait, self type, or predicates",
-                            param_ty.user_string(tcx));
-            }
+            span_err!(tcx.sess, ty_param.span, E0207,
+                "the type parameter `{}` is not constrained by the \
+                         impl trait, self type, or predicates",
+                        param_ty.user_string(tcx));
         }
     }
 }
index 10050d0bb4fbee3edf4f2186b17cd4a623326733..420f6c49c266c8dfc75b9c799a71aa236081285c 100644 (file)
 #![feature(lang_items)]
 #![feature(libc)]
 #![feature(linkage, thread_local, asm)]
-#![feature(old_impl_check)]
 #![feature(optin_builtin_traits)]
 #![feature(rand)]
 #![feature(staged_api)]
index 1bbd602b18af479d4e06303eabbda988c1de197d..aaa55c5d1d9b9eba876ea1aa10773ffbd799b556 100644 (file)
@@ -1588,9 +1588,7 @@ pub trait Seek {
 /// connections.
 ///
 /// Doing so produces some sort of Acceptor.
-pub trait Listener<T, A: Acceptor<T>>
-    : PhantomFn<T,T> // FIXME should be an assoc type anyhow
-{
+pub trait Listener<A: Acceptor> {
     /// Spin up the listener and start queuing incoming connections
     ///
     /// # Error
@@ -1601,13 +1599,16 @@ pub trait Listener<T, A: Acceptor<T>>
 }
 
 /// An acceptor is a value that presents incoming connections
-pub trait Acceptor<T> {
+pub trait Acceptor {
+    /// Type of connection that is accepted by this acceptor.
+    type Connection;
+
     /// Wait for and accept an incoming connection
     ///
     /// # Error
     ///
     /// Returns `Err` if an I/O error is encountered.
-    fn accept(&mut self) -> IoResult<T>;
+    fn accept(&mut self) -> IoResult<Self::Connection>;
 
     /// Create an iterator over incoming connection attempts.
     ///
@@ -1628,11 +1629,10 @@ pub struct IncomingConnections<'a, A: ?Sized +'a> {
     inc: &'a mut A,
 }
 
-#[old_impl_check]
-impl<'a, T, A: ?Sized + Acceptor<T>> Iterator for IncomingConnections<'a, A> {
-    type Item = IoResult<T>;
+impl<'a, A: ?Sized + Acceptor> Iterator for IncomingConnections<'a, A> {
+    type Item = IoResult<A::Connection>;
 
-    fn next(&mut self) -> Option<IoResult<T>> {
+    fn next(&mut self) -> Option<IoResult<A::Connection>> {
         Some(self.inc.accept())
     }
 }
index 2f3cf3d84d092680798917090e2e562e84bf7f21..3a071e832af64baa01133cc934eb18ae775becd2 100644 (file)
@@ -202,7 +202,7 @@ pub fn bind<P: BytesContainer>(path: P) -> IoResult<UnixListener> {
     }
 }
 
-impl Listener<UnixStream, UnixAcceptor> for UnixListener {
+impl Listener<UnixAcceptor> for UnixListener {
     fn listen(self) -> IoResult<UnixAcceptor> {
         self.inner.listen()
             .map(|inner| UnixAcceptor { inner: inner })
@@ -250,7 +250,8 @@ pub fn close_accept(&mut self) -> IoResult<()> {
     }
 }
 
-impl Acceptor<UnixStream> for UnixAcceptor {
+impl Acceptor for UnixAcceptor {
+    type Connection = UnixStream;
     fn accept(&mut self) -> IoResult<UnixStream> {
         self.inner.accept().map(|s| {
             UnixStream { inner: s }
index d55d9ca11d14cf5391392ef89e5acb3be9c35166..7fc460c16efca2454a61b7e48bb5d606c62741cf 100644 (file)
@@ -338,7 +338,7 @@ pub fn socket_name(&mut self) -> IoResult<SocketAddr> {
     }
 }
 
-impl Listener<TcpStream, TcpAcceptor> for TcpListener {
+impl Listener<TcpAcceptor> for TcpListener {
     fn listen(self) -> IoResult<TcpAcceptor> {
         self.inner.listen(128).map(|a| TcpAcceptor { inner: a })
     }
@@ -453,7 +453,8 @@ pub fn close_accept(&mut self) -> IoResult<()> {
     }
 }
 
-impl Acceptor<TcpStream> for TcpAcceptor {
+impl Acceptor for TcpAcceptor {
+    type Connection = TcpStream;
     fn accept(&mut self) -> IoResult<TcpStream> {
         self.inner.accept().map(TcpStream::new)
     }
index cda19f8ae84669cc4abd3de56b219100590f6a06..e1037f26b7fcf575bf61f50a0905745125ceb6da 100644 (file)
@@ -58,7 +58,7 @@ fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> {
     }
 }
 
-impl<T, A: Acceptor<T>, L: Listener<T, A>> Listener<T, A> for IoResult<L> {
+impl<A: Acceptor, L: Listener<A>> Listener<A> for IoResult<L> {
     fn listen(self) -> IoResult<A> {
         match self {
             Ok(listener) => listener.listen(),
@@ -67,8 +67,9 @@ fn listen(self) -> IoResult<A> {
     }
 }
 
-impl<T, A: Acceptor<T>> Acceptor<T> for IoResult<A> {
-    fn accept(&mut self) -> IoResult<T> {
+impl<A: Acceptor> Acceptor for IoResult<A> {
+    type Connection = A::Connection;
+    fn accept(&mut self) -> IoResult<A::Connection> {
         match *self {
             Ok(ref mut acceptor) => acceptor.accept(),
             Err(ref e) => Err(e.clone()),
index ad0fa500c2875ddb15f879e2a29496cc3b708b07..70f43776ff0c1ad6b3eed77777701e870ffa30b6 100644 (file)
     // A way to temporarily opt out of the new orphan rules. This will *never* be accepted.
     ("old_orphan_check", "1.0.0", Deprecated),
 
-    // A way to temporarily opt out of the new impl rules. This will *never* be accepted.
-    ("old_impl_check", "1.0.0", Deprecated),
-
     // OIBIT specific features
     ("optin_builtin_traits", "1.0.0", Active),
 
@@ -276,7 +273,6 @@ enum Status {
 
     // FIXME: #19470 this shouldn't be needed forever
     ("old_orphan_check", Whitelisted),
-    ("old_impl_check", Whitelisted),
 
     ("rustc_paren_sugar", Gated("unboxed_closures",
                                 "unboxed_closures are still evolving")),
@@ -588,13 +584,6 @@ fn visit_item(&mut self, i: &ast::Item) {
                         i.span,
                         "the new orphan check rules will eventually be strictly enforced");
                 }
-
-                if attr::contains_name(&i.attrs[..],
-                                       "old_impl_check") {
-                    self.gate_feature("old_impl_check",
-                                      i.span,
-                                      "`#[old_impl_check]` will be removed in the future");
-                }
             }
 
             _ => {}