diff options
| author | bors <bors@rust-lang.org> | 2014-10-02 23:42:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-02 23:42:31 +0000 |
| commit | d0af3feebb57bc58c52de69ab51f92dc7082500b (patch) | |
| tree | d39de6be5866c0f0f37f9f3219b8217c873d8b52 /src/libsyntax | |
| parent | b2d4eb186e99b66051be9089f836c66a558dd995 (diff) | |
| parent | d2ea0315e09cbd495a67c9e3d5053b57e2b5a8b7 (diff) | |
| download | rust-d0af3feebb57bc58c52de69ab51f92dc7082500b.tar.gz rust-d0af3feebb57bc58c52de69ab51f92dc7082500b.zip | |
auto merge of #17715 : aturon/rust/revert-slice-ops-libs, r=alexcrichton
This PR reverts https://github.com/rust-lang/rust/pull/17620, which caused a significant regression for slices. As discussed with @alexcrichton, all of the public-facing changes of the earlier PR need to be rolled back, and it's not clear that we should move the libraries over to this new notation yet anyway (especially given its feature-gated status). Closes #17710
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_map/mod.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/diagnostic.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 3 |
4 files changed, 3 insertions, 10 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index 257bfc632d8..a5458461a8b 100644 --- a/src/libsyntax/ast_map/mod.rs +++ b/src/libsyntax/ast_map/mod.rs @@ -496,7 +496,7 @@ impl<'ast> Map<'ast> { NodesMatchingSuffix { map: self, item_name: parts.last().unwrap(), - in_which: parts[..parts.len() - 1], + in_which: parts.slice_to(parts.len() - 1), idx: 0, } } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 6d063aef5a9..f33c768d647 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -414,7 +414,7 @@ fn highlight_lines(err: &mut EmitterWriter, let mut elided = false; let mut display_lines = lines.lines.as_slice(); if display_lines.len() > MAX_LINES { - display_lines = display_lines[0u..MAX_LINES]; + display_lines = display_lines.slice(0u, MAX_LINES); elided = true; } // Print the offending lines diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 38de2a9c284..ca6d488772c 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -70,7 +70,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("tuple_indexing", Active), ("associated_types", Active), ("visible_private_types", Active), - ("slicing_syntax", Active), ("if_let", Active), @@ -363,11 +362,6 @@ impl<'a, 'v> Visitor<'v> for Context<'a> { self.gate_feature("if_let", e.span, "`if let` syntax is experimental"); } - ast::ExprSlice(..) => { - self.gate_feature("slicing_syntax", - e.span, - "slicing syntax is experimental"); - } _ => {} } visit::walk_expr(self, e); diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 64dedd45923..a4271544146 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -23,8 +23,7 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/master/")] -#![allow(unknown_features)] -#![feature(macro_rules, globs, default_type_params, phase, slicing_syntax)] +#![feature(macro_rules, globs, default_type_params, phase)] #![feature(quote, struct_variant, unsafe_destructor, import_shadowing)] #![allow(deprecated)] |
