deref patterns: bare-bones feature gate and typechecking by Nadrieril · Pull Request #122222 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation21 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

Nadrieril

I am restarting the deref patterns experimentation. This introduces a feature gate under the lang-team experimental feature process, with @cramertj as lang-team liaison (it's been a while though, you still ok with this @cramertj?). Tracking issue: #87121.

This is the barest-bones implementation I could think of:

My goal is to let us figure out the MIR lowering part, which might take some work. And hopefully get something working for std types soon.

This is in large part salvaged from @fee1-dead's #119467.

r? @compiler-errors

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Mar 9, 2024

@rust-log-analyzer

This comment has been minimized.

compiler-errors

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Mar 9, 2024

compiler-errors

@compiler-errors

pls squash as well, ty

regarding the lang team experiment, it may need a new liaison since @cramertj is no longer on T-lang

@Nadrieril

Ok, I've asked around for a new lang-team liaison

safinaskar

@safinaskar

Please, add more tests. I want to see how this is supposed to work. In particular I'd like to see this code in tests:

let a = Rc::new(vec![0]); let x = match a { box x => x, }

let a = Rc::new(vec![0]); let x: &Vec = match &a { box x => x, }

As well as I understand the first example should not compile (because you cannot move out of Rc), but the second - should

@Nadrieril

These test are not yet possible, because patterns are not lowered correctly to MIR. This is the very first beginnings of implementing the feature, more tests will come in later PRs. (I've just added your examples to my next PR, thank you for them. You are correct about how they should work).

@Nadrieril

@compiler-errors

@bors

📌 Commit bf7951d has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Mar 20, 2024

@compiler-errors

Actually

@bors r-

this needs rebasing

@bors bors added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

and removed S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

labels

Mar 20, 2024

compiler-errors

@Nadrieril @fee1-dead

Co-authored-by: Deadbeef ent3rm4n@gmail.com

@compiler-errors

@bors

📌 Commit 120d357 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Mar 20, 2024

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 21, 2024

@matthiaskrgr

…r=compiler-errors

deref patterns: bare-bones feature gate and typechecking

I am restarting the deref patterns experimentation. This introduces a feature gate under the lang-team experimental feature process, with @cramertj as lang-team liaison (it's been a while though, you still ok with this @cramertj?). Tracking issue: rust-lang#87121.

This is the barest-bones implementation I could think of:

My goal is to let us figure out the MIR lowering part, which might take some work. And hopefully get something working for std types soon.

This is in large part salvaged from @fee1-dead's rust-lang#119467.

r? @compiler-errors

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Mar 21, 2024

@workingjubilee

…r=compiler-errors

deref patterns: bare-bones feature gate and typechecking

I am restarting the deref patterns experimentation. This introduces a feature gate under the lang-team experimental feature process, with @cramertj as lang-team liaison (it's been a while though, you still ok with this @cramertj?). Tracking issue: rust-lang#87121.

This is the barest-bones implementation I could think of:

My goal is to let us figure out the MIR lowering part, which might take some work. And hopefully get something working for std types soon.

This is in large part salvaged from @fee1-dead's rust-lang#119467.

r? @compiler-errors

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 21, 2024

@bors

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 21, 2024

@matthiaskrgr

…r=compiler-errors

deref patterns: bare-bones feature gate and typechecking

I am restarting the deref patterns experimentation. This introduces a feature gate under the lang-team experimental feature process, with @cramertj as lang-team liaison (it's been a while though, you still ok with this @cramertj?). Tracking issue: rust-lang#87121.

This is the barest-bones implementation I could think of:

My goal is to let us figure out the MIR lowering part, which might take some work. And hopefully get something working for std types soon.

This is in large part salvaged from @fee1-dead's rust-lang#119467.

r? @compiler-errors

This was referenced

Mar 21, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Mar 21, 2024

@bors

…iaskrgr

Rollup of 8 pull requests

Successful merges:

Failed merges:

r? @ghost @rustbot modify labels: rollup

@bors

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Mar 21, 2024

@rust-timer

Rollup merge of rust-lang#122222 - Nadrieril:deref-pat-feature-gate, r=compiler-errors

deref patterns: bare-bones feature gate and typechecking

I am restarting the deref patterns experimentation. This introduces a feature gate under the lang-team experimental feature process, with @cramertj as lang-team liaison (it's been a while though, you still ok with this @cramertj?). Tracking issue: rust-lang#87121.

This is the barest-bones implementation I could think of:

My goal is to let us figure out the MIR lowering part, which might take some work. And hopefully get something working for std types soon.

This is in large part salvaged from @fee1-dead's rust-lang#119467.

r? @compiler-errors

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Mar 21, 2024

@matthiaskrgr

…r=Nadrieril

Implement macro-based deref!() syntax for deref patterns

Stop using box PAT syntax for deref patterns, and instead use a perma-unstable macro.

Blocked on rust-lang#122222

r? @Nadrieril

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Mar 21, 2024

@rust-timer

Rollup merge of rust-lang#122793 - compiler-errors:deref-pat-syntax, r=Nadrieril

Implement macro-based deref!() syntax for deref patterns

Stop using box PAT syntax for deref patterns, and instead use a perma-unstable macro.

Blocked on rust-lang#122222

r? @Nadrieril

Labels

F-deref_patterns

`#![feature(deref_patterns)]`

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.