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

Add type_ascribe! macro as placeholder syntax for type ascription #104614

Merged
merged 3 commits into from
Dec 2, 2022

Conversation

Noratrieb
Copy link
Member

@Noratrieb Noratrieb commented Nov 19, 2022

This makes it still possible to test the internal semantics of type ascription even once the :-syntax is removed from the parser. The macro now gets used in a bunch of UI tests that test the semantics and not syntax of type ascription.

I might have forgotten a few tests but this should hopefully be most of them. The remaining ones will certainly be found once type ascription is removed from the parser altogether.

Part of #101728

This macro serves as a placeholder for future type ascription syntax to
make sure that the semantic implementation keeps working.
Use it in all UI tests that are about the semantics and not the syntax
of type ascription.
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2022

r? @TaKO8Ki

(rustbot has picked a reviewer for you, use r? to override)

@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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 19, 2022
@rustbot
Copy link
Collaborator

rustbot commented Nov 19, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@joshtriplett
Copy link
Member

Seems reasonable. We may, at some future time, want to drop this from the compiler entirely (if we decide we're never going to have syntax for it), but in the meantime this decouples the parser changes from the rest.

Copy link
Member

@TaKO8Ki TaKO8Ki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. I left some comments. r=me after they are addressed

library/core/src/prelude/v1.rs Show resolved Hide resolved
library/std/src/prelude/v1.rs Show resolved Hide resolved
@TaKO8Ki TaKO8Ki 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 Dec 1, 2022
Co-authored-by: Takayuki Maeda <takoyaki0316@gmail.com>
@compiler-errors
Copy link
Member

@bors r=TaKO8Ki

@bors
Copy link
Contributor

bors commented Dec 1, 2022

📌 Commit efea79c has been approved by TaKO8Ki

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 Dec 1, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 2, 2022
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#104614 (Add `type_ascribe!` macro as placeholder syntax for type ascription)
 - rust-lang#105126 (Make `VecDeque::new_in` unstably const)
 - rust-lang#105132 (Migrate summary toggle filter to CSS variable)
 - rust-lang#105136 (clarify comment on Deref promotion)
 - rust-lang#105137 (Add tracking issue number for `file_create_new` feature)
 - rust-lang#105143 (rustdoc: use simpler CSS for setting the font on scraped examples)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4fdc3eb into rust-lang:master Dec 2, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 2, 2022
@Noratrieb Noratrieb deleted the type-ascribe! branch December 2, 2022 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants