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 4 pull requests #57577

Merged
merged 12 commits into from
Jan 13, 2019
Merged

Rollup of 4 pull requests #57577

merged 12 commits into from
Jan 13, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Jan 13, 2019

Successful merges:

Failed merges:

r? @ghost

davidtwco and others added 12 commits December 26, 2018 21:28
This commit adds justifications to error messages for conflicting
borrows of union fields.

Where previously an error message would say
``cannot borrow `u.b` as mutable..``, it now says
``cannot borrow `u` (via `u.b`) as mutable..``.
This ensures that arguments passed via `-C link-arg` can override the
first ones on the command line, for example allowing configuring of the
stack size.
This commit improves the logic for place descriptions in conflicting
borrow errors so that borrows of union fields have better messages even
when the unions are embedded in other unions or structs.
This commit improves diagnostic labels to mention which field a borrow
overlaps with and adds a note explaining that the fields overlap.
`TokenStream` is currently recursive in *two* ways:

- the `TokenTree` variant contains a `ThinTokenStream`, which can
  contain a `TokenStream`;

- the `TokenStream` variant contains a `Vec<TokenStream>`.

The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`.

This reduces complexity significantly. In particular, `StreamCursor` is
eliminated, and `Cursor` becomes much simpler, consisting now of just a
`TokenStream` and an index.

The commit also removes the `Extend` impl for `TokenStream`, because it
is only used in tests. (The commit also removes those tests.)

Overall, the commit reduces the number of lines of code by almost 200.
…rochenkov

Make `TokenStream` less recursive.

`TokenStream` is currently recursive in *two* ways:

- the `TokenTree` variant contains a `ThinTokenStream`, which can
  contain a `TokenStream`;

- the `TokenStream` variant contains a `Vec<TokenStream>`.

The latter is not necessary and causes significant complexity. This
commit replaces it with the simpler `Vec<(TokenTree, IsJoint)>`.

This reduces complexity significantly. In particular, `StreamCursor` is
eliminated, and `Cursor` becomes much simpler, consisting now of just a
`TokenStream` and an index.

The commit also removes the `Extend` impl for `TokenStream`, because it
is only used in tests. (The commit also removes those tests.)

Overall, the commit reduces the number of lines of code by almost 200.
NLL: Add union justifications to conflicting borrows.

Fixes rust-lang#57100.

This PR adds justifications to error messages for conflicting borrows of union fields.

Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.

r? @pnkfelix
…fitzgen

rustc: Place wasm linker args first instead of last

This ensures that arguments passed via `-C link-arg` can override the
first ones on the command line, for example allowing configuring of the
stack size.
@Centril
Copy link
Contributor Author

Centril commented Jan 13, 2019

@bors r+ p=4

@bors
Copy link
Contributor

bors commented Jan 13, 2019

📌 Commit e2311b3 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 13, 2019
@bors
Copy link
Contributor

bors commented Jan 13, 2019

⌛ Testing commit e2311b3 with merge 2cf736f...

bors added a commit that referenced this pull request Jan 13, 2019
Rollup of 4 pull requests

Successful merges:

 - #57004 (Make `TokenStream` less recursive.)
 - #57102 (NLL: Add union justifications to conflicting borrows.)
 - #57337 (rustc: Place wasm linker args first instead of last)
 - #57549 (Add #[must_use] message to Iterator and Future)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Jan 13, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 2cf736f to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants