-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
nightly doesn't show the line number for some error #51219
Comments
I'll take a look. |
I was able to get the error and I have the expected lines: fn main() {
enum Mouth {Foo{x: i32}, Bar};
let x = Mouth::Foo {y: 0};
} Can you provide a small code sample with this issue please? |
It might have something to do with formatting. The following code causes the problem for me but the problem goes away if I format the code using deps[dependencies]
failure = "0.1"
futures-await = "0.1"
ldap3 = "0.6"
tokio-core = "0.1" code#![feature(proc_macro, generators)]
extern crate futures_await as futures;
extern crate ldap3;
extern crate tokio_core;
#[macro_use]
extern crate failure;
use tokio_core::reactor::Handle;
use ldap3::{LdapConnAsync, Scope};
use futures::prelude::*;
use failure::Error;
use std::io::Write;
#[derive(Fail)]
enum LdapError {
#[fail(display = "InvalidCreds: {}", name)]
InvalidCreds { name: String },
#[fail(display = "NotInGroup: {}", group_name)]
NotInGroup { group_name: String },
}
#[async]
fn test_user_has_access(handle: Handle) -> Result<(), Error> {
let r = LdapConnAsync::new("ldap://localhost:2389", &handle)?
.map_err(|e| {
let e2: Error = e.into();
e2
})
.and_then(move |ldap| {
ldap.simple_bind("bind_user", "bind_pass")
.map_err(Into::into)
.and_then(move |ldap2| {
let j = if ldap2.rc == 49 {
Err(LdapError::InvalidCreds { name: "some_user".to_string() }.into())
} else {
Ok(())
};
j.into_future().and_then(|()| {
ldap.search("something", Scope::Subtree, "something", vec![])
.map_err(Into::into)
})
})
});
return Err(LdapError::NotInGroup {
name: "test".to_string(),
}.into());
}
fn main() {} |
Ok, I think the problem comes from async/await. cc @rust-lang/compiler |
That output seems consistent with a lack of spans or finding |
@estebank It might be caused, in this case, by macro expansion. |
@eddyb that sounds likely. |
I suspect this is somewhat "unfixable" -- proc macros sometimes just lose spans if they make no effort to preserve them. As such, I'm going to close; if a minimal example can be shown to have a similar error with just macro_rules we can probably reopen. |
I don't entirely agree, but we already have #51635 covering related remediations so closing this should be ok. |
nightly-x86_64-unknown-linux-gnu (default)
rustc 1.28.0-nightly (524ad9b 2018-05-29)
Here's an error without a line number:
The text was updated successfully, but these errors were encountered: