Diagnostic
cleanups
- `emitted_at` isn't used outside the crate. - `code` and `messages` are public fields, so there's no point have trivial getters/setters for them. - `suggestions` is public, so the comment about "functionality on `Diagnostic`" isn't needed.
This commit is contained in:
parent
585367f15f
commit
a9a2e1565a
7 changed files with 9 additions and 26 deletions
|
@ -195,7 +195,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
|
|||
}
|
||||
}
|
||||
diag.help("type parameters must be constrained to match other types");
|
||||
if tcx.sess.teach(diag.get_code().unwrap()) {
|
||||
if tcx.sess.teach(diag.code.unwrap()) {
|
||||
diag.help(
|
||||
"given a type parameter `T` and a method `foo`:
|
||||
```
|
||||
|
@ -678,7 +678,7 @@ impl<T> Trait<T> for X {
|
|||
https://doc.rust-lang.org/book/ch19-03-advanced-traits.html",
|
||||
);
|
||||
}
|
||||
if tcx.sess.teach(diag.get_code().unwrap()) {
|
||||
if tcx.sess.teach(diag.code.unwrap()) {
|
||||
diag.help(
|
||||
"given an associated type `T` and a method `foo`:
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue