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 10 pull requests #65422

Merged
merged 47 commits into from
Oct 15, 2019
Merged

Rollup of 10 pull requests #65422

merged 47 commits into from
Oct 15, 2019

Conversation

tmandry
Copy link
Member

@tmandry tmandry commented Oct 15, 2019

Successful merges:

Failed merges:

r? @ghost

nnethercote and others added 30 commits October 10, 2019 16:20
Some places use the local `tcx` variable, some use `self.tcx()`. This
commit removes the local variable so that all places use `self.tcx()`,
for consistency.
This wins 6% on `unicode_normalization`, by avoiding a call to
`lub_concrete_regions()` and a `Region` equality test.
The function only has one call site, so we don't need a tag argument.
The associated long diagnostic didn't get registered before
It means an allocation is required to create an empty `TokenStream`, but
all other operations are simpler and marginally faster due to not having
to check for `None`. Overall it simplifies the code for a negligible
performance effect.

The commit also removes `TokenStream::empty` by implementing `Default`,
which is now possible.
This avoids some unnecessary creation of empty token streams.
Use a more traditional scheme with providing them as a resolver output
spastorino and others added 13 commits October 14, 2019 18:05
rustc_metadata: Privatize private code and remove dead code

Also some minor cleanup and documentation improvements.

r? @eddyb
…-expansion, r=nikomatsakis

Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis
…eam, r=petrochenkov

Remove `Option` from `TokenStream`

A code simplification.

r? @petrochenkov
std::fmt: reorder docs

This moves the "Formatting Parameters" section up above right after the discussion of named and positional arguments. Then comes the "Syntax" section, summarizing the discussion of format string syntax.
And only *then* we get to "Formatting Traits" -- that section has some *huge* code examples, so it really should not interrupt the discussion of the grammar. Also users are much more likely to come here to learn about the format string grammar than to come here to learn about the `Binary` trait.
Several changes to the codegen backend organization

* Split functions from values in cg_ssa `BackendTypes`.
* Remove `is_const_integral` function from `ConstMethods`.
* Actually register the invalid monomorphization of intrinsic long diagnostic and remove the `diagnostics` method from `CodegenBackends`, as it was unused.
* Add cg_ssa and cg_utils provided methods to `default_provide`, so codegen backend don't have to do it themself.
Bring attention to suggestions when the only difference is capitalization

CC rust-lang#65386.
…=davidtwco,varkor

syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`

Fixes rust-lang#65400.

The recovery comes in two flavors:

1. We know that `p2` is a binding so we can invert as `p2 @ p1`:

```rust
error: pattern on wrong side of `@`
  --> $DIR/intersection-patterns.rs:13:9
   |
LL |         Some(x) @ y => {}
   |         -------^^^-
   |         |         |
   |         |         binding on the right, should be to the left
   |         pattern on the left, should be to the right
   |         help: switch the order: `y @ Some(x)`
```

2. Otherwise we emit a generic diagnostic for the lack of support for intersection patterns:

```rust
error: left-hand side of `@` must be a binding
  --> $DIR/intersection-patterns.rs:23:9
   |
LL |         Some(x) @ Some(y) => {}
   |         -------^^^-------
   |         |         |
   |         |         also a pattern
   |         interpreted as a pattern, not a binding
   |
   = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
```

For more on and-patterns, see e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern.

r? @davidtwco
cc @varkor @lzutao
Remove an outdated test output file

It was accidentally introduced during some rebase, but it's no longer necessary and `--bless` removes it, but it doesn't fail testing.
@tmandry
Copy link
Member Author

tmandry commented Oct 15, 2019

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented Oct 15, 2019

📌 Commit 9422feb has been approved by tmandry

@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 Oct 15, 2019
@bors
Copy link
Contributor

bors commented Oct 15, 2019

⌛ Testing commit 9422feb with merge e369d87...

bors added a commit that referenced this pull request Oct 15, 2019
Rollup of 10 pull requests

Successful merges:

 - #65170 (rustc_metadata: Privatize private code and remove dead code)
 - #65260 (Optimize `LexicalResolve::expansion`.)
 - #65261 (Remove `Option` from `TokenStream`)
 - #65332 (std::fmt: reorder docs)
 - #65340 (Several changes to the codegen backend organization)
 - #65365 (Include const generic arguments in metadata)
 - #65398 (Bring attention to suggestions when the only difference is capitalization)
 - #65410 (syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`)
 - #65415 (Remove an outdated test output file)
 - #65416 (Minor sync changes)

Failed merges:

r? @ghost
@tmandry tmandry added the rollup A PR which is a rollup label Oct 15, 2019
@bors
Copy link
Contributor

bors commented Oct 15, 2019

☀️ Test successful - checks-azure
Approved by: tmandry
Pushing e369d87 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

10 participants