Skip to content

Rollup of 8 pull requests #57607

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

Merged
merged 35 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f9f71cc
Fix poor worst case performance of set intersection (and union, somew…
ssomers Dec 21, 2018
ccba43d
Merge remote-tracking branch 'upstream/master'
ssomers Jan 9, 2019
60d1db6
Clean up and fix a bug in query plumbing
Zoxc Jan 9, 2019
8823bf0
Fix poor worst case performance of is_disjoint
ssomers Jan 9, 2019
565c39d
provide suggestion for invalid boolean cast
euclio Jan 9, 2019
cef2e2f
Merge remote-tracking branch 'upstream/master'
ssomers Jan 10, 2019
5c67ba6
Continue parser after trailing type argument attribute
estebank Jan 12, 2019
fc4b541
Continue parsing after lifetime in incorrect location
estebank Jan 12, 2019
d8610b3
Continue evaluating after parsing incorrect binary literal
estebank Jan 12, 2019
5d2f31c
Continue evaluating after missing `for` in `impl Trait for Foo`
estebank Jan 12, 2019
57f17e9
Continue evaluating after type argument in where clause
estebank Jan 12, 2019
65a8d7b
fix tests
estebank Jan 12, 2019
8bede50
Continue evaluating after incorrect float literal
estebank Jan 12, 2019
975f8b5
fix test
estebank Jan 12, 2019
8119017
Continue evaluating after finding incorrect .. in pattern
estebank Jan 12, 2019
de3c4be
Tweak type argument after assoc type error
estebank Jan 12, 2019
7feb802
Small tweaks to parser errors
estebank Jan 12, 2019
3ead6de
Tweak incorrect discriminator value variant error
estebank Jan 12, 2019
1550787
Add label for invalid literal suffix
estebank Jan 12, 2019
db74031
Remove unrelated errors from parse stderr tests
estebank Jan 13, 2019
28ea03e
Suggest correct location for lifetime parameters in use
estebank Jan 13, 2019
c4f6ef2
remove extern_in_paths.
Centril Jan 13, 2019
fb60400
Querify local proc_macro_decls_static
Xanewok Jan 12, 2019
59d7d7d
Querify local plugin_registrar_fn
Xanewok Jan 13, 2019
707a9a0
Retain original pass order
Xanewok Jan 13, 2019
3874c77
Recover from item trailing semicolon
estebank Jan 14, 2019
1fd971c
Add a debug_assert to Vec::set_len
scottmcm Dec 15, 2018
5bc95de
Rollup merge of #57043 - ssomers:master, r=alexcrichton
Centril Jan 14, 2019
8c001b1
Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoerister
Centril Jan 14, 2019
816e31b
Rollup merge of #57481 - euclio:bool-cast-suggestion, r=estebank
Centril Jan 14, 2019
2f7a226
Rollup merge of #57540 - estebank:eval-more, r=petrochenkov
Centril Jan 14, 2019
2e10944
Rollup merge of #57570 - Xanewok:querify-some, r=Zoxc
Centril Jan 14, 2019
feb48f3
Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkov
Centril Jan 14, 2019
b03d414
Rollup merge of #57585 - estebank:trailing-semicolon, r=petrochenkov
Centril Jan 14, 2019
8a62e39
Rollup merge of #57589 - scottmcm:vec-set_len-debug_assert, r=alexcri…
Centril Jan 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove extern_in_paths.
  • Loading branch information
Centril committed Jan 13, 2019
commit c4f6ef25d207ad0cff8d1e5282fedbe1e3ac743c
40 changes: 0 additions & 40 deletions src/doc/unstable-book/src/language-features/extern-in-paths.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/librustc/middle/cstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub enum ExternCrateSource {
),
// Crate is loaded by `use`.
Use,
/// Crate is implicitly loaded by an absolute or an `extern::` path.
/// Crate is implicitly loaded by an absolute path.
Path,
}

Expand Down
9 changes: 4 additions & 5 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ enum ModuleOrUniformRoot<'a> {
CrateRootAndExternPrelude,

/// Virtual module that denotes resolution in extern prelude.
/// Used for paths starting with `::` on 2018 edition or `extern::`.
/// Used for paths starting with `::` on 2018 edition.
ExternPrelude,

