You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cargo new foo
$ cd foo
foo $ cargo new bar
foo $ cat << EOF >> Cargo.toml
> [dependencies.bar]
> path = "bar"
> EOF
foo $ echo "this is a syntax error" >> bar/src/lib.rs
foo $ cargo build
Compiling bar v0.0.1 (file:///tmp/foo)
/tmp/foo/bar/src/lib.rs:4:1: 4:5 error: expected item, found `this`
/tmp/foo/bar/src/lib.rs:4 this is a syntax error
^~~~
[...]
This works as expected. Adding a [lib] section with a path attribute to
bar/Cargo.toml results in errors printed with a path relative to bar, which
confuses editors trying to match errors to source lines.
foo $ cat << EOF >> bar/Cargo.toml
> [lib]
> name = "bar"
> path = "src/lib.rs"
> EOF
foo $ cargo build
Compiling bar v0.0.1 (file:///tmp/foo)
src/lib.rs:4:1: 4:5 error: expected item, found `this`
src/lib.rs:4 this is a syntax error
^~~~
[...]
The text was updated successfully, but these errors were encountered:
Consider:
This works as expected. Adding a [lib] section with a path attribute to
bar/Cargo.toml results in errors printed with a path relative to bar, which
confuses editors trying to match errors to source lines.
The text was updated successfully, but these errors were encountered: