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

[WIP] Remove type ascription syntax #106826

Closed
wants to merge 2 commits into from

Conversation

Noratrieb
Copy link
Member

@Noratrieb Noratrieb commented Jan 13, 2023

Still work in progress, I need to work on getting a few diagnostics back in order.

Mostly opening this so I don't forget about this (which has totally not happened before)

#101728

r? @ghost

My type ascription
Oh rip it out
Ah
If you think we live too much then
You can sacrifice diagnostics
Don't mix your garbage
Into my syntax
So many weird hacks keep diagnostics alive
Yet I don't even step outside
So many bad diagnostics keep tyasc alive
Yet tyasc doesn't even bother to survive!
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic 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 Jan 13, 2023
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.debug-assertions := True
configure: rust.overflow-checks := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
Attempting with retry: make prepare
---
   Compiling log v0.4.14
   Compiling anyhow v1.0.65
    Checking clippy_utils v0.1.68 (/checkout/src/tools/clippy/clippy_utils)
    Checking rand_core v0.6.4
error[E0432]: unresolved import `rustc_ast::util::parser::AssocOp::Colon`
   --> src/tools/clippy/clippy_utils/src/sugg.rs:612:59
    |
612 |         Add, As, Assign, AssignOp, BitAnd, BitOr, BitXor, Colon, Divide, DotDot, DotDotEq, Equal, Greater,
    |                                                           ^^^^^ no `Colon` in `util::parser::AssocOp`
help: consider importing one of these items instead
    |
    |
612 |         Add, As, Assign, AssignOp, BitAnd, BitOr, BitXor, crate::TokenKind::Colon;
    |                                                           ~~~~~~~~~~~~~~~~~~~~~~~~
612 |         Add, As, Assign, AssignOp, BitAnd, BitOr, BitXor, crate::sugg::token::Colon;
    |                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~
612 |         Add, As, Assign, AssignOp, BitAnd, BitOr, BitXor, rustc_ast::token::Colon;
    |                                                           ~~~~~~~~~~~~~~~~~~~~~~~~
612 |         Add, As, Assign, AssignOp, BitAnd, BitOr, BitXor, rustc_lexer::TokenKind::Colon;

error[E0408]: variable `Colon` is not bound in all patterns
   --> src/tools/clippy/clippy_utils/src/sugg.rs:618:9
    |
    |
618 |         Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | Colon => Associativity::Both,
    |         ^^^   ^^^^^^   ^^^^^   ^^^^^^   ^^^^   ^^^   ^^^^^^^^   ^^   ----- variable not in all patterns
    |         |     |        |       |        |      |     |          pattern doesn't bind `Colon`
    |         |     |        |       |        |      |     pattern doesn't bind `Colon`
    |         |     |        |       |        |      pattern doesn't bind `Colon`
    |         |     |        |       |        pattern doesn't bind `Colon`
    |         |     |        |       |        pattern doesn't bind `Colon`
    |         |     |        |       pattern doesn't bind `Colon`
    |         |     |        pattern doesn't bind `Colon`
    |         |     pattern doesn't bind `Colon`
    |         pattern doesn't bind `Colon`
    |
help: if you meant to match on items, use the full path in the pattern
    |
618 |         Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | crate::TokenKind::Colon => Associativity::Both,
    |                                                                      ~~~~~~~~~~~~~~~~~~~~~~~
618 |         Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | crate::sugg::token::Colon => Associativity::Both,
    |                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~
618 |         Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | rustc_ast::token::Colon => Associativity::Both,
    |                                                                      ~~~~~~~~~~~~~~~~~~~~~~~
618 |         Add | BitAnd | BitOr | BitXor | LAnd | LOr | Multiply | As | rustc_lexer::TokenKind::Colon => Associativity::Both,

   Compiling clippy v0.1.68 (/checkout/src/tools/clippy)
   Compiling parking_lot_core v0.9.4
    Checking unicode-script v0.5.5
---
    Checking rand v0.8.5
    Checking bytes v1.0.1
    Checking diff v0.1.13
    Checking bstr v0.2.17
error[E0599]: no variant or associated item named `Colon` found for enum `AssocOp` in the current scope
   --> src/tools/clippy/clippy_utils/src/sugg.rs:174:66
    |
174 |             hir::ExprKind::Type(lhs, ty) => Sugg::BinOp(AssocOp::Colon, get_snippet(lhs.span), get_snippet(ty.span)),
    |                                                                  ^^^^^ variant or associated item not found in `AssocOp`

error[E0599]: no variant or associated item named `Colon` found for enum `AssocOp` in the current scope
   --> src/tools/clippy/clippy_utils/src/sugg.rs:269:26
    |
269 |                 AssocOp::Colon,
    |                          ^^^^^ variant or associated item not found in `AssocOp`

error[E0599]: no variant or associated item named `Colon` found for enum `AssocOp` in the current scope
   --> src/tools/clippy/clippy_utils/src/sugg.rs:402:18
    |
402 |         AssocOp::Colon => format!("{lhs}: {rhs}"),
    |                  ^^^^^ variant or associated item not found in `AssocOp`
   Compiling libnghttp2-sys v0.1.4+1.41.0
   Compiling libz-sys v1.1.3
   Compiling curl-sys v0.4.59+curl-7.86.0
    Checking idna v0.2.0

@bors
Copy link
Contributor

bors commented Jan 26, 2023

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

@Noratrieb Noratrieb 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 Jan 30, 2023
@Noratrieb
Copy link
Member Author

Closing because I don't plan on working on it, but I'll leave the branch up if someone wants to continue where I left off.

@Noratrieb Noratrieb closed this Feb 13, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2023
…tion, r=estebank

Remove type ascription from parser and diagnostics

Mostly based on rust-lang#106826

Part of rust-lang#101728

r? `@estebank`
RalfJung pushed a commit to RalfJung/miri that referenced this pull request May 3, 2023
…stebank

Remove type ascription from parser and diagnostics

Mostly based on rust-lang/rust#106826

Part of #101728

r? `@estebank`
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2023
…stebank

Remove type ascription from parser and diagnostics

Mostly based on rust-lang/rust#106826

Part of #101728

r? `@estebank`
calebcartwright pushed a commit to calebcartwright/rustfmt that referenced this pull request Jun 20, 2023
…stebank

Remove type ascription from parser and diagnostics

Mostly based on rust-lang/rust#106826

Part of #101728

r? `@estebank`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants