Skip to content

impl Trait for (use<Self>) {} unexpected token, cfgd out #20

@matthiaskrgr

Description

@matthiaskrgr

The following code

//@ check-pass

#![cfg(false)]

trait Foo {}
impl Foo for (use<Self>) {}

fn main(x: impl AsRef<str>) {
    let _: () = foo(Lt::<'static>::None);
}

Compiled successfully ( with --crate-type=lib --cap-lints=warn ):


However rasur was found to have errors (-e 2015):

error: found `use` but expected type
 --> ./2025_12_29__22_59_36/52989afeed5c5d1e752743e9c7a1231e5c7c9f28.rs:6:15
  |
6 | impl Foo for (use<Self>) {}
  |               ^^^ unexpected token

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-highTechnical complexity: HighK-bugKind: BugP-highPriority: HighS-in-progressStatus: In progress

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions