This mapping has 1 multi-map group: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

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

1use anyhow::{Context, Result};
2use rustc_hash::FxHashSet;
3use turbo_tasks::{OperationVc, ResolvedVc, TryFlatJoinIterExt, Vc};
4
5use crate::{
6 module::{Module, Modules},
7 module_graph::{GraphTraversalAction, ModuleGraph, ModuleGraphLayer},
8};
9
10#[turbo_tasks::value(transparent)]
11pub struct ModulesSet(FxHashSet<ResolvedVc<Box<dyn Module>>>);
12
13/// This lists all the modules that are async (self or transitively because they reference another
14/// module in this list).
15#[turbo_tasks::value(transparent)]
16pub struct AsyncModulesInfo(FxHashSet<ResolvedVc<Box<dyn Module>>>);
17
18#[turbo_tasks::value_impl]
19impl AsyncModulesInfo {
20 #[turbo_tasks::function]
21 pub fn is_async(&self, module: ResolvedVc<Box<dyn Module>>) -> Vc<bool> {
22 Vc::cell(self.0.contains(&module))
23 }
24
25 #[turbo_tasks::function]
26 pub async fn is_async_multiple(&self, modules: ResolvedVc<Modules>) -> Result<Vc<ModulesSet>> {
27 Ok(Vc::cell(
28 modules
29 .await?
30 .iter()
31 .copied()
32 .filter(|m| self.0.contains(m))
33 .collect(),
34 ))
35 }
36}
37
38#[turbo_tasks::function(operation)]
39pub async fn compute_async_module_info(
40 graphs: ResolvedVc<ModuleGraph>,
41) -> Result<Vc<AsyncModulesInfo>> {
…lines 42–117 unchanged (76 lines)

After

1use anyhow::{Context, Result};
2use rustc_hash::FxHashSet;
3use turbo_tasks::{OperationVc, ResolvedVc, TryFlatJoinIterExt, Vc};
4
5use crate::{
6 module::Module,
7 module_graph::{GraphTraversalAction, ModuleGraph, ModuleGraphLayer},
8};
9
10#[turbo_tasks::value(transparent)]
11pub struct ModulesSet(FxHashSet<ResolvedVc<Box<dyn Module>>>);
12
13/// This lists all the modules that are async (self or transitively because they reference another
14/// module in this list).
15#[turbo_tasks::value(transparent, cell = "keyed")]
16pub struct AsyncModulesInfo(FxHashSet<ResolvedVc<Box<dyn Module>>>);
17
18impl AsyncModulesInfo {
19 pub async fn is_async(self: Vc<Self>, module: ResolvedVc<Box<dyn Module>>) -> Result<bool> {
20 self.contains_key(&module).await
21 }
22}
23
24#[turbo_tasks::function(operation)]
25pub async fn compute_async_module_info(
26 graphs: ResolvedVc<ModuleGraph>,
27) -> Result<Vc<AsyncModulesInfo>> {
28 // Layout segment optimization, we can individually compute the async modules for each graph.
…lines 29–103 unchanged (75 lines)

Before

source_file
use_declaration
use "use"
scoped_use_list
identifier "anyhow"
:: "::"
use_list
{ "{"
identifier "Context"
, ","
identifier "Result"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "rustc_hash"
:: "::"
identifier "FxHashSet"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "turbo_tasks"
:: "::"
use_list
{ "{"
identifier "OperationVc"
, ","
identifier "ResolvedVc"
, ","
identifier "TryFlatJoinIterExt"
, ","
identifier "Vc"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
scoped_use_list
identifier "module"
:: "::"
use_list
{ "{"
identifier "Module"
, ","
identifier "Modules"
} "}"
, ","
scoped_use_list
identifier "module_graph"
:: "::"
use_list
{ "{"
identifier "GraphTraversalAction"
, ","
identifier "ModuleGraph"
, ","
identifier "ModuleGraphLayer"
} "}"
, ","
} "}"
; ";"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "value"
token_tree
( "("
identifier "transparent"
) ")"
] "]"
struct_item (+27 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This lists all the modules that are async (self or transiti"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " module in this list).\n"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "value"
token_tree
( "("
identifier "transparent"
) ")"
] "]"
struct_item (+27 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "value_impl"
] "]"
impl_item
impl "impl"
type_identifier "AsyncModulesInfo"
declaration_list
{ "{"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "function"
] "]"
function_item
visibility_modifier
pub "pub"
fn "fn"
identifier "is_async"
parameters
( "("
self_parameter
& "&"
self "self"
, ","
parameter
identifier "module"
: ":"
generic_type
type_identifier "ResolvedVc"
type_arguments
< "<"
generic_type
type_identifier "Box"
type_arguments
< "<"
dynamic_type
dyn "dyn"
type_identifier "Module"
> ">"
> ">"
) ")"
-> "->"
generic_type
type_identifier "Vc"
type_arguments
< "<"
primitive_type "bool"
> ">"
block
{ "{"
call_expression
scoped_identifier
identifier "Vc"
:: "::"
identifier "cell"
arguments
( "("
call_expression
field_expression any 2:1
field_expression any 2:1
self "self"
. "."
integer_literal "0"
. "."
field_identifier "contains"
arguments
( "("
reference_expression
& "&"
identifier "module"
) ")"
) ")"
} "}"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "function"
] "]"
function_item
visibility_modifier
pub "pub"
function_modifiers
async "async"
fn "fn"
identifier "is_async_multiple"
parameters
( "("
self_parameter
& "&"
self "self"
, ","
parameter
identifier "modules"
: ":"
generic_type
type_identifier "ResolvedVc"
type_arguments
< "<"
type_identifier "Modules"
> ">"
) ")"
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
generic_type
type_identifier "Vc"
type_arguments
< "<"
type_identifier "ModulesSet"
> ">"
> ">"
block
{ "{"
call_expression
identifier "Ok"
arguments
( "("
call_expression
scoped_identifier
identifier "Vc"
:: "::"
identifier "cell"
arguments
( "("
call_expression
field_expression
call_expression
field_expression
call_expression
field_expression
call_expression
field_expression
try_expression
await_expression
identifier "modules"
. "."
await "await"
? "?"
. "."
field_identifier "iter"
arguments
( "("
) ")"
. "."
field_identifier "copied"
arguments
( "("
) ")"
. "."
field_identifier "filter"
arguments
( "("
closure_expression
closure_parameters
| "|"
identifier "m"
| "|"
call_expression
field_expression
field_expression
self "self"
. "."
integer_literal "0"
. "."
field_identifier "contains"
arguments
( "("
identifier "m"
) ")"
) ")"
. "."
field_identifier "collect"
arguments
( "("
) ")"
, ","
) ")"
) ")"
} "}"
} "}"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "function"
token_tree
( "("
identifier "operation"
) ")"
] "]"
function_item (+111 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "function"
token_tree
( "("
identifier "operation"
) ")"
] "]"
function_item (+487 nodes collapsed)

