diff options
| author | bors <bors@rust-lang.org> | 2014-10-07 06:17:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-07 06:17:11 +0000 |
| commit | e62ef37cfae680e60584731635a89e955121a5bb (patch) | |
| tree | 768fd0552e75e5380b1122ac56448f0465df8fb3 /src/libsyntax | |
| parent | 8d702167ba6af50c64683685bae4956cb094a23a (diff) | |
| parent | eb2fdc8b065218476744ed428097c859616c62f0 (diff) | |
| download | rust-e62ef37cfae680e60584731635a89e955121a5bb.tar.gz rust-e62ef37cfae680e60584731635a89e955121a5bb.zip | |
auto merge of #17807 : nick29581/rust/slice6, r=aturon
r? @aturon
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 | ||||
| -rw-r--r-- | src/libsyntax/test.rs | 2 |
5 files changed, 11 insertions, 4 deletions
diff --git a/src/libsyntax/ast_map/mod.rs b/src/libsyntax/ast_map/mod.rs index a5458461a8b..257bfc632d8 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.slice_to(parts.len() - 1), + in_which: parts[..parts.len() - 1], idx: 0, } } diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index f33c768d647..6d063aef5a9 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.slice(0u, MAX_LINES); + display_lines = display_lines[0u..MAX_LINES]; elided = true; } // Print the offending lines diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 5d4a9025827..c3c36d04442 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -70,6 +70,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[ ("tuple_indexing", Active), ("associated_types", Active), ("visible_private_types", Active), + ("slicing_syntax", Active), ("if_let", Active), @@ -350,6 +351,11 @@ 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 a4271544146..64dedd45923 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -23,7 +23,8 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://doc.rust-lang.org/master/")] -#![feature(macro_rules, globs, default_type_params, phase)] +#![allow(unknown_features)] +#![feature(macro_rules, globs, default_type_params, phase, slicing_syntax)] #![feature(quote, struct_variant, unsafe_destructor, import_shadowing)] #![allow(deprecated)] diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs index d2c0ebd4393..3f5b524a9b5 100644 --- a/src/libsyntax/test.rs +++ b/src/libsyntax/test.rs @@ -414,7 +414,7 @@ fn mk_test_module(cx: &mut TestCtxt) -> (P<ast::Item>, Option<ast::ViewItem>) { let mainfn = (quote_item!(&mut cx.ext_cx, pub fn main() { #![main] - use std::slice::Slice; + use std::slice::AsSlice; test::test_main_static(::std::os::args().as_slice(), TESTS); } )).unwrap(); |
