diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs index 5816fe58bc9b1..abb68d8fe0dc2 100644 --- a/src/librustc_typeck/collect.rs +++ b/src/librustc_typeck/collect.rs @@ -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(¶m_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)); } } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5890a750f6edb..bfd01356226f4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -114,7 +114,6 @@ #![feature(lang_items)] #![feature(libc)] #![feature(linkage, thread_local, asm)] -#![feature(old_impl_check)] #![feature(optin_builtin_traits)] #![feature(rand)] #![feature(staged_api)] diff --git a/src/libstd/old_io/mod.rs b/src/libstd/old_io/mod.rs index 1bbd602b18af4..aaa55c5d1d9b9 100644 --- a/src/libstd/old_io/mod.rs +++ b/src/libstd/old_io/mod.rs @@ -1588,9 +1588,7 @@ pub trait Seek { /// connections. /// /// Doing so produces some sort of Acceptor. -pub trait Listener> - : PhantomFn // FIXME should be an assoc type anyhow -{ +pub trait Listener { /// Spin up the listener and start queuing incoming connections /// /// # Error @@ -1601,13 +1599,16 @@ pub trait Listener> } /// An acceptor is a value that presents incoming connections -pub trait Acceptor { +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; + fn accept(&mut self) -> IoResult; /// 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> Iterator for IncomingConnections<'a, A> { - type Item = IoResult; +impl<'a, A: ?Sized + Acceptor> Iterator for IncomingConnections<'a, A> { + type Item = IoResult; - fn next(&mut self) -> Option> { + fn next(&mut self) -> Option> { Some(self.inc.accept()) } } diff --git a/src/libstd/old_io/net/pipe.rs b/src/libstd/old_io/net/pipe.rs index 2f3cf3d84d092..3a071e832af64 100644 --- a/src/libstd/old_io/net/pipe.rs +++ b/src/libstd/old_io/net/pipe.rs @@ -202,7 +202,7 @@ impl UnixListener { } } -impl Listener for UnixListener { +impl Listener for UnixListener { fn listen(self) -> IoResult { self.inner.listen() .map(|inner| UnixAcceptor { inner: inner }) @@ -250,7 +250,8 @@ impl UnixAcceptor { } } -impl Acceptor for UnixAcceptor { +impl Acceptor for UnixAcceptor { + type Connection = UnixStream; fn accept(&mut self) -> IoResult { self.inner.accept().map(|s| { UnixStream { inner: s } diff --git a/src/libstd/old_io/net/tcp.rs b/src/libstd/old_io/net/tcp.rs index d55d9ca11d14c..7fc460c16efca 100644 --- a/src/libstd/old_io/net/tcp.rs +++ b/src/libstd/old_io/net/tcp.rs @@ -338,7 +338,7 @@ impl TcpListener { } } -impl Listener for TcpListener { +impl Listener for TcpListener { fn listen(self) -> IoResult { self.inner.listen(128).map(|a| TcpAcceptor { inner: a }) } @@ -453,7 +453,8 @@ impl TcpAcceptor { } } -impl Acceptor for TcpAcceptor { +impl Acceptor for TcpAcceptor { + type Connection = TcpStream; fn accept(&mut self) -> IoResult { self.inner.accept().map(TcpStream::new) } diff --git a/src/libstd/old_io/result.rs b/src/libstd/old_io/result.rs index cda19f8ae8466..e1037f26b7fcf 100644 --- a/src/libstd/old_io/result.rs +++ b/src/libstd/old_io/result.rs @@ -58,7 +58,7 @@ impl Seek for IoResult { } } -impl, L: Listener> Listener for IoResult { +impl> Listener for IoResult { fn listen(self) -> IoResult { match self { Ok(listener) => listener.listen(), @@ -67,8 +67,9 @@ impl, L: Listener> Listener for IoResult { } } -impl> Acceptor for IoResult { - fn accept(&mut self) -> IoResult { +impl Acceptor for IoResult { + type Connection = A::Connection; + fn accept(&mut self) -> IoResult { match *self { Ok(ref mut acceptor) => acceptor.accept(), Err(ref e) => Err(e.clone()), diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 5e80966a6177b..f208a90b4d5d7 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -102,9 +102,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // 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), @@ -277,7 +274,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ // FIXME: #19470 this shouldn't be needed forever ("old_orphan_check", Whitelisted), - ("old_impl_check", Whitelisted), ("rustc_paren_sugar", Whitelisted), // FIXME: #18101 temporary unboxed closure hack // Crate level attributes @@ -585,13 +581,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { 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"); - } } _ => {}