Skip to content

regression: hard error on ? in type #94510

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum

Crater picked up this issue in:

[INFO] [stdout] error: invalid `?` in type
[INFO] [stdout]   --> src/tests.rs:65:26
[INFO] [stdout]    |
[INFO] [stdout] 65 |     let foo = fn_expr!{ o?.when(|&i| i > 0)?.when(|&i| i%2 == 0) };
[INFO] [stdout]    |                          ^ `?` is only allowed on expressions, not types
[INFO] [stdout]    |
[INFO] [stdout] help: if you meant to express that the type might not contain a value, use the `Option` wrapper type
[INFO] [stdout]    |
[INFO] [stdout] 65 |     let foo = fn_expr!{ Option<o>.when(|&i| i > 0)?.when(|&i| i%2 == 0) };
[INFO] [stdout]    |                         +++++++ ~
[INFO] [stdout] 

cc @estebank likely introduced by #92746

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions