Skip to content

Commit 291b8fd

Browse files
authored
[book] fix the trait checking example code (#14908)
Fix the argument in the example for "Trait Checking". changelog: none
2 parents a31d3b0 + 402fc81 commit 291b8fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

book/src/development/trait_checking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use rustc_span::symbol::sym;
2525
impl LateLintPass<'_> for CheckIteratorTraitLint {
2626
fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
2727
let implements_iterator = cx.tcx.get_diagnostic_item(sym::Iterator).map_or(false, |id| {
28-
implements_trait(cx, cx.typeck_results().expr_ty(arg), id, &[])
28+
implements_trait(cx, cx.typeck_results().expr_ty(expr), id, &[])
2929
});
3030
if implements_iterator {
3131
// [...]

0 commit comments

Comments
 (0)