about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-07-18 23:05:22 +0200
committerGitHub <noreply@github.com>2024-07-18 23:05:22 +0200
commit65de5d0472f0eef191892f006b9b366212185aed (patch)
treeb9eb06fb766d656a2de5ee3ff4088e067c848fec /compiler/rustc_pattern_analysis/src/errors.rs
parent4d5ba0d2c707065bcd8488f3687be94f8fa871ec (diff)
parentc02d0de871a99b08d013bd79941889fca53ae3c4 (diff)
downloadrust-65de5d0472f0eef191892f006b9b366212185aed.tar.gz
rust-65de5d0472f0eef191892f006b9b366212185aed.zip
Rollup merge of #127871 - compiler-errors:recursive, r=estebank
Mention that type parameters are used recursively on bivariance error

Right now when a type parameter is used recursively, even with indirection (so it has a finite size) we say that the type parameter is unused:

```
struct B<T>(Box<B<T>>);
```

This is confusing, because the type parameter is *used*, it just doesn't have its variance constrained. This PR tweaks that message to mention that it must be used *non-recursively*.

Not sure if we should actually mention "variance" here, but also I'd somewhat prefer we don't keep the power users in the dark w.r.t the real underlying issue, which is that the variance isn't constrained. That technical detail is reserved for a note, though.

cc `@fee1-dead`

Fixes #118976
Fixes #26283
Fixes #53191
Fixes #105740
Fixes #110466
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/errors.rs')
0 files changed, 0 insertions, 0 deletions