Skip to content

use suggestions corrupted w/ nearby code when inside items #43769

Closed
@durka

Description

@durka

This is... bizarre.

STR

fn main() {
    type Dict<K, V> = HashMap<K, V>;
}

Expected

help: possible candidates are found in other modules, you can import them into scope
  | use std::collections::HashMap;
  | use std::collections::hash_map::HashMap;

Actual

help: possible candidates are found in other modules, you can import them into scope
  | fn main() use std::collections::HashMap;
  | fn main() use std::collections::hash_map::HashMap;

The issue seems to arise from the erroneous code being inside another block. I originally encountered this with code generated by `lazy_static!`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions