Skip to content

TyCtxt::variances_of is misdocumented as applying to a generic parameter #133494

Closed
@btj

Description

@btj

Location

https://doc.rust-lang.org/beta/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.variances_of

Summary

This method returns the variances of the generic parameters of the struct with the given def_id. Contrary to what the documentation suggests, when given the def_id of a generic parameter of a struct, it returns an empty slice.

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-varianceArea: Variance (https://doc.rust-lang.org/nomicon/subtyping.html)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