After

source_file
use_declaration
use "use"
scoped_use_list
identifier "anyhow"
:: "::"
use_list
{ "{"
identifier "Context"
, ","
identifier "Result"
} "}"
; ";"
use_declaration
use "use"
scoped_identifier
identifier "rustc_hash"
:: "::"
identifier "FxHashSet"
; ";"
use_declaration
use "use"
scoped_use_list
identifier "turbo_tasks"
:: "::"
use_list
{ "{"
identifier "OperationVc"
, ","
identifier "ResolvedVc"
, ","
identifier "TryFlatJoinIterExt"
, ","
identifier "Vc"
} "}"
; ";"
use_declaration
use "use"
scoped_use_list
crate "crate"
:: "::"
use_list
{ "{"
scoped_identifier
identifier "module"
:: "::"
identifier "Module"
, ","
scoped_use_list
identifier "module_graph"
:: "::"
use_list
{ "{"
identifier "GraphTraversalAction"
, ","
identifier "ModuleGraph"
, ","
identifier "ModuleGraphLayer"
} "}"
, ","
} "}"
; ";"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "value"
token_tree
( "("
identifier "transparent"
) ")"
] "]"
struct_item (+27 nodes collapsed)
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " This lists all the modules that are async (self or transiti"...
line_comment
// "//"
outer_doc_comment_marker
/ "/"
doc_comment " module in this list).\n"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "value"
token_tree
( "("
identifier "transparent"
, ","
identifier "cell"
= "="
string_literal
" "\""
string_content "keyed"
" "\""
) ")"
] "]"
struct_item (+27 nodes collapsed)
impl_item
impl "impl"
type_identifier "AsyncModulesInfo"
declaration_list
{ "{"
function_item
visibility_modifier
pub "pub"
function_modifiers
async "async"
fn "fn"
identifier "is_async"
parameters
( "("
parameter
self "self"
: ":"
generic_type
type_identifier "Vc"
type_arguments
< "<"
type_identifier "Self"
> ">"
, ","
parameter
identifier "module"
: ":"
generic_type
type_identifier "ResolvedVc"
type_arguments
< "<"
generic_type
type_identifier "Box"
type_arguments
< "<"
dynamic_type
dyn "dyn"
type_identifier "Module"
> ">"
> ">"
) ")"
-> "->"
generic_type
type_identifier "Result"
type_arguments
< "<"
primitive_type "bool"
> ">"
block
{ "{"
await_expression
call_expression
field_expression any 2:1
self "self"
. "."
field_identifier "contains_key"
arguments
( "("
reference_expression
& "&"
identifier "module"
) ")"
. "."
await "await"
} "}"
} "}"
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "function"
token_tree
( "("
identifier "operation"
) ")"
] "]"
function_item (+111 nodes collapsed)
attribute_item
# "#"
[ "["
attribute
scoped_identifier
identifier "turbo_tasks"
:: "::"
identifier "function"
token_tree
( "("
identifier "operation"
) ")"
] "]"
function_item (+487 nodes collapsed)