Skip to content
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

Macros not emiting the line they are expanded on in nightly #33280

Closed
enricostano opened this issue Apr 29, 2016 · 3 comments
Closed

Macros not emiting the line they are expanded on in nightly #33280

enricostano opened this issue Apr 29, 2016 · 3 comments

Comments

@enricostano
Copy link

I noticed that running try!() macro in main() doesn't add line numbers in errors.

Code: http://is.gd/m7CFnx

It works fine in stable and beta, seems a nightly regression.

@codyps
Copy link
Contributor

codyps commented Apr 29, 2016

Might be related to #32747.

Appears that warnings/errors emitted by macros no longer are printing the line they were expanded on, and instead are just printing their line of definition twice.

Using this issue as an example:

Nightly gives:

<std macros>:5:8: 6:45 error: mismatched types:
 expected `()`,
    found `std::result::Result<_, _>`
(expected (),
    found enum `std::result::Result`) [E0308]
<std macros>:5 return $ crate :: result :: Result :: Err (
<std macros>:6 $ crate :: convert :: From :: from ( err ) ) } } )
<std macros>:5:8: 6:45 note: in this expansion of try! (defined in <std macros>)
<std macros>:5:8: 6:45 help: see the detailed explanation for E0308
error: aborting due to previous error
playpen: application terminated with error code 101

Beta/stable gives:

<std macros>:5:8: 6:42 error: mismatched types:
 expected `()`,
    found `core::result::Result<_, _>`
(expected (),
    found enum `core::result::Result`) [E0308]
<std macros>:5 return $ crate:: result:: Result:: Err (
<std macros>:6 $ crate:: convert:: From:: from ( err ) ) } } )
<anon>:2:5: 2:18 note: in this expansion of try! (defined in <std macros>)
<std macros>:5:8: 6:42 help: see the detailed explanation for E0308
error: aborting due to previous error
playpen: application terminated with error code 101

Relavent differing lines:

-<anon>:2:5: 2:18 note: in this expansion of try! (defined in <std macros>)
+<std macros>:5:8: 6:45 note: in this expansion of try! (defined in <std macros>)

@jseyfried
Copy link
Contributor

This was fixed in #33730.

@Mark-Simulacrum
Copy link
Member

Closing, since this was fixed, it seems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants