-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TAIT feature is broken #126387
Comments
Yes this is intentional. You need to move the tait declaration and the method(s) that actually constrain its hidden type into its own submodule. When we get the |
Though I'm not sure which defining use to move in that piece of code; I probably missed it somewhere else. |
most importantly you need to move the type alias definition into a module. Then the compiler will happily give you type mismatches for the actual defining uses |
@Sherlock-Holo as an example for the procedure Oli suggested, and for others who may stumble upon the same issue in the future, the following simple code move should fix your error for now, until $ diff --git a/server/src/server.rs b/server/src/server.rs
index d6fd886..a55a401 100644
--- a/server/src/server.rs
+++ b/server/src/server.rs
@@ -1,22 +1,58 @@
use std::future::Future;
-use std::io;
-use futures_rustls::rustls::ServerConfig;
-use futures_util::{Stream, StreamExt, TryStreamExt};
-use hyper_util::rt::TokioTimer;
+use futures_util::StreamExt;
use protocol::accept::Executor;
-use protocol::auth::Auth;
use protocol::HyperListener;
use share::dns::HickoryDnsResolver;
use share::proxy;
-use share::tcp_wrapper::{TcpListenerAddrStream, TokioTcp};
use tap::TapFallible;
-use tokio::net::{TcpListener, TcpStream};
+use tokio::net::TcpStream;
use tracing::{error, info};
use crate::Error;
-type TokioTcpAcceptor = impl Stream<Item = io::Result<TokioTcp>> + Send + Unpin;
+mod inner {
+ use std::io;
+
+ use futures_rustls::rustls::ServerConfig;
+ use futures_util::{Stream, TryStreamExt};
+ use hyper_util::rt::TokioTimer;
+ use protocol::auth::Auth;
+ use protocol::HyperListener;
+ use share::dns::HickoryDnsResolver;
+ use share::tcp_wrapper::{TcpListenerAddrStream, TokioTcp};
+ use tokio::net::TcpListener;
+
+ use crate::Error;
+
+ pub type TokioTcpAcceptor = impl Stream<Item = io::Result<TokioTcp>> + Send + Unpin;
+
+ impl super::HyperServer {
+ pub fn new(
+ token_header: String,
+ auth: Auth,
+ tcp_listener: TcpListener,
+ server_tls_config: ServerConfig,
+ ) -> Result<Self, Error> {
+ let tcp_listener = TcpListenerAddrStream::from(tcp_listener)
+ .map_ok(|(stream, _)| TokioTcp::from(stream));
+
+ let protocol_listener = HyperListener::new(
+ tcp_listener,
+ super::TokioExecutorWrapper,
+ server_tls_config,
+ token_header,
+ auth,
+ HickoryDnsResolver::new()?,
+ TokioTimer::new(),
+ );
+
+ Ok(Self { protocol_listener })
+ }
+ }
+}
+
+use inner::TokioTcpAcceptor;
pub struct HyperServer {
protocol_listener: HyperListener<TokioTcpAcceptor, TokioExecutorWrapper, HickoryDnsResolver>,
@@ -36,28 +72,6 @@ impl Executor for TokioExecutorWrapper {
}
impl HyperServer {
- pub fn new(
- token_header: String,
- auth: Auth,
- tcp_listener: TcpListener,
- server_tls_config: ServerConfig,
- ) -> Result<Self, Error> {
- let tcp_listener =
- TcpListenerAddrStream::from(tcp_listener).map_ok(|(stream, _)| TokioTcp::from(stream));
-
- let protocol_listener = HyperListener::new(
- tcp_listener,
- TokioExecutorWrapper,
- server_tls_config,
- token_header,
- auth,
- HickoryDnsResolver::new()?,
- TokioTimer::new(),
- );
-
- Ok(Self { protocol_listener })
- }
-
pub async fn start(self) -> Result<(), Error> {
let (task, mut acceptor) = self.protocol_listener.listen();
tokio::spawn(task); |
@lqd thanks, I will try this to fix the error |
@oli-obk Will |
I am attempting to get it done before August, but if that fails I won't be working on it this year. It is not something that particularly needs me to do it, anyone with HIR, parser and AST knowledge can work on this. I recommend pinning your nightly until that attribute exists. |
Thanks. Is there a tracking issue for this? |
There is not, but there is now a PR that fixes that: #128440 I'm not going to work on it for the next 4 months, but if anyone wants to pick it up, that would be great! All the annoying "edit 200+ tests" changes are done, so I believe it "just needs cleanups and diagnostics work", but reviewers may find more things 😆 |
Code
try to build my project with nightly rust
I expected to see this happen: build success
Instead, this happened: build failed, with error message like
Version it worked on
It most recently worked on:
Version with regression
cargo bisect-rustc report
The text was updated successfully, but these errors were encountered: