-
Notifications
You must be signed in to change notification settings - Fork 142
Open
Description
With the following file contents:
Cargo.toml
[package]
name = "a"
version = "0.1.0"
edition = "2024"
[dependencies]
async-net = "2.0.0"
smol = "2.0.2"
tiberius = { version = "0.12.3", features = ["sql-browser-smol"] }
src/main.rs
use tiberius::SqlBrowser;
fn main() {
smol::block_on(async move {
let config = tiberius::Config::new();
// Weird syntax to show bug, as if you just do it directly it doesn't show the trait error.
let socket = <async_net::TcpStream as SqlBrowser>::connect_named(&config).await.unwrap();
});
}
This produces the following error:
Compiling a v0.1.0 (/home/powpingdone/extern/a)
error[E0277]: the trait bound `async_net::TcpStream: SqlBrowser` is not satisfied
--> src/main.rs:6:23
|
6 | let socket = <async_net::TcpStream as SqlBrowser>::connect_named(&config).await.unwrap();
| ^^^^^^^^^^^^^^^^^^^^ the trait `SqlBrowser` is not implemented for `async_net::TcpStream`
|
= help: the trait `SqlBrowser` is implemented for `async_net::tcp::TcpStream`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `a` (bin "a") due to 1 previous error
However, you cannot use async_net::tcp::TcpStream
from async_net
2.0 due to it being a private definition. Likely fix is defining SqlBrowser
on async_net::TcpStream
directly.
Metadata
Metadata
Assignees
Labels
No labels