Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Error not shown at the appropriate place when the error is in a macro invocation #87

Open
@utkarshkukreti

Description

@utkarshkukreti

Steps to reproduce:

$ cargo new a --bin
$ cd a
$ atom .
# edit src/main.rs
$ cat src/main.rs
fn main() {
    assert_eq!("one", 1);
}

Run linter in Atom in any of these modes: build, check, test, rustc, and you'll see the following error inserted by this package:

screen shot 2016-10-25 at 12 50 02 pm

Both the line numbers and the file name are wrong. Clicking on the at line 5 col 6 ... link takes me to a new file buffer with name <std macros>.

This is the output of cargo test:

cargo test
   Compiling a v0.1.0 (file:///private/tmp/a)
error[E0277]: the trait bound `&str: std::cmp::PartialEq<{integer}>` is not satisfied
 --> src/main.rs:2:5
  |
2 |     assert_eq!("one", 1);
  |     ^^^^^^^^^^^^^^^^^^^^^ trait `&str: std::cmp::PartialEq<{integer}>` not satisfied
  |
  = help: the following implementations were found:
  = help:   <str as std::cmp::PartialEq<std::ffi::OsString>>
  = help:   <str as std::cmp::PartialEq<std::ffi::OsStr>>
  = help:   <str as std::cmp::PartialEq<std::string::String>>
  = help:   <&'a str as std::cmp::PartialEq<std::string::String>>
  = help: and 3 others
  = note: this error originates in a macro outside of the current crate

error: aborting due to previous error

error: Could not compile `a`.

To learn more, run the command again with --verbose.

which does include the appropriate place to insert the error: src/main.rs:2:5.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions