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

Stabilize `type_alias_enum_variants` in Rust 1.37.0 #61682

Merged
merged 21 commits into from Jul 1, 2019

Conversation

@Centril
Copy link
Member

commented Jun 9, 2019

Stabilize #![feature(type_alias_enum_variants)] which allows type-relative resolution with highest priority to enum variants in both expression and pattern contexts. For example, you may now write:

enum Option<T> {
    None,
    Some(T),
}

type OptAlias<T> = Option<T>;

fn work_on_alias(x: Option<u8>) -> u8 {
    match x {
        OptAlias::Some(y) => y + 1,
        OptAlias::None => 0,
    }
}

Closes rust-lang/rfcs#2218
Closes #52118

r? @petrochenkov

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Jun 10, 2019

☔️ The latest upstream changes (presumably #61229) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril force-pushed the Centril:stabilize-type_alias_enum_variants branch from 8e11bda to c2cbbc3 Jun 10, 2019

@bors

This comment was marked as resolved.

Copy link
Contributor

commented Jun 12, 2019

☔️ The latest upstream changes (presumably #61722) made this pull request unmergeable. Please resolve the merge conflicts.

@Centril Centril force-pushed the Centril:stabilize-type_alias_enum_variants branch from c2cbbc3 to d75d14a Jun 12, 2019

bors added a commit that referenced this pull request Jun 14, 2019

Auto merge of #61825 - Centril:tauv-infer-fix, r=<try>
type_alias_enum_variants: fix #61801; allow a path pattern to infer

Fix #61801.

Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression.

Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...)

The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler.

r? @petrochenkov
cc @eddyb @alexreg
cc #61682
cc #49683

Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019

Rollup merge of rust-lang#61825 - Centril:tauv-infer-fix, r=petrochenkov
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer

Fix rust-lang#61801.

Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression.

Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...)

The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler.

r? @petrochenkov
cc @eddyb @alexreg
cc rust-lang#61682
cc rust-lang#49683

Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019

Rollup merge of rust-lang#61825 - Centril:tauv-infer-fix, r=petrochenkov
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer

Fix rust-lang#61801.

Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression.

Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...)

The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler.

r? @petrochenkov
cc @eddyb @alexreg
cc rust-lang#61682
cc rust-lang#49683
@bors

This comment was marked as resolved.

Copy link
Contributor

commented Jun 14, 2019

☔️ The latest upstream changes (presumably #61817) made this pull request unmergeable. Please resolve the merge conflicts.

Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019

Rollup merge of rust-lang#61825 - Centril:tauv-infer-fix, r=petrochenkov
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer

Fix rust-lang#61801.

Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression.

Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...)

The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler.

r? @petrochenkov
cc @eddyb @alexreg
cc rust-lang#61682
cc rust-lang#49683

Centril added a commit to Centril/rust that referenced this pull request Jun 14, 2019

Rollup merge of rust-lang#61825 - Centril:tauv-infer-fix, r=petrochenkov
type_alias_enum_variants: fix rust-lang#61801; allow a path pattern to infer

Fix rust-lang#61801.

Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression.

Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...)

The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler.

r? @petrochenkov
cc @eddyb @alexreg
cc rust-lang#61682
cc rust-lang#49683

@Centril Centril force-pushed the Centril:stabilize-type_alias_enum_variants branch from d75d14a to ccdbfda Jun 14, 2019

bors added a commit that referenced this pull request Jun 15, 2019

Auto merge of #61825 - Centril:tauv-infer-fix, r=petrochenkov
type_alias_enum_variants: fix #61801; allow a path pattern to infer

Fix #61801.

Given a type-relative path pattern referring to an enum variant through a type alias, allow inferring the generic argument applied in the expectation set by the scrutinee of a `match` expression.

Similar issues may exist for `let` statements but I don't know how to test for that since `PhantomData<T>` is necessary...)

The gist of the problem here was that `resolve_ty_and_res_ufcs` was called twice which is apparently no good... It is possible that this PR is papering over some deeper problem, but that is beyond my knowledge of the compiler.

r? @petrochenkov
cc @eddyb @alexreg
cc #61682
cc #49683
@rfcbot

This comment has been minimized.

Copy link

commented Jun 20, 2019

🔔 This is now entering its final comment period, as per the review above. 🔔

@Centril Centril removed the I-nominated label Jun 20, 2019

@auscompgeek

This comment has been minimized.

Copy link

commented Jun 29, 2019

Have we time travelled?

@rfcbot

This comment has been minimized.

Copy link

commented Jun 30, 2019

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

The RFC will be merged soon.

@Centril

This comment has been minimized.

Copy link
Member Author

commented Jun 30, 2019

