File tree Expand file tree Collapse file tree 6 files changed +15
-5
lines changed Expand file tree Collapse file tree 6 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,12 @@ async fn resolve_queries_impl(
174
174
) )
175
175
}
176
176
177
- anyhow:: Ok ( ( query. to_owned ( ) , Arc :: new ( query_results) ) )
177
+ anyhow:: Ok ( (
178
+ query. to_owned ( ) ,
179
+ Arc :: new ( AnalysisQueryResult {
180
+ result : query_results,
181
+ } ) ,
182
+ ) )
178
183
}
179
184
} ) )
180
185
. await ?;
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ pub fn resolve_query<'v>(
148
148
match query_results. get ( query) {
149
149
None => Err ( anyhow:: anyhow!( AnalysisError :: MissingQuery ( query. to_owned( ) ) ) . into ( ) ) ,
150
150
Some ( x) => {
151
- for ( _, y) in x. iter ( ) {
151
+ for ( _, y) in x. result . iter ( ) {
152
152
// IMPORTANT: Anything given back to the user must be kept alive
153
153
module. frozen_heap ( ) . add_reference ( y. value ( ) . owner ( ) ) ;
154
154
}
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ impl ConfiguredQueryMacroBaseExt for QueryMacroBase<ConfiguredProvidersLabel> {
30
30
match & self . expansion_type {
31
31
QueryExpansion :: Output => Ok ( ResolvedQueryMacro :: Outputs (
32
32
query_result
33
+ . result
33
34
. iter ( )
34
35
. map ( |( _, providers) | {
35
36
providers
@@ -42,6 +43,7 @@ impl ConfiguredQueryMacroBaseExt for QueryMacroBase<ConfiguredProvidersLabel> {
42
43
) ) ,
43
44
QueryExpansion :: Target => Ok ( ResolvedQueryMacro :: Targets (
44
45
query_result
46
+ . result
45
47
. iter ( )
46
48
. map ( |( target, _) | target. dupe ( ) )
47
49
. collect ( ) ,
@@ -54,6 +56,7 @@ impl ConfiguredQueryMacroBaseExt for QueryMacroBase<ConfiguredProvidersLabel> {
54
56
None => " " . to_owned ( ) . into_boxed_str ( ) ,
55
57
} ,
56
58
list : query_result
59
+ . result
57
60
. iter ( )
58
61
. map ( |( target, providers) | {
59
62
(
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ impl ConfiguredQueryAttrExt for QueryAttr<ConfiguredProvidersLabel> {
26
26
let query_results = ctx. resolve_query ( & self . query . query ) ?;
27
27
let mut dependencies = Vec :: new ( ) ;
28
28
29
- for ( target, providers) in & * query_results {
29
+ for ( target, providers) in & query_results. result {
30
30
let providers_label =
31
31
ConfiguredProvidersLabel :: new ( target. dupe ( ) , ProvidersName :: Default ) ;
32
32
if !self . providers . is_empty ( ) {
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ use buck2_core::target::configured_target_label::ConfiguredTargetLabel;
17
17
use starlark:: environment:: Module ;
18
18
use starlark:: values:: Heap ;
19
19
20
- pub type AnalysisQueryResult = Vec < ( ConfiguredTargetLabel , FrozenProviderCollectionValue ) > ;
20
+ pub struct AnalysisQueryResult {
21
+ pub result : Vec < ( ConfiguredTargetLabel , FrozenProviderCollectionValue ) > ,
22
+ }
21
23
22
24
/// The context for attribute resolution. Provides access to the providers from
23
25
/// dependents.
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ impl AuditSubcommand for AuditAnalysisQueriesCommand {
73
73
writeln ! ( stdout, "{}:" , label) ?;
74
74
for ( query, result) in & query_results {
75
75
writeln ! ( stdout, " {}" , query) ?;
76
- for ( target, providers) in & * * result {
76
+ for ( target, providers) in & result . result {
77
77
writeln ! ( stdout, " {}" , target. unconfigured( ) ) ?;
78
78
if self . include_outputs {
79
79
let outputs = providers
You can’t perform that action at this time.
0 commit comments