Skip to content

Commit c17abf1

Browse files
Update tests for custom_code_classes_in_docs feature
1 parent e1294b2 commit c17abf1

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/librustdoc/html/markdown/tests.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn test_unique_id() {
4949
fn test_lang_string_parse() {
5050
fn t(lg: LangString) {
5151
let s = &lg.original;
52-
assert_eq!(LangString::parse(s, ErrorCodes::Yes, true, None), lg)
52+
assert_eq!(LangString::parse(s, ErrorCodes::Yes, true, None, true), lg)
5353
}
5454

5555
t(Default::default());
@@ -290,6 +290,7 @@ fn test_header() {
290290
edition: DEFAULT_EDITION,
291291
playground: &None,
292292
heading_offset: HeadingOffset::H2,
293+
custom_code_classes_in_docs: true,
293294
}
294295
.into_string();
295296
assert_eq!(output, expect, "original: {}", input);
@@ -329,6 +330,7 @@ fn test_header_ids_multiple_blocks() {
329330
edition: DEFAULT_EDITION,
330331
playground: &None,
331332
heading_offset: HeadingOffset::H2,
333+
custom_code_classes_in_docs: true,
332334
}
333335
.into_string();
334336
assert_eq!(output, expect, "original: {}", input);
@@ -433,7 +435,7 @@ fn test_find_testable_code_line() {
433435
}
434436
}
435437
let mut lines = Vec::<usize>::new();
436-
find_testable_code(input, &mut lines, ErrorCodes::No, false, None);
438+
find_testable_code(input, &mut lines, ErrorCodes::No, false, None, true);
437439
assert_eq!(lines, expect);
438440
}
439441

@@ -458,6 +460,7 @@ fn test_ascii_with_prepending_hashtag() {
458460
edition: DEFAULT_EDITION,
459461
playground: &None,
460462
heading_offset: HeadingOffset::H2,
463+
custom_code_classes_in_docs: true,
461464
}
462465
.into_string();
463466
assert_eq!(output, expect, "original: {}", input);
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
// check-pass
2+
13
/// ```{class=language-c}
24
/// int main(void) { return 0; }
35
/// ```
4-
//~^^^ ERROR 1:1: 3:8: custom classes in code blocks are unstable [E0658]
6+
//~^^^ WARNING custom classes in code blocks will change behaviour
7+
//~| NOTE found these custom classes: class=language-c
8+
//~| NOTE see issue #79483 <https://github.com/rust-lang/rust/issues/79483>
9+
//~| HELP add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
510
pub struct Bar;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
error[E0658]: custom classes in code blocks are unstable
2-
--> $DIR/feature-gate-custom_code_classes_in_docs.rs:1:1
1+
warning: custom classes in code blocks will change behaviour
2+
--> $DIR/feature-gate-custom_code_classes_in_docs.rs:3:1
33
|
44
LL | / /// ```{class=language-c}
55
LL | | /// int main(void) { return 0; }
@@ -10,6 +10,5 @@ LL | | /// ```
1010
= help: add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
1111
= note: found these custom classes: class=language-c
1212

13-
error: aborting due to previous error
13+
warning: 1 warning emitted
1414

15-
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)