Skip to content

Unfortunate error when typoing : for :: #47666

Closed
@jorendorff

Description

@jorendorff
fn main() {
    let _ = Option:Some(vec![0, 1]);
}

The compiler output for this is:

   Compiling playground v0.0.1 (file:///playground)
error: expected type, found keyword `box`
 --> src/main.rs:2:25
  |
2 |     let _ = Option:Some(vec![0, 1]);
  |                         ^^^^^^^^^^
  |
  = note: this error originates in a macro outside of the current crate

Of course this is just me being dumb :) but by the time I noticed that, I had already tried rustup update nightly and tried the stable version and tried -Z external-macro-backtrace and scratched my head a bit and figured it had to be a compiler bug and minimized a test case. So I might as well file it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions