Skip to content

Commit 1f8df25

Browse files
committed
Auto merge of #68664 - tspiteri:no_run-complete-build, r=nikomatsakis
rustdoc: attempt full build for compile_fail test Some code fails when doing a full build but does not fail when only emitting metadata. This commit makes sure compile_fail tests for such code behave as expected, that is, the test succeeds because the compilation fails. Fixes #67771.
2 parents 333c32a + 6d768dd commit 1f8df25

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/librustc_error_codes/error_codes/E0454.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
A link name was given with an empty name. Erroneous code example:
22

3-
```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
3+
```compile_fail,E0454
44
#[link(name = "")] extern {}
55
// error: `#[link(name = "")]` given with empty name
66
```

src/librustc_error_codes/error_codes/E0458.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
An unknown "kind" was specified for a link attribute. Erroneous code example:
22

3-
```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
3+
```compile_fail,E0458
44
#[link(kind = "wonderful_unicorn")] extern {}
55
// error: unknown kind: `wonderful_unicorn`
66
```

src/librustc_error_codes/error_codes/E0459.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
A link was used without a name parameter. Erroneous code example:
22

3-
```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
3+
```compile_fail,E0459
44
#[link(kind = "dylib")] extern {}
55
// error: `#[link(...)]` specified without `name = "foo"`
66
```

src/librustdoc/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ fn run_test(
281281
for debugging_option_str in &options.debugging_options_strs {
282282
compiler.arg("-Z").arg(&debugging_option_str);
283283
}
284-
if no_run {
284+
if no_run && !compile_fail {
285285
compiler.arg("--emit=metadata");
286286
}
287287
compiler.arg("--target").arg(target.to_string());

0 commit comments

Comments
 (0)