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 9 pull requests #63489

Merged
merged 21 commits into from
Aug 12, 2019
Merged

Rollup of 9 pull requests #63489

merged 21 commits into from
Aug 12, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 12, 2019

Zoxc and others added 21 commits July 26, 2019 05:24
This reverts commit e38e954.

llvm were not able to optimize the code that well with the simplified mir.

Closes: rust-lang#62993
A program like the following one:

```rust
enum E { A, B, C }
fn f(x: E) -> bool {
    match x {
        A | B => false,
        C => true
    }
}
```

is rejected by the compiler due to `E` variant paths not being in scope.
In this case `A`, `B` are resolved as pattern bindings and consequently
the pattern is considered invalid as the inner or-patterns do not bind
to the same set of identifiers.

This is expected but the compiler errors that follow could be surprising
or confusing to some users. This commit adds a help note explaining that
if the user desired to match against variants or consts, they should use
a qualified path. The note is restricted to cases where the identifier
starts with an upper-case sequence so as to reduce the false negatives.

Since this happens during resolution, there's no clean way to check what
the patterns match against. The syntactic criterium, however, is in line
with the convention that's assumed by the `non-camel-case-types` lint.
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
Adds a closing parenthesis.
…es-suggest-qualified-path, r=petrochenkov

Suggest using a qualified path in patterns with inconsistent bindings

A program like the following one:

```rust
enum E { A, B, C }
fn f(x: E) -> bool {
    match x {
        A | B => false,
        C => true
    }
}
```

is rejected by the compiler due to `E` variant paths not being in scope.
In this case `A`, `B` are resolved as pattern bindings and consequently
the pattern is considered invalid as the inner or-patterns do not bind
to the same set of identifiers.

This is expected but the compiler errors that follow could be surprising
or confusing to some users. This commit adds a help note explaining that
if the user desired to match against variants or consts, they should use
a qualified path. The help note is restricted to cases where the identifier
starts with an upper-case sequence so as to reduce the false negatives.

Since this happens during resolution, there's no clean way to check what
it is the patterns match against. The syntactic criterium, however, is in line
with the convention that's assumed by the `non-camel-case-types` lint.

Fixes rust-lang#50831.
… r=matthewjasper

Revert "Simplify MIR generation for logical ops"

This reverts commit e38e954.

llvm were not able to optimize the code that well with the simplified mir.

Closes: rust-lang#62993
resolve: Remove remaining special cases from built-in macros

Edition and definition sites of the macros are now also taken from the `#[rustc_builtin_macro]` definitions in `libcore`.

---
The edition switch may be a breaking change for `Rustc{Encodable,Decodable}` derives if they are used in combination with the unstable crate `serialize` from sysroot like this
```rust
extern crate serialize;
use serialize as rustc_serialize;

#[derive(RustcEncodable)]
struct S;
```
(see the updated `ui-fulldeps` tests).
…iplett

docs: add stdlib env::var(_os) panic

Closes rust-lang#63456
@Centril
Copy link
Contributor Author

Centril commented Aug 12, 2019

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented Aug 12, 2019

📌 Commit 9d29719 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 Aug 12, 2019
@bors
Copy link
Contributor

bors commented Aug 12, 2019

⌛ Testing commit 9d29719 with merge c01be67...

bors added a commit that referenced this pull request Aug 12, 2019
Rollup of 9 pull requests

Successful merges:

 - #62108 (Use sharded maps for queries)
 - #63297 (Improve pointer offset method docs)
 - #63406 (Suggest using a qualified path in patterns with inconsistent bindings)
 - #63431 (Revert "Simplify MIR generation for logical ops")
 - #63449 (resolve: Remove remaining special cases from built-in macros)
 - #63461 (docs: add stdlib env::var(_os) panic)
 - #63473 (Regression test for #56870)
 - #63474 (Add tests for issue #53598 and #57700)
 - #63480 (Fixes #63477)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Aug 12, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing c01be67 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2019
@bors bors merged commit 9d29719 into rust-lang:master Aug 12, 2019
@Centril Centril deleted the rollup-uuf6z1s branch August 12, 2019 12:44
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.

Typo in println docs.