/// Virtual module that denotes resolution in current scope.
Expand Down Expand Up @@ -3817,8 +3817,7 @@ impl<'a> Resolver<'a> {
self.resolve_self(&mut ctxt, self.current_module)));
continue;
}
if name == keywords::Extern.name() ||
name == keywords::PathRoot.name() && ident.span.rust_2018() {
if name == keywords::PathRoot.name() && ident.span.rust_2018() {
module = Some(ModuleOrUniformRoot::ExternPrelude);
continue;
}
Expand Down Expand Up @@ -3985,8 +3984,8 @@ impl<'a> Resolver<'a> {
};

// We're only interested in `use` paths which should start with
// `{{root}}` or `extern` currently.
if first_name != keywords::Extern.name() && first_name != keywords::PathRoot.name() {
// `{{root}}` currently.
if first_name != keywords::PathRoot.name() {
return
}

Expand Down
29 changes: 5 additions & 24 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ use syntax_pos::{Span, DUMMY_SP};
use errors::{DiagnosticBuilder, Handler};
use visit::{self, FnKind, Visitor};
use parse::ParseSess;
use symbol::{keywords, Symbol};
use symbol::Symbol;

use std::{env};
use std::env;

macro_rules! set {
($field: ident) => {{
Expand Down Expand Up @@ -375,9 +375,6 @@ declare_features! (
// Generic associated types (RFC 1598)
(active, generic_associated_types, "1.23.0", Some(44265), None),

// `extern` in paths
(active, extern_in_paths, "1.23.0", Some(55600), None),

// Infer static outlives requirements (RFC 2093).
(active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),

Expand Down Expand Up @@ -506,6 +503,9 @@ declare_features! (
// Allows the use of `#[derive(Anything)]` as sugar for `#[derive_Anything]`.
(removed, custom_derive, "1.0.0", Some(29644), None,
Some("subsumed by `#[proc_macro_derive]`")),
// Paths of the form: `extern::foo::bar`
(removed, extern_in_paths, "1.33.0", Some(55600), None,
Some("subsumed by `::foo::bar` paths")),
);

declare_features! (
Expand Down Expand Up @@ -1829,25 +1829,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
visit::walk_impl_item(self, ii);
}

fn visit_path(&mut self, path: &'a ast::Path, _id: NodeId) {
for segment in &path.segments {
// Identifiers we are going to check could come from a legacy macro (e.g., `#[test]`).
// For such macros identifiers must have empty context, because this context is
// used during name resolution and produced names must be unhygienic for compatibility.
// On the other hand, we need the actual non-empty context for feature gate checking
// because it's hygienic even for legacy macros. As previously stated, such context
// cannot be kept in identifiers, so it's kept in paths instead and we take it from
// there while keeping location info from the ident span.
let span = segment.ident.span.with_ctxt(path.span.ctxt());
if segment.ident.name == keywords::Extern.name() {
gate_feature_post!(&self, extern_in_paths, span,
"`extern` in paths is experimental");
}
}

visit::walk_path(self, path);
}

fn visit_vis(&mut self, vis: &'a ast::Visibility) {
if let ast::VisibilityKind::Crate(ast::CrateSugar::JustCrate) = vis.node {
gate_feature_post!(&self, crate_visibility_modifier, vis.span,
Expand Down
13 changes: 3 additions & 10 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ impl<'a> Parser<'a> {
fn token_is_bare_fn_keyword(&mut self) -> bool {
self.check_keyword(keywords::Fn) ||
self.check_keyword(keywords::Unsafe) ||
self.check_keyword(keywords::Extern) && self.is_extern_non_path()
self.check_keyword(keywords::Extern)
}

/// parse a `TyKind::BareFn` type:
Expand Down Expand Up @@ -4605,10 +4605,6 @@ impl<'a> Parser<'a> {
self.token.is_keyword(keywords::Crate) && self.look_ahead(1, |t| t != &token::ModSep)
}

fn is_extern_non_path(&self) -> bool {
self.token.is_keyword(keywords::Extern) && self.look_ahead(1, |t| t != &token::ModSep)
}

fn is_existential_type_decl(&self) -> bool {
self.token.is_keyword(keywords::Existential) &&
self.look_ahead(1, |t| t.is_keyword(keywords::Type))
Expand Down Expand Up @@ -4712,12 +4708,10 @@ impl<'a> Parser<'a> {
// like a path (1 token), but it fact not a path.
// `union::b::c` - path, `union U { ... }` - not a path.
// `crate::b::c` - path, `crate struct S;` - not a path.
// `extern::b::c` - path, `extern crate c;` - not a path.
} else if self.token.is_path_start() &&
!self.token.is_qpath_start() &&
!self.is_union_item() &&
!self.is_crate_vis() &&
!self.is_extern_non_path() &&
!self.is_existential_type_decl() &&
!self.is_auto_trait_item() {
let pth = self.parse_path(PathStyle::Expr)?;
Expand Down Expand Up @@ -7113,8 +7107,7 @@ impl<'a> Parser<'a> {
return Ok(Some(item));
}

if self.check_keyword(keywords::Extern) && self.is_extern_non_path() {
self.bump(); // `extern`
if self.eat_keyword(keywords::Extern) {
if self.eat_keyword(keywords::Crate) {
return Ok(Some(self.parse_item_extern_crate(lo, visibility, attrs)?));
}
Expand Down Expand Up @@ -7623,7 +7616,7 @@ impl<'a> Parser<'a> {
fn parse_assoc_macro_invoc(&mut self, item_kind: &str, vis: Option<&Visibility>,
at_end: &mut bool) -> PResult<'a, Option<Mac>>
{
if self.token.is_path_start() && !self.is_extern_non_path() {
if self.token.is_path_start() {
let prev_span = self.prev_span;
let lo = self.span;
let pth = self.parse_path(PathStyle::Mod)?;
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax_pos/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ impl Ident {
self.name == keywords::Super.name() ||
self.name == keywords::SelfLower.name() ||
self.name == keywords::SelfUpper.name() ||
self.name == keywords::Extern.name() ||
self.name == keywords::Crate.name() ||
self.name == keywords::PathRoot.name() ||
self.name == keywords::DollarCrate.name()
Expand Down
5 changes: 1 addition & 4 deletions src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
-include ../tools.mk

all: extern_absolute_paths.rs extern_in_paths.rs krate2
all: extern_absolute_paths.rs krate2
$(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 \
-Z unstable-options --extern krate2
cat $(TMPDIR)/save-analysis/extern_absolute_paths.json | "$(PYTHON)" validate_json.py
$(RUSTC) extern_in_paths.rs -Zsave-analysis --edition=2018 \
-Z unstable-options --extern krate2
cat $(TMPDIR)/save-analysis/extern_in_paths.json | "$(PYTHON)" validate_json.py

krate2: krate2.rs
$(RUSTC) $<

This file was deleted.

28 changes: 0 additions & 28 deletions src/test/run-pass/rfcs/rfc-2126-extern-absolute-paths/extern.rs

This file was deleted.

5 changes: 0 additions & 5 deletions src/test/ui/feature-gates/feature-gate-extern_in_paths.rs

This file was deleted.

11 changes: 0 additions & 11 deletions src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
let s = extern::foo::Bar; //~ ERROR expected expression, found keyword `extern`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: expected expression, found keyword `extern`
--> $DIR/keyword-extern-as-identifier-expr.rs:2:13
|
LL | let s = extern::foo::Bar; //~ ERROR expected expression, found keyword `extern`
| ^^^^^^ expected expression

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
let extern = 0; //~ ERROR expected pattern, found keyword `extern`
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: expected pattern, found keyword `extern`
--> $DIR/keyword-extern-as-identifier-pat.rs:2:9
|
LL | let extern = 0; //~ ERROR expected pattern, found keyword `extern`
| ^^^^^^ expected pattern

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type A = extern::foo::bar; //~ ERROR expected `fn`, found `::`

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: expected `fn`, found `::`
--> $DIR/keyword-extern-as-identifier-type.rs:1:16
|
LL | type A = extern::foo::bar; //~ ERROR expected `fn`, found `::`
| ^^ expected `fn` here

error: aborting due to previous error

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use extern::foo; //~ ERROR expected identifier, found keyword `extern`

fn main() {}
12 changes: 12 additions & 0 deletions src/test/ui/keyword/extern/keyword-extern-as-identifier-use.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error: expected identifier, found keyword `extern`
--> $DIR/keyword-extern-as-identifier-use.rs:1:5
|
LL | use extern::foo; //~ ERROR expected identifier, found keyword `extern`
| ^^^^^^ expected identifier, found keyword
help: you can escape reserved keywords to use them as identifiers
|
LL | use r#extern::foo; //~ ERROR expected identifier, found keyword `extern`
| ^^^^^^^^

error: aborting due to previous error

5 changes: 0 additions & 5 deletions src/test/ui/keyword/keyword-extern-as-identifier.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/ui/keyword/keyword-extern-as-identifier.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions src/test/ui/rfc-2126-extern-in-paths/auxiliary/xcrate.rs

This file was deleted.

5 changes: 0 additions & 5 deletions src/test/ui/rfc-2126-extern-in-paths/non-existent-1.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr

This file was deleted.

6 changes: 0 additions & 6 deletions src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr

This file was deleted.

5 changes: 0 additions & 5 deletions src/test/ui/rfc-2126-extern-in-paths/non-existent-3.rs

This file was deleted.

9 changes: 0 additions & 9 deletions src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr

This file was deleted.

Loading