about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-09-27 20:22:44 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-12-29 18:53:40 -0500
commitb15cb29a4a0625afeac07fbf3ab02b63c51ad317 (patch)
tree4aea4d39827038b5d279f9f40860b2fd5222e3da /src/librustdoc/html/static/js/source-script.js
parent78fd0f633faaa5b6dd254fc1456735f63a1b1238 (diff)
downloadrust-b15cb29a4a0625afeac07fbf3ab02b63c51ad317.tar.gz
rust-b15cb29a4a0625afeac07fbf3ab02b63c51ad317.zip
Refactor variance diagnostics to work with more types
Instead of special-casing mutable pointers/references, we
now support general generic types (currently, we handle
`ty::Ref`, `ty::RawPtr`, and `ty::Adt`)

When a `ty::Adt` is involved, we show an additional note
explaining which of the type's generic parameters is
invariant (e.g. the `T` in `Cell<T>`). Currently, we don't
explain *why* a particular generic parameter ends up becoming
invariant. In the general case, this could require printing
a long 'backtrace' of types, so doing this would be
more suitable for a follow-up PR.

We still only handle the case where our variance switches
to `ty::Invariant`.
Diffstat (limited to 'src/librustdoc/html/static/js/source-script.js')
0 files changed, 0 insertions, 0 deletions