@bors r=petrochenkov p=10

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 30, 2019

📌 Commit 57e6869 has been approved by petrochenkov

@bors

This comment was marked as outdated.

Copy link
Contributor

commented Jun 30, 2019

⌛️ Testing commit 57e6869 with merge c8bfe5e...

bors added a commit that referenced this pull request Jun 30, 2019

Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, r=…
…petrochenkov

Stabilize `type_alias_enum_variants` in Rust 1.37.0

Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write:

```rust
enum Option<T> {
    None,
    Some(T),
}

type OptAlias<T> = Option<T>;

fn work_on_alias(x: Option<u8>) -> u8 {
    match x {
        OptAlias::Some(y) => y + 1,
        OptAlias::None => 0,
    }
}
```

Closes rust-lang/rfcs#2218
Closes #52118

r? @petrochenkov
@pietroalbini

This comment was marked as outdated.

Copy link
Member

commented Jun 30, 2019

@bors retry

Yielding priority to the Azure switch.

@bors

This comment was marked as outdated.

Copy link
Contributor

commented Jun 30, 2019

⌛️ Testing commit 57e6869 with merge 0d9e311...

bors added a commit that referenced this pull request Jun 30, 2019

Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, r=…
…petrochenkov

Stabilize `type_alias_enum_variants` in Rust 1.37.0

Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write:

```rust
enum Option<T> {
    None,
    Some(T),
}

type OptAlias<T> = Option<T>;

fn work_on_alias(x: Option<u8>) -> u8 {
    match x {
        OptAlias::Some(y) => y + 1,
        OptAlias::None => 0,
    }
}
```

Closes rust-lang/rfcs#2218
Closes #52118

r? @petrochenkov
@Mark-Simulacrum

This comment was marked as outdated.

Copy link
Member

commented Jul 1, 2019

@bors retry Yielding priority to the Azure switch.

bors added a commit that referenced this pull request Jul 1, 2019

Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, r=…
…petrochenkov

Stabilize `type_alias_enum_variants` in Rust 1.37.0

Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write:

```rust
enum Option<T> {
    None,
    Some(T),
}

type OptAlias<T> = Option<T>;

fn work_on_alias(x: Option<u8>) -> u8 {
    match x {
        OptAlias::Some(y) => y + 1,
        OptAlias::None => 0,
    }
}
```

Closes rust-lang/rfcs#2218
Closes #52118

r? @petrochenkov
@bors

This comment was marked as outdated.

Copy link
Contributor

commented Jul 1, 2019

⌛️ Testing commit 57e6869 with merge 32cdf13...

@Mark-Simulacrum

This comment was marked as outdated.

Copy link
Member

commented Jul 1, 2019

@bors retry Yielding priority to the Azure switch.

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Jul 1, 2019

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Cloning into 'rust-lang/rust'...
travis_time:end:0afcf53b:start=1561939490253957786,finish=1561939496161705773,duration=5907747987
$ cd rust-lang/rust
$ git checkout -qf 32cdf13d0db296733aba16a89b76044d31ed40c6
fatal: reference is not a tree: 32cdf13d0db296733aba16a89b76044d31ed40c6
The command "git checkout -qf 32cdf13d0db296733aba16a89b76044d31ed40c6" failed and exited with 128 during .
Your build has been stopped.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

⌛️ Testing commit 57e6869 with merge 5748825...

bors added a commit that referenced this pull request Jul 1, 2019

Auto merge of #61682 - Centril:stabilize-type_alias_enum_variants, r=…
…petrochenkov

Stabilize `type_alias_enum_variants` in Rust 1.37.0

Stabilize `#![feature(type_alias_enum_variants)]` which allows type-relative resolution with highest priority to `enum` variants in both expression and pattern contexts. For example, you may now write:

```rust
enum Option<T> {
    None,
    Some(T),
}

type OptAlias<T> = Option<T>;

fn work_on_alias(x: Option<u8>) -> u8 {
    match x {
        OptAlias::Some(y) => y + 1,
        OptAlias::None => 0,
    }
}
```

Closes rust-lang/rfcs#2218
Closes #52118

r? @petrochenkov
@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 1, 2019

☀️ Test successful - checks-azure, checks-travis, status-appveyor
Approved by: petrochenkov
Pushing 5748825 to master...

@bors bors added the merged-by-bors label Jul 1, 2019

@bors bors merged commit 57e6869 into rust-lang:master Jul 1, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
pr Build #20190616.40 succeeded
Details

@Centril Centril deleted the Centril:stabilize-type_alias_enum_variants branch Jul 1, 2019

@axic axic referenced this pull request Jul 4, 2019

Open

rust: add enum aliases #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.