Skip to content

Commit 231eeaa

Browse files
committed
rollup merge of #22502: nikomatsakis/deprecate-bracket-bracket
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2 parents 2cdbd28 + 9ea84ae commit 231eeaa

File tree

146 files changed

+895
-882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+895
-882
lines changed

src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
689689
.unwrap()
690690
.to_string();
691691

692-
script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[])[]);
692+
script_str.push_str(&format!("command script import {}\n", &rust_pp_module_abs_path[..])[]);
693693
script_str.push_str("type summary add --no-value ");
694694
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
695695
script_str.push_str("-x \".*\" --category Rust\n");

src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3583,7 +3583,7 @@ An example of each kind:
35833583
```{rust}
35843584
let vec: Vec<i32> = vec![1, 2, 3];
35853585
let arr: [i32; 3] = [1, 2, 3];
3586-
let s: &[i32] = &vec[];
3586+
let s: &[i32] = &vec[..];
35873587
```
35883588

35893589
As you can see, the `vec!` macro allows you to create a `Vec<T>` easily. The

src/doc/trpl/patterns.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ If you want to match against a slice or array, you can use `&`:
180180
fn main() {
181181
let v = vec!["match_this", "1"];
182182
183-
match &v[] {
183+
match &v[..] {
184184
["match_this", second] => println!("The second element is {}", second),
185185
_ => {},
186186
}

src/libcollections/slice.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,12 +1177,12 @@ impl ElementSwaps {
11771177

11781178
#[stable(feature = "rust1", since = "1.0.0")]
11791179
impl<T> Borrow<[T]> for Vec<T> {
1180-
fn borrow(&self) -> &[T] { &self[] }
1180+
fn borrow(&self) -> &[T] { &self[..] }
11811181
}
11821182

11831183
#[stable(feature = "rust1", since = "1.0.0")]
11841184
impl<T> BorrowMut<[T]> for Vec<T> {
1185-
fn borrow_mut(&mut self) -> &mut [T] { &mut self[] }
1185+
fn borrow_mut(&mut self) -> &mut [T] { &mut self[..] }
11861186
}
11871187

11881188
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1744,7 +1744,7 @@ mod tests {
17441744
#[test]
17451745
fn test_slice_from() {
17461746
let vec: &[_] = &[1, 2, 3, 4];
1747-
assert_eq!(&vec[], vec);
1747+
assert_eq!(&vec[..], vec);
17481748
let b: &[_] = &[3, 4];
17491749
assert_eq!(&vec[2..], b);
17501750
let b: &[_] = &[];
@@ -1997,9 +1997,9 @@ mod tests {
19971997

19981998
#[test]
19991999
fn test_lexicographic_permutations_empty_and_short() {
2000-
let empty : &mut[i32] = &mut[];
2000+
let empty : &mut[i32] = &mut[..];
20012001
assert!(empty.next_permutation() == false);
2002-
let b: &mut[i32] = &mut[];
2002+
let b: &mut[i32] = &mut[..];
20032003
assert!(empty == b);
20042004
assert!(empty.prev_permutation() == false);
20052005
assert!(empty == b);
@@ -2265,15 +2265,15 @@ mod tests {
22652265
#[test]
22662266
fn test_total_ord() {
22672267
let c = &[1, 2, 3];
2268-
[1, 2, 3, 4][].cmp(c) == Greater;
2268+
[1, 2, 3, 4][..].cmp(c) == Greater;
22692269
let c = &[1, 2, 3, 4];
2270-
[1, 2, 3][].cmp(c) == Less;
2270+
[1, 2, 3][..].cmp(c) == Less;
22712271
let c = &[1, 2, 3, 6];
2272-
[1, 2, 3, 4][].cmp(c) == Equal;
2272+
[1, 2, 3, 4][..].cmp(c) == Equal;
22732273
let c = &[1, 2, 3, 4, 5, 6];
2274-
[1, 2, 3, 4, 5, 5, 5, 5][].cmp(c) == Less;
2274+
[1, 2, 3, 4, 5, 5, 5, 5][..].cmp(c) == Less;
22752275
let c = &[1, 2, 3, 4];
2276-
[2, 2][].cmp(c) == Greater;
2276+
[2, 2][..].cmp(c) == Greater;
22772277
}
22782278

22792279
#[test]

0 commit comments

Comments
 (0)