Skip to content

Rollup of 9 pull requests #25298

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

Closed
wants to merge 55 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 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
96229e8
fixed ICE issue #25180
llogiq May 8, 2015
29daa29
formatting correction
llogiq May 8, 2015
1434715
crossed the i-s and dotted the t-s ;-) Also added a run-pass test and…
llogiq May 8, 2015
715f7c3
Add a precision for references
GuillaumeGomez May 8, 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
ca5c694
Pulled walk_fn() into Var mode, extended test
llogiq May 10, 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
6e19cfa
more tests
llogiq May 10, 2015
a18ce4d
fixed errors in test code
llogiq 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
25543f3
Add missing backticks
GuillaumeGomez May 10, 2015
0c390d2
point supposed to be immutable in this example
polachok May 10, 2015
685f557
Update docs to stop referencing `BufReadExt`
frewsxcv May 10, 2015
371eb87
Rollup merge of #24948 - derhuerst:patch-1, r=steveklabnik
steveklabnik May 10, 2015
ad1c0c5
Rollup merge of #25158 - koute:master, r=alexcrichton
steveklabnik May 10, 2015
a725378
Rollup merge of #25188 - tincann:patch-1, r=steveklabnik
steveklabnik May 10, 2015
ba8eb58
Rollup merge of #25222 - GuillaumeGomez:doc-ref, r=steveklabnik
steveklabnik May 10, 2015
fa207fa
Rollup merge of #25239 - sindreij:patch-1, r=alexcrichton
steveklabnik May 10, 2015
dcc76da
Rollup merge of #25240 - bluss:doc-hashmap-entry, r=steveklabnik
steveklabnik May 10, 2015
d065d57
Rollup merge of #25241 - sindreij:patch-2, r=steveklabnik
steveklabnik May 10, 2015
5160bf8
Rollup merge of #25255 - caipre:diagnostic-messages, r=alexcrichton
steveklabnik May 10, 2015
7ae332c
Rollup merge of #25257 - dpetersen:mutability-docfix, r=steveklabnik
steveklabnik May 10, 2015
c70458b
Rollup merge of #25263 - fhinkel:master, r=steveklabnik
steveklabnik May 10, 2015
9ecc989
Auto merge of #25281 - steveklabnik:rollup, r=steveklabnik
bors May 10, 2015
6d41013
Fix typo in guessing-game docs
petehunt May 10, 2015
a168a15
Fix typo in references-and-borrowing docs
petehunt May 10, 2015
295b62d
Docs: Compile-time bounds check in index expression
May 10, 2015
770f0e9
Add if let expressions example
May 11, 2015
6a19046
Four spaces indent, rephrasing
May 11, 2015
6b3daa5
Rollup merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnik
Manishearth May 11, 2015
c40f6b9
Rollup merge of #25209 - llogiq:master, r=eddyb
Manishearth May 11, 2015
8e4312b
Rollup merge of #25271 - tshepang:doc-deunwrap, r=steveklabnik
Manishearth May 11, 2015
05279f0
Rollup merge of #25277 - polachok:docfix, r=steveklabnik
Manishearth May 11, 2015
c61554a
Rollup merge of #25280 - frewsxcv:patch-22, r=steveklabnik
Manishearth May 11, 2015
9a021fa
Rollup merge of #25284 - petehunt:patch-1, r=steveklabnik
Manishearth May 11, 2015
32ff3f3
Rollup merge of #25286 - johannhof:patch-1, r=steveklabnik
Manishearth May 11, 2015
cb8394c
Rollup merge of #25287 - petehunt:patch-2, r=steveklabnik
Manishearth May 11, 2015
5bee122
Rollup merge of #25291 - johannhof:let-expressions-example, r=stevekl…
Manishearth May 11, 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
29 changes: 25 additions & 4 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ module declarations should be at the crate root if direct usage of the declared
modules within `use` items is desired. It is also possible to use `self` and
`super` at the beginning of a `use` item to refer to the current and direct
parent modules respectively. All rules regarding accessing declared modules in
`use` declarations applies to both module declarations and `extern crate`
`use` declarations apply to both module declarations and `extern crate`
declarations.

