Merged
Conversation
We want to catch this error:
```
if (foo)
bar;
```
as it's valid syntax in other languages, and say how to fix it.
Unfortunately it didn't care if the suggestion made sense and just
highlighted the unexpected token.
Now it attempts to parse a statement, and if it succeeds, it shows the
help message.
Fixes rust-lang#35907
We originally imported this into the repository with the intent of fixing it up. Instead, nothing happened. Its appearance on rust-lang.org makes it seem semi-official, but it's not. The rustfmt strike team will end up producing something like this anyway, and leaving it around does nothing but mislead people.
Remove style guide. We originally imported this into the repository with the intent of fixing it up. Instead, nothing happened. Its appearance on rust-lang.org makes it seem semi-official, but it's not. The rustfmt strike team will end up producing something like this anyway, and leaving it around does nothing but mislead people. r? @aturon
Fix ICE when arg types can't be found in impl/trait methods while comparing Fixes rust-lang#35869.
…=nrc
Improve error message when failing to parse a block
We want to catch this error:
```
if (foo)
bar;
```
as it's valid syntax in other languages, and say how to fix it.
Unfortunately it didn't care if the suggestion made sense and just
highlighted the unexpected token.
Now it attempts to parse a statement, and if it succeeds, it shows the
help message.
Fixes rust-lang#35907
…akis
Combine types and regions in Substs into one interleaved list.
Previously, `Substs` would contain types and regions, in two separate vectors, for example:
```rust
<X as Trait<'a, 'b, A, B>>::method::<'p, 'q, T, U>
/* corresponds to */
Substs { regions: ['a, 'b, 'p, 'q], types: [X, A, B, T, U] }
```
This PR continues the work started in rust-lang#35605 by further removing the distinction.
A new abstraction over types and regions is introduced in the compiler, `Kind`.
Each `Kind` is a pointer (`&TyS` or `&Region`), with the lowest two bits used as a tag.
Two bits were used instead of just one (type = `0`, region = `1`) to allow adding more kinds.
`Substs` contain only a `Vec<Kind>`, with `Self` first, followed by regions and types (in the definition order):
```rust
Substs { params: [X, 'a, 'b, A, B, 'p, 'q, T, U] }
```
The resulting interleaved list has the property of being the concatenation of parameters for the (potentially) nested generic items it describes, and can be sliced back into those components:
```rust
params[0..5] = [X, 'a, 'b, A, B] // <X as Trait<'a, 'b, A, B>>
params[5..9] = ['p, 'q, T, U] // <_>::method::<'p, 'q, T, U>
```
r? @nikomatsakis
rustc_borrowck: Don't hash types in loan paths 1) Types for equal loan paths are not always equal, they can sometimes differ in lifetimes, making equal loan paths hash differently. Example: https://github.com/rust-lang/rust/blob/71bdeea561355ba5adbc9a1f44f4f866a75a15c4/src/libcollections/linked_list.rs#L835-L856 One of `self.list`s has type ``` &ReFree(CodeExtent(15013/CallSiteScope { fn_id: 18907, body_id: 18912 }), BrNamed(0:DefIndex(3066), 'a(397), WontChange)) mut linked_list::LinkedList<T> ``` and other has type ``` &ReScope(CodeExtent(15018/Remainder(BlockRemainder { block: 18912, first_statement_index: 0 }))) mut linked_list::LinkedList<T> ``` (... but I'm not sure it's not a bug actually.) 2) Not hashing types is faster than hashing types. r? @arielb1
Replace unnecessary uses of `TraitObject` with casts r? @alexcrichton
…komatsakis Stabilize type-macros Closes rust-lang#27245 r? @nikomatsakis
Contributor
|
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
Member
Author
|
@bors r+ p=20 |
Collaborator
|
📌 Commit 2b3921e has been approved by |
Collaborator
|
⌛ Testing commit 2b3921e with merge 0453d60... |
Collaborator
|
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
Member
Author
|
@bors r+ |
Collaborator
|
📌 Commit 96d523d has been approved by |
Member
Author
|
@bors force |
Collaborator
|
⌛ Testing commit 96d523d with merge bb2deff... |
Collaborator
|
💔 Test failed - auto-win-msvc-32-opt |
Member
Author
|
@bors retry |
Collaborator
|
⌛ Testing commit 96d523d with merge 6aac8b4... |
Collaborator
|
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
Member
Author
|
@bors retry |
Member
Author
|
@bors r+ force |
Collaborator
|
📌 Commit 668d631 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
Aug 27, 2016
Collaborator
This was referenced Aug 27, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TraitObjectwith casts #36005, Stabilize type-macros #36014