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

regression: generic args in patterns require the turbofish syntax #115780

Closed
Mark-Simulacrum opened this issue Sep 12, 2023 · 6 comments
Closed
Assignees
Labels
A-parser Area: The parsing of Rust source code to an AST P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum
Copy link
Member

[INFO] [stdout] error: generic args in patterns require the turbofish syntax
[INFO] [stdout]    --> src/lib.rs:142:16
[INFO] [stdout]     |
[INFO] [stdout] 142 |             ret<TCon> (Clone::clone(x_val), Clone::clone(y_val));
[INFO] [stdout]     |                ^
[INFO] [stdout]     |
[INFO] [stdout]    ::: src/mdo.rs:19:9
[INFO] [stdout]     |
[INFO] [stdout] 19  |         $p: pat =<< $e: expr ; $( $t: tt )*
[INFO] [stdout]     |         ------- while parsing argument for this `pat` macro fragment
[INFO] [stdout]     |
[INFO] [stdout] help: use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
[INFO] [stdout]     |
[INFO] [stdout] 142 |             ret::<TCon> (Clone::clone(x_val), Clone::clone(y_val));
[INFO] [stdout]     |                ++
[INFO] [stdout] 
[INFO] [stdout] 

https://crater-reports.s3.amazonaws.com/beta-1.73-1.2/beta-2023-09-10/reg/haskell_bits-0.3.0/log.txt

@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Sep 12, 2023
@Mark-Simulacrum Mark-Simulacrum added this to the 1.73.0 milestone Sep 12, 2023
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 12, 2023
@Mark-Simulacrum Mark-Simulacrum removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 12, 2023
@fmease
Copy link
Member

fmease commented Sep 12, 2023

I assume it regressed in #114300 @mu001999

@fmease
Copy link
Member

fmease commented Sep 12, 2023

I think it just needs a .may_recover()

@fmease fmease self-assigned this Sep 12, 2023
@fmease fmease added the A-parser Area: The parsing of Rust source code to an AST label Sep 12, 2023
@fmease
Copy link
Member

fmease commented Sep 12, 2023

Minimized:

macro_rules! mdo {
    ($p: pat =<< $e: expr ; $( $t: tt )*) => {
        $e.and_then(|$p| mdo! { $( $t )* })
    };
    (ret<$ty: ty> $e: expr;) => { Some::<$ty>($e) };
}

fn main() {
    mdo! {
        x_val =<< Some(0);
        y_val =<< Some(1);
        ret<(i32, i32)> (x_val, y_val);
    };
}

@fmease fmease added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Sep 12, 2023
@Noratrieb
Copy link
Member

cc @estebank

bors added a commit to rust-lang-ci/rust that referenced this issue Sep 13, 2023
…iser

Only suggest turbofish in patterns if we may recover

Fixes [after backport] rust-lang#115780.

CC rust-lang#103534.
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-high

@rustbot rustbot added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 13, 2023
@fmease
Copy link
Member

fmease commented Sep 18, 2023

The fix #115785 has been backported to beta in #115901. Closing.

@fmease fmease closed this as completed Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants