Open btj opened 1 week ago
https://doc.rust-lang.org/beta/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.variances_of
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.
Good catch, feel free to submit a patch!
Small correction: ... of the *item given by the DefId [where item refers to ADTs, lazy type aliases, free and associated functions].
DefId
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.