Skip to content

Conversation

Centril
Copy link
Contributor

@Centril Centril commented May 10, 2019

Successful merges:

Failed merges:

r? @ghost

nnethercote and others added 20 commits May 10, 2019 15:59
This lets comparisons occur with a single access to the interner,
instead of two.
Lots of details I wish I'd known when I first looked at this code.
At request of `@centril`, this commit extends the existing test added
by rust-lang#60676 to include nested `mut` patterns.
This commit adds tests checking that uninhabited non-exhaustive types
are considered inhabited when used in another crate.
This commit ensures that non-exhaustive variants are considered
inhabited when used in extern crates.
This commit ensures that non-exhaustive enums are considered inhabited
when used in extern crates.
This commit just tries to tidy up a little.
…etrochenkov

RFC 2008: Uninhabitedness fixes for enum variants and tests

Part of rust-lang#44109.

At the request of @Centril, this PR adds tests asserting that uninhabited non-exhaustive types are considered inhabited in extern crates. In adding these tests, I fixed an oversight in the implementation of RFC 2008 on enum variants that resulted in non-exhaustive enum variants being considered uninhabited in extern crates.

Before this PR, these lines would error:

```rust
// extern crate
pub enum UninhabitedVariants {
    #[non_exhaustive] Tuple(!),
    #[non_exhaustive] Struct { x: ! }
}

pub enum PartiallyInhabitedVariants {
    Tuple(u8),
    #[non_exhaustive] Struct { x: ! }
}

// current crate
match uninhabited_variant() /* fn() -> Option<UninhabitedVariants> */ {
    Some(_x) => (), //~ ERROR unreachable pattern
    None => (),
}

while let PartiallyInhabitedVariants::Struct { x, .. } = partially_inhabited_variant() /* fn() -> PartiallyInhabitedVariants */ {
    //~^ ERROR unreachable pattern
}
```

cc @Centril
r? @petrochenkov
Fix a couple of FIXMEs in ext::tt::transcribe

_Blocked on #60618_

A crater run would be nice to make sure my understanding is correct. A quick google search seems to indicate these are extremely rare errors if they are possible (which I don't believe they are).

r? @petrochenkov

cc rust-lang#2887 (there is only one FIXME left and it is hygiene-related)
…edString, r=Zoxc

Tweak `Symbol` and `InternedString`

Some minor improvements to speed and code cleanliness.

r? @Zoxc
Extend rust-lang#60676 test for nested mut patterns.

At request of @Centril, this commit extends the existing test added by rust-lang#60676 to include nested `mut` patterns.

cc @Centril
…ster

add regression test for rust-lang#60629

This bug was fixed, but I don't know which one. (I think it even doesn't matter at all).

Added a regression test.

```
op@OP ~/m/r/s/t/incremental> rustc --version
rustc 1.35.0-nightly (acd8dd6 2019-04-05)
op@OP ~/m/r/s/t/incremental> rustc -C incremental= --cfg rpass1 issue-60629.rs
warning: struct is never constructed: `A`
 --> issue-60629.rs:3:1
  |
3 | struct A;
  | ^^^^^^^^^
  |
  = note: #[warn(dead_code)] on by default

op@OP ~/m/r/s/t/incremental> rustc -C incremental= --cfg rpass2 issue-60629.rs
error: internal compiler error: src/librustc/ty/query/plumbing.rs:1195: Cannot force dep node: coherent_trait(core[c27c]::ops[0]::drop[0]::Drop[0])

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:635:9
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.35.0-nightly (acd8dd6 2019-04-05) running on x86_64-unknown-linux-gnu

note: compiler flags: -C incremental
```

with latest nightly it does not crash anymore, so nothing more to do.

Fixes rust-lang#60629

(accidentally removed the remote branch on github, therefore GH closed the other PR.)

r? @nikomatsakis
@Centril
Copy link
Contributor Author

Centril commented May 10, 2019

@bors r+ p=6 rollup=never

@bors
Copy link
Collaborator

bors commented May 10, 2019

📌 Commit 329275a 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 May 10, 2019
@bors
Copy link
Collaborator

bors commented May 10, 2019

⌛ Testing commit 329275a with merge d595b11...

bors added a commit that referenced this pull request May 10, 2019
Rollup of 6 pull requests

Successful merges:

 - #60529 (RFC 2008: Uninhabitedness fixes for enum variants and tests)
 - #60620 (Fix a couple of FIXMEs in ext::tt::transcribe)
 - #60659 (Tweak `Symbol` and `InternedString`)
 - #60692 (Extend #60676 test for nested mut patterns.)
 - #60697 (add regression test for #60629)
 - #60701 (Update mailmap for mati865)

Failed merges:

r? @ghost
@bors
Copy link
Collaborator

bors commented May 10, 2019

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 10, 2019
@bors bors merged commit 329275a into rust-lang:master May 10, 2019
@Centril Centril deleted the rollup-j5smdo0 branch May 10, 2019 23:00
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
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.

7 participants