]> git.lizzy.rs Git - rust.git/blob - src/bootstrap/builder/tests.rs
Rollup merge of #74872 - JohnTitor:ping-risc-v, r=Mark-Simulacrum
[rust.git] / src / bootstrap / builder / tests.rs
1 use super::*;
2 use crate::config::{Config, TargetSelection};
3 use std::thread;
4
5 fn configure(host: &[&str], target: &[&str]) -> Config {
6     let mut config = Config::default_opts();
7     // don't save toolstates
8     config.save_toolstates = None;
9     config.skip_only_host_steps = false;
10     config.dry_run = true;
11     // try to avoid spurious failures in dist where we create/delete each others file
12     let dir = config
13         .out
14         .join("tmp-rustbuild-tests")
15         .join(&thread::current().name().unwrap_or("unknown").replace(":", "-"));
16     t!(fs::create_dir_all(&dir));
17     config.out = dir;
18     config.build = TargetSelection::from_user("A");
19     config.hosts = vec![config.build]
20         .into_iter()
21         .chain(host.iter().map(|s| TargetSelection::from_user(s)))
22         .collect::<Vec<_>>();
23     config.targets = config
24         .hosts
25         .clone()
26         .into_iter()
27         .chain(target.iter().map(|s| TargetSelection::from_user(s)))
28         .collect::<Vec<_>>();
29     config
30 }
31
32 fn first<A, B>(v: Vec<(A, B)>) -> Vec<A> {
33     v.into_iter().map(|(a, _)| a).collect::<Vec<_>>()
34 }
35
36 mod defaults {
37     use super::{configure, first};
38     use crate::builder::*;
39     use crate::Config;
40     use pretty_assertions::assert_eq;
41
42     #[test]
43     fn build_default() {
44         let build = Build::new(configure(&[], &[]));
45         let mut builder = Builder::new(&build);
46         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
47
48         let a = TargetSelection::from_user("A");
49         assert_eq!(
50             first(builder.cache.all::<compile::Std>()),
51             &[
52                 compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
53                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
54             ]
55         );
56         assert!(!builder.cache.all::<compile::Assemble>().is_empty());
57         // Make sure rustdoc is only built once.
58         assert_eq!(
59             first(builder.cache.all::<tool::Rustdoc>()),
60             // Recall that rustdoc stages are off-by-one
61             // - this is the compiler it's _linked_ to, not built with.
62             &[tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }],
63         );
64         assert_eq!(
65             first(builder.cache.all::<compile::Rustc>()),
66             &[compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },]
67         );
68     }
69
70     #[test]
71     fn build_stage_0() {
72         let config = Config { stage: Some(0), ..configure(&[], &[]) };
73         let build = Build::new(config);
74         let mut builder = Builder::new(&build);
75         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
76
77         let a = TargetSelection::from_user("A");
78         assert_eq!(
79             first(builder.cache.all::<compile::Std>()),
80             &[compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },]
81         );
82         assert!(!builder.cache.all::<compile::Assemble>().is_empty());
83         assert_eq!(
84             first(builder.cache.all::<tool::Rustdoc>()),
85             // This is the beta rustdoc.
86             // Add an assert here to make sure this is the only rustdoc built.
87             &[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }],
88         );
89         assert!(builder.cache.all::<compile::Rustc>().is_empty());
90     }
91
92     #[test]
93     fn doc_default() {
94         let mut config = configure(&[], &[]);
95         config.compiler_docs = true;
96         config.cmd = Subcommand::Doc { paths: Vec::new(), open: false };
97         let build = Build::new(config);
98         let mut builder = Builder::new(&build);
99         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), &[]);
100         let a = TargetSelection::from_user("A");
101
102         // error_index_generator uses stage 0 to share rustdoc artifacts with the
103         // rustdoc tool.
104         assert_eq!(
105             first(builder.cache.all::<doc::ErrorIndex>()),
106             &[doc::ErrorIndex { compiler: Compiler { host: a, stage: 0 }, target: a },]
107         );
108         assert_eq!(
109             first(builder.cache.all::<tool::ErrorIndex>()),
110             &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 0 } }]
111         );
112         // docs should be built with the beta compiler, not with the stage0 artifacts.
113         // recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to,
114         // not the one it was built by.
115         assert_eq!(
116             first(builder.cache.all::<tool::Rustdoc>()),
117             &[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },]
118         );
119     }
120 }
121
122 mod dist {
123     use super::{first, Config};
124     use crate::builder::*;
125     use pretty_assertions::assert_eq;
126
127     fn configure(host: &[&str], target: &[&str]) -> Config {
128         Config { stage: Some(2), ..super::configure(host, target) }
129     }
130
131     #[test]
132     fn dist_baseline() {
133         let build = Build::new(configure(&[], &[]));
134         let mut builder = Builder::new(&build);
135         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
136
137         let a = TargetSelection::from_user("A");
138
139         assert_eq!(first(builder.cache.all::<dist::Docs>()), &[dist::Docs { host: a },]);
140         assert_eq!(first(builder.cache.all::<dist::Mingw>()), &[dist::Mingw { host: a },]);
141         assert_eq!(
142             first(builder.cache.all::<dist::Rustc>()),
143             &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },]
144         );
145         assert_eq!(
146             first(builder.cache.all::<dist::Std>()),
147             &[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },]
148         );
149         assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
150         // Make sure rustdoc is only built once.
151         assert_eq!(
152             first(builder.cache.all::<tool::Rustdoc>()),
153             &[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
154         );
155     }
156
157     #[test]
158     fn dist_with_targets() {
159         let build = Build::new(configure(&[], &["B"]));
160         let mut builder = Builder::new(&build);
161         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
162
163         let a = TargetSelection::from_user("A");
164         let b = TargetSelection::from_user("B");
165
166         assert_eq!(
167             first(builder.cache.all::<dist::Docs>()),
168             &[dist::Docs { host: a }, dist::Docs { host: b },]
169         );
170         assert_eq!(
171             first(builder.cache.all::<dist::Mingw>()),
172             &[dist::Mingw { host: a }, dist::Mingw { host: b },]
173         );
174         assert_eq!(
175             first(builder.cache.all::<dist::Rustc>()),
176             &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },]
177         );
178         assert_eq!(
179             first(builder.cache.all::<dist::Std>()),
180             &[
181                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
182                 dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
183             ]
184         );
185         assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
186     }
187
188     #[test]
189     fn dist_with_hosts() {
190         let build = Build::new(configure(&["B"], &[]));
191         let mut builder = Builder::new(&build);
192         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
193
194         let a = TargetSelection::from_user("A");
195         let b = TargetSelection::from_user("B");
196
197         assert_eq!(
198             first(builder.cache.all::<dist::Docs>()),
199             &[dist::Docs { host: a }, dist::Docs { host: b },]
200         );
201         assert_eq!(
202             first(builder.cache.all::<dist::Mingw>()),
203             &[dist::Mingw { host: a }, dist::Mingw { host: b },]
204         );
205         assert_eq!(
206             first(builder.cache.all::<dist::Rustc>()),
207             &[
208                 dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
209                 dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
210             ]
211         );
212         assert_eq!(
213             first(builder.cache.all::<dist::Std>()),
214             &[
215                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
216                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
217             ]
218         );
219         assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
220     }
221
222     #[test]
223     fn dist_only_cross_host() {
224         let a = TargetSelection::from_user("A");
225         let b = TargetSelection::from_user("B");
226         let mut build = Build::new(configure(&["B"], &[]));
227         build.config.docs = false;
228         build.config.extended = true;
229         build.hosts = vec![b];
230         let mut builder = Builder::new(&build);
231         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
232
233         assert_eq!(
234             first(builder.cache.all::<dist::Rustc>()),
235             &[dist::Rustc { compiler: Compiler { host: b, stage: 2 } },]
236         );
237         assert_eq!(
238             first(builder.cache.all::<compile::Rustc>()),
239             &[
240                 compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
241                 compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: b },
242             ]
243         );
244     }
245
246     #[test]
247     fn dist_with_targets_and_hosts() {
248         let build = Build::new(configure(&["B"], &["C"]));
249         let mut builder = Builder::new(&build);
250         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
251
252         let a = TargetSelection::from_user("A");
253         let b = TargetSelection::from_user("B");
254         let c = TargetSelection::from_user("C");
255
256         assert_eq!(
257             first(builder.cache.all::<dist::Docs>()),
258             &[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },]
259         );
260         assert_eq!(
261             first(builder.cache.all::<dist::Mingw>()),
262             &[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },]
263         );
264         assert_eq!(
265             first(builder.cache.all::<dist::Rustc>()),
266             &[
267                 dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
268                 dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
269             ]
270         );
271         assert_eq!(
272             first(builder.cache.all::<dist::Std>()),
273             &[
274                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
275                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
276                 dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },
277             ]
278         );
279         assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
280     }
281
282     #[test]
283     fn dist_with_target_flag() {
284         let mut config = configure(&["B"], &["C"]);
285         config.skip_only_host_steps = true; // as-if --target=C was passed
286         let build = Build::new(config);
287         let mut builder = Builder::new(&build);
288         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
289
290         let a = TargetSelection::from_user("A");
291         let b = TargetSelection::from_user("B");
292         let c = TargetSelection::from_user("C");
293
294         assert_eq!(
295             first(builder.cache.all::<dist::Docs>()),
296             &[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },]
297         );
298         assert_eq!(
299             first(builder.cache.all::<dist::Mingw>()),
300             &[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },]
301         );
302         assert_eq!(first(builder.cache.all::<dist::Rustc>()), &[]);
303         assert_eq!(
304             first(builder.cache.all::<dist::Std>()),
305             &[
306                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
307                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
308                 dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },
309             ]
310         );
311         assert_eq!(first(builder.cache.all::<dist::Src>()), &[]);
312     }
313
314     #[test]
315     fn dist_with_same_targets_and_hosts() {
316         let build = Build::new(configure(&["B"], &["B"]));
317         let mut builder = Builder::new(&build);
318         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
319
320         let a = TargetSelection::from_user("A");
321         let b = TargetSelection::from_user("B");
322
323         assert_eq!(
324             first(builder.cache.all::<dist::Docs>()),
325             &[dist::Docs { host: a }, dist::Docs { host: b },]
326         );
327         assert_eq!(
328             first(builder.cache.all::<dist::Mingw>()),
329             &[dist::Mingw { host: a }, dist::Mingw { host: b },]
330         );
331         assert_eq!(
332             first(builder.cache.all::<dist::Rustc>()),
333             &[
334                 dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
335                 dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
336             ]
337         );
338         assert_eq!(
339             first(builder.cache.all::<dist::Std>()),
340             &[
341                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
342                 dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
343             ]
344         );
345         assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
346         assert_eq!(
347             first(builder.cache.all::<compile::Std>()),
348             &[
349                 compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
350                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
351                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: a },
352                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
353                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
354             ]
355         );
356         assert_eq!(
357             first(builder.cache.all::<compile::Assemble>()),
358             &[
359                 compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
360                 compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
361                 compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } },
362                 compile::Assemble { target_compiler: Compiler { host: b, stage: 2 } },
363             ]
364         );
365     }
366
367     #[test]
368     fn build_all() {
369         let build = Build::new(configure(&["B"], &["C"]));
370         let mut builder = Builder::new(&build);
371         builder.run_step_descriptions(
372             &Builder::get_step_descriptions(Kind::Build),
373             &["src/rustc".into(), "library/std".into()],
374         );
375
376         let a = TargetSelection::from_user("A");
377         let b = TargetSelection::from_user("B");
378         let c = TargetSelection::from_user("C");
379
380         assert_eq!(
381             first(builder.cache.all::<compile::Std>()),
382             &[
383                 compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
384                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
385                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: a },
386                 compile::Std { compiler: Compiler { host: b, stage: 2 }, target: a },
387                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
388                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
389                 compile::Std { compiler: Compiler { host: b, stage: 2 }, target: b },
390                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: c },
391                 compile::Std { compiler: Compiler { host: b, stage: 2 }, target: c },
392             ]
393         );
394         assert!(!builder.cache.all::<compile::Assemble>().is_empty());
395         assert_eq!(
396             first(builder.cache.all::<compile::Rustc>()),
397             &[
398                 compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
399                 compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: a },
400                 compile::Rustc { compiler: Compiler { host: a, stage: 2 }, target: a },
401                 compile::Rustc { compiler: Compiler { host: b, stage: 2 }, target: a },
402                 compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: b },
403                 compile::Rustc { compiler: Compiler { host: a, stage: 2 }, target: b },
404                 compile::Rustc { compiler: Compiler { host: b, stage: 2 }, target: b },
405             ]
406         );
407     }
408
409     #[test]
410     fn build_with_target_flag() {
411         let mut config = configure(&["B"], &["C"]);
412         config.skip_only_host_steps = true;
413         let build = Build::new(config);
414         let mut builder = Builder::new(&build);
415         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
416
417         let a = TargetSelection::from_user("A");
418         let b = TargetSelection::from_user("B");
419         let c = TargetSelection::from_user("C");
420
421         assert_eq!(
422             first(builder.cache.all::<compile::Std>()),
423             &[
424                 compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
425                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
426                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: a },
427                 compile::Std { compiler: Compiler { host: b, stage: 2 }, target: a },
428                 compile::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
429                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
430                 compile::Std { compiler: Compiler { host: b, stage: 2 }, target: b },
431                 compile::Std { compiler: Compiler { host: a, stage: 2 }, target: c },
432                 compile::Std { compiler: Compiler { host: b, stage: 2 }, target: c },
433             ]
434         );
435         assert_eq!(
436             first(builder.cache.all::<compile::Assemble>()),
437             &[
438                 compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
439                 compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
440                 compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } },
441                 compile::Assemble { target_compiler: Compiler { host: b, stage: 2 } },
442             ]
443         );
444         assert_eq!(
445             first(builder.cache.all::<compile::Rustc>()),
446             &[
447                 compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
448                 compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: a },
449                 compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: b },
450             ]
451         );
452     }
453
454     #[test]
455     fn test_with_no_doc_stage0() {
456         let mut config = configure(&[], &[]);
457         config.stage = Some(0);
458         config.cmd = Subcommand::Test {
459             paths: vec!["library/std".into()],
460             test_args: vec![],
461             rustc_args: vec![],
462             fail_fast: true,
463             doc_tests: DocTests::No,
464             bless: false,
465             compare_mode: None,
466             rustfix_coverage: false,
467             pass: None,
468         };
469
470         let build = Build::new(config);
471         let mut builder = Builder::new(&build);
472
473         let host = TargetSelection::from_user("A");
474
475         builder.run_step_descriptions(
476             &[StepDescription::from::<test::Crate>()],
477             &["library/std".into()],
478         );
479
480         // Ensure we don't build any compiler artifacts.
481         assert!(!builder.cache.contains::<compile::Rustc>());
482         assert_eq!(
483             first(builder.cache.all::<test::Crate>()),
484             &[test::Crate {
485                 compiler: Compiler { host, stage: 0 },
486                 target: host,
487                 mode: Mode::Std,
488                 test_kind: test::TestKind::Test,
489                 krate: INTERNER.intern_str("std"),
490             },]
491         );
492     }
493
494     #[test]
495     fn test_exclude() {
496         let mut config = configure(&[], &[]);
497         config.exclude = vec!["src/tools/tidy".into()];
498         config.cmd = Subcommand::Test {
499             paths: Vec::new(),
500             test_args: Vec::new(),
501             rustc_args: Vec::new(),
502             fail_fast: true,
503             doc_tests: DocTests::No,
504             bless: false,
505             compare_mode: None,
506             rustfix_coverage: false,
507             pass: None,
508         };
509
510         let build = Build::new(config);
511         let builder = Builder::new(&build);
512         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Test), &[]);
513
514         // Ensure we have really excluded tidy
515         assert!(!builder.cache.contains::<test::Tidy>());
516
517         // Ensure other tests are not affected.
518         assert!(builder.cache.contains::<test::RustdocUi>());
519     }
520
521     #[test]
522     fn doc_ci() {
523         let mut config = configure(&[], &[]);
524         config.compiler_docs = true;
525         config.cmd = Subcommand::Doc { paths: Vec::new(), open: false };
526         let build = Build::new(config);
527         let mut builder = Builder::new(&build);
528         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), &[]);
529         let a = TargetSelection::from_user("A");
530
531         // error_index_generator uses stage 1 to share rustdoc artifacts with the
532         // rustdoc tool.
533         assert_eq!(
534             first(builder.cache.all::<doc::ErrorIndex>()),
535             &[doc::ErrorIndex { compiler: Compiler { host: a, stage: 1 }, target: a },]
536         );
537         assert_eq!(
538             first(builder.cache.all::<tool::ErrorIndex>()),
539             &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 1 } }]
540         );
541         // This is actually stage 1, but Rustdoc::run swaps out the compiler with
542         // stage minus 1 if --stage is not 0. Very confusing!
543         assert_eq!(
544             first(builder.cache.all::<tool::Rustdoc>()),
545             &[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
546         );
547     }
548
549     #[test]
550     fn test_docs() {
551         // Behavior of `x.py test` doing various documentation tests.
552         let mut config = configure(&[], &[]);
553         config.cmd = Subcommand::Test {
554             paths: vec![],
555             test_args: vec![],
556             rustc_args: vec![],
557             fail_fast: true,
558             doc_tests: DocTests::Yes,
559             bless: false,
560             compare_mode: None,
561             rustfix_coverage: false,
562             pass: None,
563         };
564         let build = Build::new(config);
565         let mut builder = Builder::new(&build);
566         builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Test), &[]);
567         let a = TargetSelection::from_user("A");
568
569         // error_index_generator uses stage 1 to share rustdoc artifacts with the
570         // rustdoc tool.
571         assert_eq!(
572             first(builder.cache.all::<doc::ErrorIndex>()),
573             &[doc::ErrorIndex { compiler: Compiler { host: a, stage: 1 }, target: a },]
574         );
575         assert_eq!(
576             first(builder.cache.all::<tool::ErrorIndex>()),
577             &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 1 } }]
578         );
579         // Unfortunately rustdoc is built twice. Once from stage1 for compiletest
580         // (and other things), and once from stage0 for std crates. Ideally it
581         // would only be built once. If someone wants to fix this, it might be
582         // worth investigating if it would be possible to test std from stage1.
583         // Note that the stages here are +1 than what they actually are because
584         // Rustdoc::run swaps out the compiler with stage minus 1 if --stage is
585         // not 0.
586         assert_eq!(
587             first(builder.cache.all::<tool::Rustdoc>()),
588             &[
589                 tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } },
590                 tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },
591             ]
592         );
593     }
594 }