Skip to content

"help: consider removing" yields an empty suggestion #94192

Closed
@Patryk27

Description

@Patryk27

Hii! 👋

Given the following code:

struct Wrapper<T>(T);

fn foo<T>(foo: Wrapper<T>)
where
    T: ?Sized
{
    //
}

(playground link)

The current output is (there are more messages, but focusing on the only problematic one):

help: consider removing the `?Sized` bound to make the type parameter `Sized`
  |

  |

The suggestion works correctly when the bound is represented as fn foo<T: ?Sized>:

help: consider removing the `?Sized` bound to make the type parameter `Sized`
  |
3 - fn foo<T: ?Sized>(foo: Wrapper<T>) {
3 + fn foo<T>(foo: Wrapper<T>) {
  | 

Checked on current stable, beta & nightly.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions