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

Rollup of 11 pull requests #25275

Closed
wants to merge 32 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a4c1337
link to .editorconfig for Rust files
derhuerst Apr 29, 2015
6f3641d
distinction between official and community plugins
derhuerst Apr 29, 2015
7ec8172
Update old uses of ~ in comments and debugging statements
carols10cents May 2, 2015
232b202
Update debuginfo metadata to use Box instead of ~
carols10cents May 2, 2015
d366774
Update tests to not use old ~ syntax
carols10cents May 2, 2015
55e7f9b
Changing Vec to Box<[T]>
carols10cents May 5, 2015
77acf7b
Use the lowercase version of the box syntax
carols10cents May 5, 2015
abc0017
Remove an obsolete example in a comment
carols10cents May 5, 2015
4d1e48e
Typo in ownership.md
tincann May 7, 2015
ae1b2f4
Another typo
tincann May 7, 2015
7a91fe8
Fixed a typo. Removed an extra s
sindreij May 9, 2015
1e9ce0d
std: Add example for HashMap::entry()
May 9, 2015
7a2ac0c
Added start of last text block
sindreij May 9, 2015
f8888af
Add omitted word to mutability docs.
dpetersen May 10, 2015
ae1b64f
Fix typo in Match document.
dpetersen May 10, 2015
2cc4d82
Fix small typos in documentation
fhinkel May 10, 2015
8ad1c90
Removed the backticks on slices
sindreij May 10, 2015
dcdc50d
doc: unwrap is discouraged, so use Some
tshepang May 10, 2015
a168dba
Add #[inline] to AsRef<str>::as_ref for String and str.
koute May 10, 2015
5613502
Add long diagnostic for E0067
caipre May 10, 2015
ffc0d04
Add long diagnostic for E0131, E0132
caipre May 10, 2015
ffea71c
Rollup merge of #24948 - derhuerst:patch-1, r=steveklabnik
steveklabnik May 10, 2015
becee02
Rollup merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnik
steveklabnik May 10, 2015
1a9e19f
Rollup merge of #25158 - koute:master, r=alexcrichton
steveklabnik May 10, 2015
49a2cc7
Rollup merge of #25188 - tincann:patch-1, r=steveklabnik
steveklabnik May 10, 2015
e1e28fa
Rollup merge of #25239 - sindreij:patch-1, r=alexcrichton
steveklabnik May 10, 2015
e97a21c
Rollup merge of #25240 - bluss:doc-hashmap-entry, r=steveklabnik
steveklabnik May 10, 2015
74d8020
Rollup merge of #25241 - sindreij:patch-2, r=steveklabnik
steveklabnik May 10, 2015
39a25cf
Rollup merge of #25255 - caipre:diagnostic-messages, r=alexcrichton
steveklabnik May 10, 2015
77beefd
Rollup merge of #25257 - dpetersen:mutability-docfix, r=steveklabnik
steveklabnik May 10, 2015
2802c3c
Rollup merge of #25263 - fhinkel:master, r=steveklabnik
steveklabnik May 10, 2015
253612d
Rollup merge of #25271 - tshepang:doc-deunwrap, r=steveklabnik
steveklabnik May 10, 2015
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
4 changes: 2 additions & 2 deletions src/doc/trpl/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ variety of numbers, we need to give Rust a hint as to the exact type of number
we want. Hence, `let guess: u32`. The colon (`:`) after `guess` tells Rust
we’re going to annotate its type. `u32` is an unsigned, thirty-two bit
integer. Rust has [a number of built-in number types][number], but we’ve
chosen `u32`. It’s a good default choice for a small positive numer.
chosen `u32`. It’s a good default choice for a small positive number.

[parse]: ../std/primitive.str.html#method.parse
[number]: primitive-types.html#numeric-types
Expand Down Expand Up @@ -922,7 +922,7 @@ failure. Each contains more information: the successful parsed integer, or an
error type. In this case, we `match` on `Ok(num)`, which sets the inner value
of the `Ok` to the name `num`, and then we just return it on the right-hand
side. In the `Err` case, we don’t care what kind of error it is, so we just
use `_` intead of a name. This ignores the error, and `continue` causes us
use `_` instead of a name. This ignores the error, and `continue` causes us
to go to the next iteration of the `loop`.

Now we should be good! Let’s try:
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/match.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ side of a `let` binding or directly where an expression is used:
```rust
let x = 5;

let numer = match x {
let number = match x {
1 => "one",
2 => "two",
3 => "three",
Expand Down
4 changes: 2 additions & 2 deletions src/doc/trpl/mutability.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ When we call `clone()`, the `Arc<T>` needs to update the reference count. Yet
we’ve not used any `mut`s here, `x` is an immutable binding, and we didn’t take
`&mut 5` or anything. So what gives?

To this, we have to go back to the core of Rust’s guiding philosophy, memory
safety, and the mechanism by which Rust guarantees it, the
To understand this, we have to go back to the core of Rust’s guiding
philosophy, memory safety, and the mechanism by which Rust guarantees it, the
[ownership][ownership] system, and more specifically, [borrowing][borrowing]:

> You may have one or the other of these two kinds of borrows, but not both at
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/ownership.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn foo(v: Vec<i32>) -> Vec<i32> {
}
```

This would get very tedius. It gets worse the more things we want to take ownership of:
This would get very tedious. It gets worse the more things we want to take ownership of:

```rust
fn foo(v1: Vec<i32>, v2: Vec<i32>) -> (Vec<i32>, Vec<i32>, i32) {
Expand Down
2 changes: 1 addition & 1 deletion src/doc/trpl/primitive-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Slices have type `&[T]`. We’ll talk about that `T` when we cover

[generics]: generics.html

You can find more documentation for `slices`s [in the standard library
You can find more documentation for slices [in the standard library
documentation][slice].

[slice]: ../std/primitive.slice.html
Expand Down
1 change: 1 addition & 0 deletions src/doc/trpl/references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ println!("{}", y);

We get this error:

```text
error: `x` does not live long enough
y = &x;
^
Expand Down
8 changes: 7 additions & 1 deletion src/etc/CONFIGS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Configs

Here are some links to repos with configs which ease the use of rust:
These are some links to repos with configs which ease the use of rust.

## Officially Maintained Configs