An example of what will and will not work for `use` items:
Expand Down Expand Up @@ -2564,12 +2564,19 @@ array is mutable, the resulting [lvalue](#lvalues,-rvalues-and-temporaries) can
be assigned to.

Indices are zero-based, and may be of any integral type. Vector access is
bounds-checked at run-time. When the check fails, it will put the thread in a
_panicked state_.
bounds-checked at compile-time for constant arrays being accessed with a constant index value.
Otherwise a check will be performed at run-time that will put the thread in a _panicked state_ if it fails.

```{should-fail}
([1, 2, 3, 4])[0];
(["a", "b"])[10]; // panics

let x = (["a", "b"])[10]; // compiler error: const index-expr is out of bounds

let n = 10;
let y = (["a", "b"])[n]; // panics

let arr = ["a", "b"];
arr[10]; // panics
```

### Range expressions
Expand Down Expand Up @@ -3064,6 +3071,20 @@ of a condition expression it expects a refutable let statement. If the value of
expression on the right hand side of the let statement matches the pattern, the corresponding
block will execute, otherwise flow proceeds to the first `else` block that follows.

```
let dish = ("Ham", "Eggs");

// this body will be skipped because the pattern is refuted
if let ("Bacon", b) = dish {
println!("Bacon is served with {}", b);
}

// this body will execute
if let ("Ham", b) = dish {
println!("Ham is served with {}", b);
}
```

### While let loops

A `while let` loop is semantically identical to a `while` loop but in place of a
Expand Down
6 changes: 3 additions & 3 deletions src/doc/trpl/guessing-game.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ information’. Why throw it away? Well, for a basic program, we just want to
print a generic error, as basically any issue means we can’t continue. The
[`ok()` method][ok] returns a value which has another method defined on it:
`expect()`. The [`expect()` method][expect] takes a value it’s called on, and
if it isn’t a successful one, [`panic!`][panic]s with a message you passed you
if it isn’t a successful one, [`panic!`][panic]s with a message you
passed it. A `panic!` like this will cause our program to crash, displaying
the message.

Expand Down 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
6 changes: 3 additions & 3 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 Expand Up @@ -169,7 +169,7 @@ struct Point {
y: Cell<i32>,
}

let mut point = Point { x: 5, y: Cell::new(6) };
let point = Point { x: 5, y: Cell::new(6) };

point.y.set(7);

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
37 changes: 36 additions & 1 deletion src/doc/trpl/references-and-borrowing.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ become quite acquainted. Ownership is how Rust achieves its largest goal,
memory safety. There are a few distinct concepts, each with its own
chapter:

* [ownership][ownership], ownership, the key concept
* [ownership][ownership], the key concept
* borrowing, which you’re reading now
* [lifetimes][lifetimes], an advanced concept of borrowing

Expand Down Expand Up @@ -312,6 +312,7 @@ println!("{}", y);

We get this error:

```text
error: `x` does not live long enough
y = &x;
^
Expand All @@ -334,3 +335,37 @@ In other words, `y` is only valid for the scope where `x` exists. As soon as
`x` goes away, it becomes invalid to refer to it. As such, the error says that
the borrow ‘doesn’t live long enough’ because it’s not valid for the right
amount of time.

The same problem occurs when the reference is declared _before_ the variable it refers to:

```rust,ignore
let y: &i32;
let x = 5;
y = &x;

println!("{}", y);
```

We get this error:

```text
error: `x` does not live long enough
y = &x;
^
note: reference must be valid for the block suffix following statement 0 at
2:16...
let y: &i32;
let x = 5;
y = &x;

println!("{}", y);
}

note: ...but borrowed value is only valid for the block suffix following
statement 1 at 3:14
let x = 5;
y = &x;

