Skip to content

TryFrom/TryInto are not resolved from the prelude in 2021 edition #13250

Closed
@Veetaha

Description

@Veetaha

Reproduction

  1. Run cargo new repro, assuming cargo sets edition = "2021" in Cargo.toml.
  2. Put this code into main.rs:
    fn main() {
        let _: bool = TryFrom::try_from(true).unwrap();
        let _: bool = true.try_into().unwrap();
    }
  3. Hover over TryFrom::try_from and try_into symbols and observe them as unresolved according to rust-analyzer: image

rust-analyzer version: rust-analyzer version: 0.3.1203-standalone
rustc version: rustc 1.63.0 (4b91a6ea7 2022-08-08)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions