-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Cannot create local mono-item #48751
Comments
I got this as well on a library using futures on rustc 1.27.0-nightly (ad610be 2018-04-11)
|
The code generating this error seems to be, #[derive(Serialize, Deserialize, Clone, Debug)]
pub enum FromResolver {
Resolved(Vec<SocketAddr>),
Response(Vec<Path>),
Published,
Unpublished,
Error(String)
}
fn send(
w: WriteHalf<TcpStream>,
m: FromResolver
) -> impl Future<Item=WriteHalf<TcpStream>, Error=()> {
match serde_json::to_vec(&m) {
Err(_) => future::err(()),
Ok(m) => future::ok(m)
}.and_then(|m| {
write_all(w, m).map_err(|_| ())
.and_then(|(w, _)| {
write_all(w, "\n").map_err(|_| ())
.and_then(|(w, _)| Ok(w))
})
})
} |
So if I box all my futures instead of impl Future at the public api of the crate then that works around this bug. e.g. even though |
Am I correct in that there's no reproducible example of this issue with any sample of code, small or large? If so I think we'd probably have to close as it'll be hard to track down without that. |
Don't close it, I'm working on it, it's not that easy, it's something to do
with cross crate looking and impl trait
…On Sat, Jun 2, 2018, 14:52 Mark Simulacrum ***@***.***> wrote:
Am I correct in that there's no reproducible example of this issue with
any sample of code, small or large? If so I think we'd probably have to
close as it'll be hard to track down without that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#48751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGyTrNmhYusSZEHbrAMmu_uxE8O3OnqOks5t4t7xgaJpZM4SciNQ>
.
|
Linking not looking
…On Sat, Jun 2, 2018, 14:57 Eric Stokes ***@***.***> wrote:
Don't close it, I'm working on it, it's not that easy, it's something to
do with cross crate looking and impl trait
On Sat, Jun 2, 2018, 14:52 Mark Simulacrum ***@***.***>
wrote:
> Am I correct in that there's no reproducible example of this issue with
> any sample of code, small or large? If so I think we'd probably have to
> close as it'll be hard to track down without that.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#48751 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AGyTrNmhYusSZEHbrAMmu_uxE8O3OnqOks5t4t7xgaJpZM4SciNQ>
> .
>
|
#50865 is the same bug, and someone managed to produce a minimal example,
so you can link this bug to that one and close.
…On Sat, Jun 2, 2018 at 2:52 PM, Mark Simulacrum ***@***.***> wrote:
Am I correct in that there's no reproducible example of this issue with
any sample of code, small or large? If so I think we'd probably have to
close as it'll be hard to track down without that.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#48751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGyTrNmhYusSZEHbrAMmu_uxE8O3OnqOks5t4t7xgaJpZM4SciNQ>
.
|
Thanks; closing in favor of #50865. |
I'm getting the following ICE on at least various nightlies going back a month.
I've tried to get a smaller repro but as yet haven't been successful. Below is some code to give an idea of what's going on in case it's useful, but as mentioned something's missing as it doesn't repro.
And in another crate (if same crate then it works fine):
Also if I replace
Arc
withborrow::Borrow
, it works fine.The text was updated successfully, but these errors were encountered: