Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax error: extern crate self as foo #1069

Closed
memoryruins opened this issue Mar 28, 2019 · 0 comments · Fixed by #1070
Closed

syntax error: extern crate self as foo #1069

memoryruins opened this issue Mar 28, 2019 · 0 comments · Fixed by #1070

Comments

@memoryruins
Copy link
Contributor

#![feature(extern_crate_self)] will be stable in rustc 1.34:

extern crate self as serde; // Adds local crate to extern prelude as `serde`

mod foo { ... }

// Anywhere in this crate
use serde::foo; // OK
::serde::foo; // OK

tracking issue: rust-lang/rust#56409
stabilization report: rust-lang/rust#57407 (comment)


current syntax error in rust-analyzer:

extern crate self as foo;
Syntax Error: expected identifier
SOURCE_FILE@[0; 25)
  EXTERN_CRATE_ITEM@[0; 25)
    EXTERN_KW@[0; 6)
    WHITESPACE@[6; 7)
    CRATE_KW@[7; 12)
    WHITESPACE@[12; 13)
    err: `expected identifier`
    ERROR@[13; 17)
      SELF_KW@[13; 17)
    WHITESPACE@[17; 18)
    ALIAS@[18; 24)
      AS_KW@[18; 20)
      WHITESPACE@[20; 21)
      NAME@[21; 24)
        IDENT@[21; 24) "foo"
    SEMI@[24; 25)

bors bot added a commit that referenced this issue Mar 28, 2019
1070: Support extern_crate_self r=matklad a=memoryruins

closes #1069

Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
@bors bors bot closed this as completed in #1070 Mar 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant