Closed
Description
Steps to reproduce
Create a new bin crate, and replace src/main.rs
with the following code.
src/main.rs
fn main() {
let _ = vec![vec![1, 2, 3]]
.iter()
.flat_map(|x| x.iter().flat_map(|x| Some(x)))
.max()
.unwrap();
}
When edition = "2021"
, nothing is wrong.
When edition = "2018"
, rust-analyzer
points out that there is an error on the fifth line (.max()
): [rust-analyzer mismatched-arg-count] [E] expected 1 argument, found 0
.
Hovering on the max
shows core::cmp::Ord
, not std::iter::Iterator
.
In both case, cargo check
shows no errors or warnings.
Probably there is an issue in resolving traits in prelude.
Version info
rustup show
active toolchain
----------------
stable-x86_64-apple-darwin (default)
rustc 1.56.0 (09c42c458 2021-10-18)
:CocInfo
## versions
vim version: NVIM v0.6.0-dev+nightly-756-g8c74c895b
node version: v14.18.1
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /Users/username/.vim/dein/.cache/init.vim/.dein
term: tmux
platform: darwin