Skip to content

Keyword in lifetime name is falsely allowed #6927

@DomWilliams0

Description

@DomWilliams0

Environment

  • IntelliJ Rust plugin version: 0.3.142.3705-203
  • Rust toolchain version: rustc 1.52.0-nightly (3f5aee2d5 2021-02-12)
  • IDE name and version: CLion 2020.3.2
  • Operating system: Linux

Problem description

The plugin shows no errors or warnings when using a keyword as a lifetime name, but the code doesn't compile.

Steps to reproduce

Code:

pub struct AddressSpaceRef<'p: 'ref, 'ref>(AddressSpace<'p>, PhantomData<&'ref ()>);

Compiler error:

error: lifetimes cannot use keyword names --> kernel/src/memory/address_space.rs:18:32 | 18 | pub struct AddressSpaceRef<'p: 'ref, 'ref>(AddressSpace<'p>, PhantomData<&'ref ()>); | ^^^^ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurehelp wantedsubsystem::code insightGeneral label for issues related to code understanding: highlighting, completion, annotation, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions