Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–195 unchanged (195 lines)
196 // non-local items are skipped because they can be out of the users control,
197 // especially in the case of trait impls, which rustdoc eagerly inlines
198 return;
199 }
200
201 match i.kind {
202 clean::StrippedItem(..) => {
203 // don't count items in stripped modules
204 return;
205 }
206 // docs on `use` and `extern crate` statements are not displayed, so they're not
207 // worth counting
208 clean::ImportItem(..) | clean::ExternCrateItem { .. } => {}
…lines 209–275 unchanged (67 lines)

After

…lines 1–195 unchanged (195 lines)
196 // non-local items are skipped because they can be out of the users control,
197 // especially in the case of trait impls, which rustdoc eagerly inlines
198 return;
199 }
200
201 match i.kind {
202 clean::StrippedItem(..) | clean::PlaceholderImplItem => {
203 // don't count items in stripped modules
204 return;
205 }
206 // docs on `use` and `extern crate` statements are not displayed, so they're not
207 // worth counting
208 clean::ImportItem(..) | clean::ExternCrateItem { .. } => {}
…lines 209–275 unchanged (67 lines)

Before

source_file
line_comment
// "//"
inner_doc_comment_marker
! "!"
doc_comment " Calculates information used for the --show-coverage flag.\n"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "collections"
:: "::"
identifier "BTreeMap"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "std"
:: "::"
identifier "ops"
; ";"
use_declaration
use "use"
use_as_clause
identifier "rustc_hir"
as "as"
identifier "hir"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_lint"
:: "::"
identifier "builtin"
:: "::"
identifier "MISSING_DOCS"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "lint"
:: "::"
use_list
{ "{"
identifier "LevelAndSource"
, ","
identifier "LintLevelSource"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "rustc_session"
:: "::"
identifier "lint"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "rustc_span"
:: "::"
use_list
{ "{"
identifier "FileName"
, ","
identifier "RemapPathScopeComponents"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "serde"
:: "::"
identifier "Serialize"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "tracing"
:: "::"
identifier "debug"
; ";"
use_declaration
use "use"
scoped_identifier
crate "crate"
:: "::"
identifier "clean"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "core"
:: "::"
identifier "DocContext"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "html"
:: "::"
identifier "markdown"
:: "::"
use_list
{ "{"
identifier "ErrorCodes"
, ","
identifier "find_testable_code"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "passes"
:: "::"
identifier "Pass"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "passes"
:: "::"
identifier "check_doc_test_visibility"
:: "::"
use_list
{ "{"
identifier "Tests"
, ","
identifier "should_have_doc_example"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "visit"
:: "::"
identifier "DocVisitor"
; ";"
const_item (+43 nodes collapsed)
function_item (+85 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Default"
, ","
identifier "Copy"
, ","
identifier "Clone"
, ","
identifier "Serialize"
, ","
identifier "Debug"
) ")"
] "]"
struct_item (+26 nodes collapsed)
impl_item (+240 nodes collapsed)
impl_item (+96 nodes collapsed)
impl_item (+77 nodes collapsed)
struct_item (+48 nodes collapsed)
function_item (+115 nodes collapsed)
impl_item (+506 nodes collapsed)
impl_item
impl "impl"
generic_type
type_identifier "DocVisitor"
type_arguments
< "<"
lifetime
' "'"
identifier "_"
> ">"
for "for"
generic_type
type_identifier "CoverageCalculator"
type_arguments
< "<"
lifetime
' "'"
identifier "_"
, ","
lifetime
' "'"
identifier "_"
> ">"
declaration_list
{ "{"
function_item
fn "fn"
identifier "visit_item"
parameters
( "("
self_parameter
& "&"
mutable_specifier "mut"
self "self"
, ","
parameter
identifier "i"
: ":"
reference_type
& "&"
scoped_type_identifier
identifier "clean"
:: "::"
type_identifier "Item"
) ")"
block
{ "{"
expression_statement (+27 nodes collapsed)
expression_statement
match_expression
match "match"
field_expression
identifier "i"
. "."
field_identifier "kind"
match_block
{ "{"
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "clean"
:: "::"
identifier "StrippedItem"
( "("
remaining_field_pattern
.. ".."
) ")"
=> "=>"
block
{ "{"
line_comment
// "//"
expression_statement
return_expression
return "return"
; ";"
} "}"
line_comment
// "//"
line_comment
// "//"
match_arm (+26 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "clean"
:: "::"
identifier "ImplItem"
( "("
_ "_"
) ")"
=> "=>"
block
{ "{"
} "}"
match_arm (+510 nodes collapsed)
} "}"
call_expression
field_expression
self "self"
. "."
field_identifier "visit_item_recur"
arguments
( "("
identifier "i"
) ")"
} "}"
} "}"

After

source_file
line_comment
// "//"
inner_doc_comment_marker
! "!"
doc_comment " Calculates information used for the --show-coverage flag.\n"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "std"
:: "::"
identifier "collections"
:: "::"
identifier "BTreeMap"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "std"
:: "::"
identifier "ops"
; ";"
use_declaration
use "use"
use_as_clause
identifier "rustc_hir"
as "as"
identifier "hir"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
identifier "rustc_lint"
:: "::"
identifier "builtin"
:: "::"
identifier "MISSING_DOCS"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
identifier "rustc_middle"
:: "::"
identifier "lint"
:: "::"
use_list
{ "{"
identifier "LevelAndSource"
, ","
identifier "LintLevelSource"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "rustc_session"
:: "::"
identifier "lint"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "rustc_span"
:: "::"
use_list
{ "{"
identifier "FileName"
, ","
identifier "RemapPathScopeComponents"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "serde"
:: "::"
identifier "Serialize"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "tracing"
:: "::"
identifier "debug"
; ";"
use_declaration
use "use"
scoped_identifier
crate "crate"
:: "::"
identifier "clean"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "core"
:: "::"
identifier "DocContext"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "html"
:: "::"
identifier "markdown"
:: "::"
use_list
{ "{"
identifier "ErrorCodes"
, ","
identifier "find_testable_code"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "passes"
:: "::"
identifier "Pass"
; ";"
use_declaration
use "use"
scoped_use_list
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "passes"
:: "::"
identifier "check_doc_test_visibility"
:: "::"
use_list
{ "{"
identifier "Tests"
, ","
identifier "should_have_doc_example"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
scoped_identifier
crate "crate"
:: "::"
identifier "visit"
:: "::"
identifier "DocVisitor"
; ";"
const_item (+43 nodes collapsed)
function_item (+85 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
identifier "derive"
token_tree
( "("
identifier "Default"
, ","
identifier "Copy"
, ","
identifier "Clone"
, ","
identifier "Serialize"
, ","
identifier "Debug"
) ")"
] "]"
struct_item (+26 nodes collapsed)
impl_item (+240 nodes collapsed)
impl_item (+96 nodes collapsed)
impl_item (+77 nodes collapsed)
struct_item (+48 nodes collapsed)
function_item (+115 nodes collapsed)
impl_item (+506 nodes collapsed)
impl_item
impl "impl"
generic_type
type_identifier "DocVisitor"
type_arguments
< "<"
lifetime
' "'"
identifier "_"
> ">"
for "for"
generic_type
type_identifier "CoverageCalculator"
type_arguments
< "<"
lifetime
' "'"
identifier "_"
, ","
lifetime
' "'"
identifier "_"
> ">"
declaration_list
{ "{"
function_item
fn "fn"
identifier "visit_item"
parameters
( "("
self_parameter
& "&"
mutable_specifier "mut"
self "self"
, ","
parameter
identifier "i"
: ":"
reference_type
& "&"
scoped_type_identifier
identifier "clean"
:: "::"
type_identifier "Item"
) ")"
block
{ "{"
expression_statement (+27 nodes collapsed)
expression_statement
match_expression
match "match"
field_expression
identifier "i"
. "."
field_identifier "kind"
match_block
{ "{"
match_arm
match_pattern
or_pattern
tuple_struct_pattern
scoped_identifier
identifier "clean"
:: "::"
identifier "StrippedItem"
( "("
remaining_field_pattern
.. ".."
) ")"
| "|"
scoped_identifier
identifier "clean"
:: "::"
identifier "PlaceholderImplItem"
=> "=>"
block
{ "{"
line_comment
// "//"
expression_statement
return_expression
return "return"
; ";"
} "}"
line_comment
// "//"
line_comment
// "//"
match_arm (+26 nodes collapsed)
line_comment
// "//"
line_comment
// "//"
line_comment
// "//"
match_arm
match_pattern
tuple_struct_pattern
scoped_identifier
identifier "clean"
:: "::"
identifier "ImplItem"
( "("
_ "_"
) ")"
=> "=>"
block
{ "{"
} "}"
match_arm (+510 nodes collapsed)
} "}"
call_expression
field_expression
self "self"
. "."
field_identifier "visit_item_recur"
arguments
( "("
identifier "i"
) ")"
} "}"
} "}"