Skip to content

Commit f4b2a8a

Browse files
committed
rustdoc: fix up old test
1 parent af69f4c commit f4b2a8a

File tree

2 files changed

+26
-16
lines changed

2 files changed

+26
-16
lines changed

src/tools/compiletest/src/header.rs

-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
694694
"check-stdout",
695695
"check-test-line-numbers-match",
696696
"compile-flags",
697-
"count",
698697
"dont-check-compiler-stderr",
699698
"dont-check-compiler-stdout",
700699
"dont-check-failure-status",

tests/rustdoc/line-breaks.rs

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,37 @@
11
#![crate_name = "foo"]
22

3-
use std::ops::Add;
43
use std::fmt::Display;
4+
use std::ops::Add;
55

6-
//@count foo/fn.function_with_a_really_long_name.html //pre/br 2
7-
pub fn function_with_a_really_long_name(parameter_one: i32,
8-
parameter_two: i32)
9-
-> Option<i32> {
6+
// @matches foo/fn.function_with_a_really_long_name.html '//*[@class="rust item-decl"]//code' "\
7+
// function_with_a_really_long_name\(\n\
8+
// \ parameter_one: i32,\n\
9+
// \ parameter_two: i32\n\
10+
// \) -> Option<i32>$"
11+
pub fn function_with_a_really_long_name(parameter_one: i32, parameter_two: i32) -> Option<i32> {
1012
Some(parameter_one + parameter_two)
1113
}
1214

13-
//@count foo/fn.short_name.html //pre/br 0
14-
pub fn short_name(param: i32) -> i32 { param + 1 }
15+
// @matches foo/fn.short_name.html '//*[@class="rust item-decl"]//code' \
16+
// "short_name\(param: i32\) -> i32$"
17+
pub fn short_name(param: i32) -> i32 {
18+
param + 1
19+
}
1520

16-
//@count foo/fn.where_clause.html //pre/br 4
17-
pub fn where_clause<T, U>(param_one: T,
18-
param_two: U)
19-
where T: Add<U> + Display + Copy,
20-
U: Add<T> + Display + Copy,
21-
T::Output: Display + Add<U::Output> + Copy,
22-
<T::Output as Add<U::Output>>::Output: Display,
23-
U::Output: Display + Copy
21+
// @matches foo/fn.where_clause.html '//*[@class="rust item-decl"]//code' "\
22+
// where_clause<T, U>\(param_one: T, param_two: U\)where\n\
23+
// \ T: Add<U> \+ Display \+ Copy,\n\
24+
// \ U: Add<T> \+ Display \+ Copy,\n\
25+
// \ T::Output: Display \+ Add<U::Output> \+ Copy,\n\
26+
// \ <T::Output as Add<U::Output>>::Output: Display,\n\
27+
// \ U::Output: Display \+ Copy,$"
28+
pub fn where_clause<T, U>(param_one: T, param_two: U)
29+
where
30+
T: Add<U> + Display + Copy,
31+
U: Add<T> + Display + Copy,
32+
T::Output: Display + Add<U::Output> + Copy,
33+
<T::Output as Add<U::Output>>::Output: Display,
34+
U::Output: Display + Copy,
2435
{
2536
let x = param_one + param_two;
2637
println!("{} + {} = {}", param_one, param_two, x);

0 commit comments

Comments
 (0)