println!("{}", y);
}
```
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
7 changes: 4 additions & 3 deletions src/librustc/middle/check_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,10 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CheckCrateVisitor<'a, 'tcx> {
b: &'v ast::Block,
s: Span,
fn_id: ast::NodeId) {
assert!(self.mode == Mode::Var);
self.with_euv(Some(fn_id), |euv| euv.walk_fn(fd, b));
visit::walk_fn(self, fk, fd, b, s);
self.with_mode(Mode::Var, |v| {
v.with_euv(Some(fn_id), |euv| euv.walk_fn(fd, b));
visit::walk_fn(v, fk, fd, b, s);
})
}

fn visit_pat(&mut self, p: &ast::Pat) {
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
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ pub fn mangle<PI: Iterator<Item=PathElem>>(path: PI,
// when using unix's linker. Perhaps one day when we just use a linker from LLVM
// we won't need to do this name mangling. The problem with name mangling is
// that it seriously limits the available characters. For example we can't
// have things like &T or ~[T] in symbol names when one would theoretically
// have things like &T in symbol names when one would theoretically
// want them for things like impls of traits on that type.
//
// To be able to work on all platforms and get *some* reasonable output, we
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_trans/save/span_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ impl<'a> SpanUtils<'a> {
// Reparse span and return an owned vector of sub spans of the first limit
// identifier tokens in the given nesting level.
// example with Foo<Bar<T,V>, Bar<T,V>>
// Nesting = 0: all idents outside of brackets: ~[Foo]
// Nesting = 1: idents within one level of brackets: ~[Bar, Bar]
// Nesting = 0: all idents outside of brackets: Vec<Foo>
// Nesting = 1: idents within one level of brackets: Vec<Bar, Bar>
pub fn spans_with_brackets(&self, span: Span, nesting: isize, limit: isize) -> Vec<Span> {
let mut result: Vec<Span> = vec!();

Expand Down Expand Up @@ -352,7 +352,7 @@ impl<'a> SpanUtils<'a> {
return vec!();
}
// Type params are nested within one level of brackets:
// i.e. we want ~[A, B] from Foo<A, B<T,U>>
// i.e. we want Vec<A, B> from Foo<A, B<T,U>>
self.spans_with_brackets(span, 1, number)
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc_trans/trans/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
// The `noalias` attribute on the return value is useful to a
// function ptr caller.
match ret_ty.sty {
// `~` pointer return values never alias because ownership
// `Box` pointer return values never alias because ownership
// is transferred
ty::ty_uniq(it) if common::type_is_sized(ccx.tcx(), it) => {
attrs.ret(llvm::Attribute::NoAlias);
Expand Down Expand Up @@ -239,7 +239,7 @@ pub fn from_fn_type<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, fn_type: ty::Ty<'tcx
attrs.arg(idx, llvm::Attribute::ZExt);
}

// `~` pointer parameters never alias because ownership is transferred
// `Box` pointer parameters never alias because ownership is transferred
ty::ty_uniq(inner) => {
let llsz = machine::llsize_of_real(ccx, type_of::type_of(ccx, inner));

Expand Down
36 changes: 17 additions & 19 deletions src/librustc_trans/trans/debuginfo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,26 +142,24 @@ impl<'tcx> TypeMap<'tcx> {
fn get_unique_type_id_of_type<'a>(&mut self, cx: &CrateContext<'a, 'tcx>,
type_: Ty<'tcx>) -> UniqueTypeId {

// basic type -> {:name of the type:}
// tuple -> {tuple_(:param-uid:)*}
// struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
// enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
// enum variant -> {variant_:variant-name:_:enum-uid:}
// reference (&) -> {& :pointee-uid:}
// mut reference (&mut) -> {&mut :pointee-uid:}
// ptr (*) -> {* :pointee-uid:}
// mut ptr (*mut) -> {*mut :pointee-uid:}
// unique ptr (~) -> {~ :pointee-uid:}
// @-ptr (@) -> {@ :pointee-uid:}
// sized vec ([T; x]) -> {[:size:] :element-uid:}
// unsized vec ([T]) -> {[] :element-uid:}
// trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
// closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
// basic type -> {:name of the type:}
// tuple -> {tuple_(:param-uid:)*}
// struct -> {struct_:svh: / :node-id:_<(:param-uid:),*> }
// enum -> {enum_:svh: / :node-id:_<(:param-uid:),*> }
// enum variant -> {variant_:variant-name:_:enum-uid:}
// reference (&) -> {& :pointee-uid:}
// mut reference (&mut) -> {&mut :pointee-uid:}
// ptr (*) -> {* :pointee-uid:}
// mut ptr (*mut) -> {*mut :pointee-uid:}
// unique ptr (box) -> {box :pointee-uid:}
// @-ptr (@) -> {@ :pointee-uid:}
// sized vec ([T; x]) -> {[:size:] :element-uid:}
// unsized vec ([T]) -> {[] :element-uid:}
// trait (T) -> {trait_:svh: / :node-id:_<(:param-uid:),*> }
// closure -> {<unsafe_> <once_> :store-sigil: |(:param-uid:),* <,_...>| -> \
// :return-type-uid: : (:bounds:)*}
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
// function -> {<unsafe_> <abi_> fn( (:param-uid:)* <,_...> ) -> \
// :return-type-uid:}
// unique vec box (~[]) -> {HEAP_VEC_BOX<:pointee-uid:>}
// gc box -> {GC_BOX<:pointee-uid:>}

match self.type_to_unique_id.get(&type_).cloned() {
Some(unique_type_id) => return unique_type_id,
Expand Down Expand Up @@ -202,7 +200,7 @@ impl<'tcx> TypeMap<'tcx> {
}
},
ty::ty_uniq(inner_type) => {
unique_type_id.push('~');
unique_type_id.push_str("box ");
let inner_type_id = self.get_unique_type_id_of_type(cx, inner_type);
let inner_type_id = self.get_unique_type_id_as_string(inner_type_id);
unique_type_id.push_str(&inner_type_id[..]);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2458,7 +2458,7 @@ fn check_expr_with_lvalue_pref<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>, expr: &'tcx ast::
}

// determine the `self` type, using fresh variables for all variables
// declared on the impl declaration e.g., `impl<A,B> for ~[(A,B)]`
// declared on the impl declaration e.g., `impl<A,B> for Vec<(A,B)>`
// would return ($0, $1) where $0 and $1 are freshly instantiated type
// variables.
pub fn impl_self_ty<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
Expand Down
Loading