File tree 1 file changed +14
-2
lines changed
src/tools/rust-analyzer/crates/proc-macro-srv/proc-macro-test
1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,24 @@ fn main() {
92
92
panic ! ( "proc-macro-test-impl failed to build" ) ;
93
93
}
94
94
95
+ // Old Package ID Spec
96
+ let repr = format ! ( "{name} {version}" ) ;
97
+ // New Package Id Spec since rust-lang/cargo#13311
98
+ let pkgid = String :: from_utf8 (
99
+ Command :: new ( toolchain:: cargo ( ) )
100
+ . current_dir ( & staging_dir)
101
+ . args ( [ "pkgid" , name] )
102
+ . output ( )
103
+ . unwrap ( ) . stdout ,
104
+ )
105
+ . unwrap ( ) ;
106
+ let pkgid = pkgid. trim ( ) ;
107
+
95
108
let mut artifact_path = None ;
96
109
for message in Message :: parse_stream ( output. stdout . as_slice ( ) ) {
97
110
if let Message :: CompilerArtifact ( artifact) = message. unwrap ( ) {
98
111
if artifact. target . kind . contains ( & "proc-macro" . to_string ( ) ) {
99
- let repr = format ! ( "{name} {version}" ) ;
100
- if artifact. package_id . repr . starts_with ( & repr) {
112
+ if artifact. package_id . repr . starts_with ( & repr) || artifact. package_id . repr == pkgid {
101
113
artifact_path = Some ( PathBuf :: from ( & artifact. filenames [ 0 ] ) ) ;
102
114
}
103
115
}
You can’t perform that action at this time.
0 commit comments