about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-30 11:34:24 +0000
committerbors <bors@rust-lang.org>2021-12-30 11:34:24 +0000
commitf8d4ee7c7adcea52dfc62328309f5ef7df000266 (patch)
treeeb49cc73ccf46fca54c4860a86be5e241eebe9f9 /src/librustdoc/html/static/js/source-script.js
parent65d8785f0a85d233e00fc84445f1aab451ec9f4f (diff)
parentb15cb29a4a0625afeac07fbf3ab02b63c51ad317 (diff)
downloadrust-f8d4ee7c7adcea52dfc62328309f5ef7df000266.tar.gz
rust-f8d4ee7c7adcea52dfc62328309f5ef7df000266.zip
Auto merge of #89336 - Aaron1011:variance-struct-diag, r=cjgillot
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