mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Diagnose private fields in record constructor
This commit is contained in:
parent
c405509f2e
commit
55c75450fb
6 changed files with 84 additions and 27 deletions
|
@ -1505,9 +1505,9 @@ impl DefWithBody {
|
|||
let expr_syntax = |expr| source_map.expr_syntax(expr).expect("unexpected synthetic");
|
||||
for d in &infer.diagnostics {
|
||||
match d {
|
||||
&hir_ty::InferenceDiagnostic::NoSuchField { expr } => {
|
||||
&hir_ty::InferenceDiagnostic::NoSuchField { expr, private } => {
|
||||
let field = source_map.field_syntax(expr);
|
||||
acc.push(NoSuchField { field }.into())
|
||||
acc.push(NoSuchField { field, private }.into())
|
||||
}
|
||||
&hir_ty::InferenceDiagnostic::MismatchedArgCount { call_expr, expected, found } => {
|
||||
acc.push(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue