-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 7 pull requests #36030
Rollup of 7 pull requests #36030
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
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
@bors r+ p=20 |
📌 Commit 2b3921e has been approved by |
⌛ Testing commit 2b3921e with merge 0453d60... |
💔 Test failed - auto-win-gnu-32-opt-rustbuild |
@bors r+ |
📌 Commit 96d523d has been approved by |
@bors force |
⌛ Testing commit 96d523d with merge bb2deff... |
💔 Test failed - auto-win-msvc-32-opt |
@bors retry |
⌛ Testing commit 96d523d with merge 6aac8b4... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors retry |
@bors r+ force |
📌 Commit 668d631 has been approved by |
TraitObject
with casts #36005, Stabilize type-macros #36014