Skip to content

Rust cargo linter fails #1202

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

Closed
christianlask opened this issue Dec 7, 2017 · 3 comments
Closed

Rust cargo linter fails #1202

christianlask opened this issue Dec 7, 2017 · 3 comments
Labels

Comments

@christianlask
Copy link

Information

NVIM v0.2.1
Debian 9.1 (Linux daike 4.13.0-0.bpo.1-amd64 #1 SMP Debian 4.13.13-1~bpo9+1 (2017-11-22) x86_64 GNU/Linux)

:ALEInfo

 Current Filetype: rust
Available Linters: ['cargo', 'rls', 'rustc']
  Enabled Linters: ['cargo']
 Linter Variables:
let g:ale_rust_cargo_check_all_targets = 1
let g:ale_rust_cargo_use_check = 1
 Global Variables:
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'always'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let g:ale_open_list = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_offset = 1000000
let g:ale_sign_warning = '--'
let g:ale_statusline_format = ['%d error(s)', '%d warning(s)', 'OK']
let g:ale_warn_about_trailing_whitespace = 1
  Command History:
(executable check - success) cargo
(started) ['/bin/zsh', '-c', 'cargo --version']
(finished - exit code 0) ['/bin/zsh', '-c', 'cargo --version']
(finished - exit code 0) ['/bin/zsh', '-c', 'cargo check --all-targets --frozen --message-format=json -q']
<<<OUTPUT STARTS>>>
{"features":[],"filenames":["/home/hiberno/work/projects/tid_test/target/debug/libtid_test.rmeta"],"fresh":true,"package_id":"tid_test 0.1.0 (path+file:///home/hiberno/
work/projects/tid_test)","profile":{"debug_assertions":true,"debuginfo":2,"opt_level":"0","overflow_checks":true,"test":false},"reason":"compiler-artifact","target":{"c
rate_types":["lib"],"kind":["lib"],"name":"tid_test","src_path":"/home/hiberno/work/projects/tid_test/src/lib.rs"}}
<<<OUTPUT ENDS>>>

What went wrong

ALE should lint Rust code. It doesn't.

Reproducing the bug

I created a new project running cargo new --bin tid_test and modified it such that ALE should show me an error. After saving the file I expected ALE to show me the error I produced, it didn't.

I wonder if it has something to do with this:

$ cargo check --all-targets
error: no library targets found

Here's the cargo-related bug report: rust-lang/cargo#4685 The cargo version I am using is

$ cargo --version
cargo 0.23.0 (61fa02415 2017-11-22)

It does not work at all when creating a new project running cargo new --bin and works only after opening the file when creating a new project like this: cargo new.

Note, this might be very related to #1045.

@crisidev
Copy link

crisidev commented Dec 7, 2017

I can reproduce it as well.

@w0rp
Copy link
Member

w0rp commented Dec 7, 2017

It looks like --all-targets doesn't work properly in cargo for who knows what reason. I'll turn it off by default.

@w0rp w0rp added the bug label Dec 7, 2017
@w0rp w0rp closed this as completed in 63ecc83 Dec 7, 2017
@christianlask
Copy link
Author

Thanks, that was quick and it works for me now!

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

No branches or pull requests

3 participants