Skip to content

Incorrect type mismatch diagnostic between trait objects with supertrait autotrait boundΒ #18692

Open
@Veykril

Description

@Veykril
trait Trait: Send {}

fn f(_: *const (dyn Trait + Send)) {} 
fn g(it: *const (dyn Trait)) {
    f(it);
    // ^^ expected *const (dyn Trait + Send), found *const dyn Trait
}

rustc accepts this code

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-chalkchalk related issueA-tytype system / type inference / traits / method resolutionC-bugCategory: bugS-blocked-on-new-solverwill be fixed when we will switch to the new trait solver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions