Skip to content

Question on variance text #483

Closed
@choppsv1

Description

@choppsv1

I'm reading through the subtyping and variance chapter and the following text confused me:

Also, we saw that it was not ok for us to treat
`&mut &'a U` as a subtype of `&mut &'b U`,
therefore we can say that `&mut T` is *invariant* over `T`

Why is U introduced in the premise here and then not used in the conclusion? Shouldn't the premise just use T again, or if for some reason no, shouldn't the conclusion at least use U?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions