@@ -52,17 +52,21 @@ def _rust_analyzer_aspect_impl(target, ctx):
52
52
if hasattr (ctx .rule .attr , "rustc_flags" ):
53
53
cfgs += [f [6 :] for f in ctx .rule .attr .rustc_flags if f .startswith ("--cfg " ) or f .startswith ("--cfg=" )]
54
54
55
- # Save BuildInfo if we find any (for build script output)
56
55
build_info = None
57
- for dep in ctx .rule .attr .deps :
58
- if BuildInfo in dep :
59
- build_info = dep [BuildInfo ]
56
+ dep_infos = []
57
+ if hasattr (ctx .rule .attr , "deps" ):
58
+ for dep in ctx .rule .attr .deps :
59
+ # Save BuildInfo if we find any (for build script output)
60
+ if BuildInfo in dep :
61
+ build_info = dep [BuildInfo ]
62
+ dep_infos = [dep [RustAnalyzerInfo ] for dep in ctx .rule .attr .deps if RustAnalyzerInfo in dep ]
60
63
61
- dep_infos = [dep [RustAnalyzerInfo ] for dep in ctx .rule .attr .deps if RustAnalyzerInfo in dep ]
62
64
if hasattr (ctx .rule .attr , "proc_macro_deps" ):
63
65
dep_infos += [dep [RustAnalyzerInfo ] for dep in ctx .rule .attr .proc_macro_deps if RustAnalyzerInfo in dep ]
64
66
if hasattr (ctx .rule .attr , "crate" ) and ctx .rule .attr .crate != None :
65
67
dep_infos .append (ctx .rule .attr .crate [RustAnalyzerInfo ])
68
+ if hasattr (ctx .rule .attr , "actual" ) and ctx .rule .attr .actual != None and RustAnalyzerInfo in ctx .rule .attr .actual :
69
+ dep_infos .append (ctx .rule .attr .actual [RustAnalyzerInfo ])
66
70
67
71
crate_spec = ctx .actions .declare_file (ctx .label .name + ".rust_analyzer_crate_spec" )
68
72
@@ -111,7 +115,7 @@ def find_proc_macro_dylib_path(toolchain, target):
111
115
return None
112
116
113
117
rust_analyzer_aspect = aspect (
114
- attr_aspects = ["deps" , "proc_macro_deps" , "crate" ],
118
+ attr_aspects = ["deps" , "proc_macro_deps" , "crate" , "actual" ],
115
119
implementation = _rust_analyzer_aspect_impl ,
116
120
toolchains = [str (Label ("//rust:toolchain" ))],
117
121
incompatible_use_toolchain_transition = True ,
0 commit comments