Clarify the usage-of-qualified-ty
error message.
I found this message confusing when I encountered it. This commit makes it clearer that you have to import the unqualified type yourself.
This commit is contained in:
parent
84322efad5
commit
696d5034b2
@ -108,7 +108,7 @@ fn check_ty(&mut self, cx: &LateContext<'_>, ty: &'tcx Ty<'tcx>) {
|
||||
lint.build(&format!("usage of qualified `ty::{}`", t))
|
||||
.span_suggestion(
|
||||
path.span,
|
||||
"try using it unqualified",
|
||||
"try importing it and using it unqualified",
|
||||
t,
|
||||
// The import probably needs to be changed
|
||||
Applicability::MaybeIncorrect,
|
||||
|
@ -2,7 +2,7 @@ error: usage of qualified `ty::Ty<'_>`
|
||||
--> $DIR/qualified_ty_ty_ctxt.rs:25:11
|
||||
|
|
||||
LL | ty_q: ty::Ty<'_>,
|
||||
| ^^^^^^^^^^ help: try using it unqualified: `Ty<'_>`
|
||||
| ^^^^^^^^^^ help: try importing it and using it unqualified: `Ty<'_>`
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/qualified_ty_ty_ctxt.rs:4:9
|
||||
@ -14,7 +14,7 @@ error: usage of qualified `ty::TyCtxt<'_>`
|
||||
--> $DIR/qualified_ty_ty_ctxt.rs:27:16
|
||||
|
|
||||
LL | ty_ctxt_q: ty::TyCtxt<'_>,
|
||||
| ^^^^^^^^^^^^^^ help: try using it unqualified: `TyCtxt<'_>`
|
||||
| ^^^^^^^^^^^^^^ help: try importing it and using it unqualified: `TyCtxt<'_>`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user