rust-lang / rust.vim

Vim configuration for Rust.
Apache License 2.0
3.89k stars 295 forks source link

Reserved keywords in fn position aren't highlighted differently #406

Open guswynn opened 4 years ago

guswynn commented 4 years ago

image

This breaks rustfmt and rust-analyzer, but I don't get any feedback from either

Is it possible to make reserved words in this position be highlighted differently?

This might be because this is an unused but reserved-for-future-use keyword? https://doc.rust-lang.org/book/appendix-01-keywords.html#keywords-reserved-for-future-use

Env:

rust.vim Global Variables:
let g:ftplugin_rust_source_path = v:null let g:loaded_syntastic_rust_cargo_checker = v:null let g:loaded_syntastic_rust_filetype = v:null let g:loaded_syntastic_rust_rustc_checker = v:null let g:rust_bang_comment_leader = v:null let g:rust_cargo_avoid_whole_workspace = v:null let g:rust_clip_command = v:null let g:rust_conceal = v:null let g:rust_conceal_mod_path = v:null let g:rust_conceal_pub = v:null let g:rust_fold = v:null let g:rust_last_args = v:null let b:rust_last_args = [] let g:rust_last_rustc_args = v:null let b:rust_last_rustc_args = [] let g:rust_original_delimitMate_excluded_regions = v:null let g:rust_playpen_url = v:null let g:rust_prev_delimitMate_quotes = v:null let g:rust_recent_nearest_cargo_tol = v:null let g:rust_recent_root_cargo_toml = v:null let g:rust_recommended_style = v:null let g:rust_set_conceallevel = v:null let g:rust_set_conceallevel=1 = v:null let g:rust_set_foldmethod = v:null let g:rust_set_foldmethod=1 = v:null let g:rust_shortener_url = v:null let g:rustc_makeprg_no_percent = v:null let g:rustc_path = v:null let g:rustfmt_autosave = 1 let g:rustfmt_autosave_if_config_present = v:null let g:rustfmt_command = 'rustfmt' let g:rustfmt_emit_files = 1 let g:rustfmt_fail_silently = 0 let g:rustfmt_options = '' let g:syntastic_extra_filetypes = ['rust'] let g:syntastic_rust_cargo_fname = v:null rustfmt 1.4.12-stable (a828ffe 2020-03-11) rustc 1.43.1 (8d69840ab 2020-05-04) cargo 1.43.0 (2cbe9048e 2020-05-03)

NVIM v0.4.3 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -g record-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tab les -fstack-clash-protection -fcf-protection -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=1 -O2 -g -DMIN_LOG_LEVEL=3 -Og -g -Wall -Wextra -pedantic -Wno-unused -parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagn ostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/builddir/build/BUILD/neovim-0.4.3/bui ld/config -I/builddir/build/BUILD/neovim-0.4.3/src -I/usr/include -I/usr/include/lua-5.1 -I/builddir/build/BUILD/neovim-0.4.3/build/src/nvim/auto -I/builddir/ build/BUILD/neovim-0.4.3/build/include Compiled by mockbuild

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

?

ghost commented 3 years ago

I just ran into this implementing a procedural macro attribute. I had what seemed like a perfectly reasonable name, but it was, in fact, a reserved keyword. vim didn't tell me about this (... and the error message from the compiler also wasn't helpful, but that's a separate issue). Would you accept a PR for this?