* [rust.vim](https://github.com/rust-lang/rust.vim)
* [emacs rust-mode](https://github.com/rust-lang/rust-mode)
* [gedit-config](https://github.com/rust-lang/gedit-config)
* [kate-config](https://github.com/rust-lang/kate-config)
* [nano-config](https://github.com/rust-lang/nano-config)
* [zsh-config](https://github.com/rust-lang/zsh-config)

## Community-maintained Configs

* [.editorconfig](https://gist.github.com/derhuerst/c9d1b9309e308d9851fa) ([what is this?](http://editorconfig.org/))
1 change: 1 addition & 0 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,7 @@ impl<T: fmt::Display + ?Sized> ToString for T {

#[stable(feature = "rust1", since = "1.0.0")]
impl AsRef<str> for String {
#[inline]
fn as_ref(&self) -> &str {
self
}
Expand Down
1 change: 1 addition & 0 deletions src/libcore/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ impl<T> AsMut<[T]> for [T] {

#[stable(feature = "rust1", since = "1.0.0")]
impl AsRef<str> for str {
#[inline]
fn as_ref(&self) -> &str {
self
}
Expand Down
84 changes: 42 additions & 42 deletions src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert_eq!(a.iter().last().unwrap(), &5);
/// assert_eq!(a.iter().last(), Some(&5));
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -155,7 +155,7 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.nth(2).unwrap(), &3);
/// assert_eq!(it.nth(2), Some(&3));
/// assert_eq!(it.nth(2), None);
/// ```
#[inline]
Expand All @@ -178,8 +178,8 @@ pub trait Iterator {
/// let a = [0];
/// let b = [1];
/// let mut it = a.iter().chain(b.iter());
/// assert_eq!(it.next().unwrap(), &0);
/// assert_eq!(it.next().unwrap(), &1);
/// assert_eq!(it.next(), Some(&0));
/// assert_eq!(it.next(), Some(&1));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -201,7 +201,7 @@ pub trait Iterator {
/// let a = [0];
/// let b = [1];
/// let mut it = a.iter().zip(b.iter());
/// assert_eq!(it.next().unwrap(), (&0, &1));
/// assert_eq!(it.next(), Some((&0, &1)));
/// assert!(it.next().is_none());
/// ```
///
Expand Down Expand Up @@ -234,8 +234,8 @@ pub trait Iterator {
/// ```
/// let a = [1, 2];
/// let mut it = a.iter().map(|&x| 2 * x);
/// assert_eq!(it.next().unwrap(), 2);
/// assert_eq!(it.next().unwrap(), 4);
/// assert_eq!(it.next(), Some(2));
/// assert_eq!(it.next(), Some(4));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -255,7 +255,7 @@ pub trait Iterator {
/// ```
/// let a = [1, 2];
/// let mut it = a.iter().filter(|&x| *x > 1);
/// assert_eq!(it.next().unwrap(), &2);
/// assert_eq!(it.next(), Some(&2));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -275,7 +275,7 @@ pub trait Iterator {
/// ```
/// let a = [1, 2];
/// let mut it = a.iter().filter_map(|&x| if x > 1 {Some(2 * x)} else {None});
/// assert_eq!(it.next().unwrap(), 4);
/// assert_eq!(it.next(), Some(4));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand Down Expand Up @@ -310,8 +310,8 @@ pub trait Iterator {
/// ```
/// let a = [100, 200];
/// let mut it = a.iter().enumerate();
/// assert_eq!(it.next().unwrap(), (0, &100));
/// assert_eq!(it.next().unwrap(), (1, &200));
/// assert_eq!(it.next(), Some((0, &100)));
/// assert_eq!(it.next(), Some((1, &200)));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -329,12 +329,12 @@ pub trait Iterator {
/// # #![feature(core)]
/// let xs = [100, 200, 300];
/// let mut it = xs.iter().cloned().peekable();
/// assert_eq!(*it.peek().unwrap(), 100);
/// assert_eq!(it.next().unwrap(), 100);
/// assert_eq!(it.next().unwrap(), 200);
/// assert_eq!(*it.peek().unwrap(), 300);
/// assert_eq!(*it.peek().unwrap(), 300);
/// assert_eq!(it.next().unwrap(), 300);
/// assert_eq!(*it.peek(), Some(100));
/// assert_eq!(it.next(), Some(100));
/// assert_eq!(it.next(), Some(200));
/// assert_eq!(*it.peek(), Some(300));
/// assert_eq!(*it.peek(), Some(300));
/// assert_eq!(it.next(), Some(300));
/// assert!(it.peek().is_none());
/// assert!(it.next().is_none());
/// ```
Expand All @@ -353,9 +353,9 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter().skip_while(|&a| *a < 3);
/// assert_eq!(it.next().unwrap(), &3);
/// assert_eq!(it.next().unwrap(), &4);
/// assert_eq!(it.next().unwrap(), &5);
/// assert_eq!(it.next(), Some(&3));
/// assert_eq!(it.next(), Some(&4));
/// assert_eq!(it.next(), Some(&5));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -375,8 +375,8 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter().take_while(|&a| *a < 3);
/// assert_eq!(it.next().unwrap(), &1);
/// assert_eq!(it.next().unwrap(), &2);
/// assert_eq!(it.next(), Some(&1));
/// assert_eq!(it.next(), Some(&2));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -395,8 +395,8 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter().skip(3);
/// assert_eq!(it.next().unwrap(), &4);
/// assert_eq!(it.next().unwrap(), &5);
/// assert_eq!(it.next(), Some(&4));
/// assert_eq!(it.next(), Some(&5));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -413,9 +413,9 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter().take(3);
/// assert_eq!(it.next().unwrap(), &1);
/// assert_eq!(it.next().unwrap(), &2);
/// assert_eq!(it.next().unwrap(), &3);
/// assert_eq!(it.next(), Some(&1));
/// assert_eq!(it.next(), Some(&2));
/// assert_eq!(it.next(), Some(&3));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand All @@ -437,11 +437,11 @@ pub trait Iterator {
/// *fac = *fac * x;
/// Some(*fac)
/// });
/// assert_eq!(it.next().unwrap(), 1);
/// assert_eq!(it.next().unwrap(), 2);
/// assert_eq!(it.next().unwrap(), 6);
/// assert_eq!(it.next().unwrap(), 24);
/// assert_eq!(it.next().unwrap(), 120);
/// assert_eq!(it.next(), Some(1));
/// assert_eq!(it.next(), Some(2));
/// assert_eq!(it.next(), Some(6));
/// assert_eq!(it.next(), Some(24));
/// assert_eq!(it.next(), Some(120));
/// assert!(it.next().is_none());
/// ```
#[inline]
Expand Down Expand Up @@ -680,7 +680,7 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.find(|&x| *x == 3).unwrap(), &3);
/// assert_eq!(it.find(|&x| *x == 3), Some(&3));
/// assert_eq!(it.collect::<Vec<_>>(), [&4, &5]);
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -715,7 +715,7 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 3, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.position(|x| *x == 3).unwrap(), 2);
/// assert_eq!(it.position(|x| *x == 3), Some(2));
/// assert_eq!(it.collect::<Vec<_>>(), [&4, &5]);
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -743,7 +743,7 @@ pub trait Iterator {
/// ```
/// let a = [1, 2, 2, 4, 5];
/// let mut it = a.iter();
/// assert_eq!(it.rposition(|x| *x == 2).unwrap(), 2);
/// assert_eq!(it.rposition(|x| *x == 2), Some(2));
/// assert_eq!(it.collect::<Vec<_>>(), [&1, &2]);
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -773,7 +773,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert_eq!(a.iter().max().unwrap(), &5);
/// assert_eq!(a.iter().max(), Some(&5));
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand All @@ -796,7 +796,7 @@ pub trait Iterator {
///
/// ```
/// let a = [1, 2, 3, 4, 5];
/// assert_eq!(a.iter().min().unwrap(), &1);
/// assert_eq!(a.iter().min(), Some(&1));
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down Expand Up @@ -900,7 +900,7 @@ pub trait Iterator {
/// # #![feature(core)]
///
/// let a = [-3_i32, 0, 1, 5, -10];
/// assert_eq!(*a.iter().max_by(|x| x.abs()).unwrap(), -10);
/// assert_eq!(*a.iter().max_by(|x| x.abs()), Some(-10));
/// ```
#[inline]
#[unstable(feature = "core",
Expand Down Expand Up @@ -929,7 +929,7 @@ pub trait Iterator {
/// # #![feature(core)]
///
/// let a = [-3_i32, 0, 1, 5, -10];
/// assert_eq!(*a.iter().min_by(|x| x.abs()).unwrap(), 0);
/// assert_eq!(*a.iter().min_by(|x| x.abs()), Some(0));
/// ```
#[inline]
#[unstable(feature = "core",
Expand Down Expand Up @@ -1025,9 +1025,9 @@ pub trait Iterator {
/// ```
/// let a = [1, 2];
/// let mut it = a.iter().cycle();
/// assert_eq!(it.next().unwrap(), &1);
/// assert_eq!(it.next().unwrap(), &2);
/// assert_eq!(it.next().unwrap(), &1);
/// assert_eq!(it.next(), Some(&1));
/// assert_eq!(it.next(), Some(&2));
/// assert_eq!(it.next(), Some(&1));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/expr_use_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ impl<'d,'t,'tcx,TYPER:mc::Typer<'tcx>> ExprUseVisitor<'d,'t,'tcx,TYPER> {
// that case we can adjust the length of the
// original vec accordingly, but we'd have to
// make trans do the right thing, and it would
// only work for `~` vectors. It seems simpler
// only work for `Box<[T]>`s. It seems simpler
// to just require that people call
// `vec.pop()` or `vec.unshift()`.
let slice_bk = ty::BorrowKind::from_mutbl(slice_mutbl);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/traits/coherence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ fn ty_is_local_constructor<'tcx>(tcx: &ty::ctxt<'tcx>,
def_id.krate == ast::LOCAL_CRATE
}

ty::ty_uniq(_) => { // treat ~T like Box<T>
ty::ty_uniq(_) => { // Box<T>
let krate = tcx.lang_items.owned_box().map(|d| d.krate);
krate == Some(ast::LOCAL_CRATE)
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustc/middle/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2441,10 +2441,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
/// `match_impl()`. For example, if `impl_def_id` is declared
/// as:
///
/// impl<T:Copy> Foo for ~T { ... }
/// impl<T:Copy> Foo for Box<T> { ... }
///
/// and `obligation_self_ty` is `int`, we'd back an `Err(_)`
/// result. But if `obligation_self_ty` were `~int`, we'd get
/// and `obligation_self_ty` is `int`, we'd get back an `Err(_)`
/// result. But if `obligation_self_ty` were `Box<int>`, we'd get
/// back `Ok(T=int)`.
fn match_inherent_impl(&mut self,
impl_def_id: ast::DefId,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/util/ppaux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ impl<'tcx, T:Repr<'tcx>> Repr<'tcx> for OwnedSlice<T> {
}
}

// This is necessary to handle types like Option<~[T]>, for which
// This is necessary to handle types like Option<Vec<T>>, for which
// autoderef cannot convert the &[T] handler
impl<'tcx, T:Repr<'tcx>> Repr<'tcx> for Vec<T> {
fn repr(&self, tcx: &ctxt<'tcx>) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_borrowck/borrowck/check_loans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ impl<'a, 'tcx> CheckLoanCtxt<'a, 'tcx> {
/// let p: Point;
/// p.x = 22; // ok, even though `p` is uninitialized
///
/// let p: ~Point;
/// let p: Box<Point>;
/// (*p).x = 22; // not ok, p is uninitialized, can't deref
/// ```
fn check_if_assigned_path_is_moved(&self,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> {
// `impl [... for] Private` is never visible.
let self_contains_private;
// impl [... for] Public<...>, but not `impl [... for]
// ~[Public]` or `(Public,)` etc.
// Vec<Public>` or `(Public,)` etc.
let self_is_public_path;

// check the properties of the Self type:
Expand Down
Loading