]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/line-breaks.rs
Rollup merge of #106670 - albertlarsan68:check-docs-in-pr-ci, r=Mark-Simulacrum
[rust.git] / tests / rustdoc / line-breaks.rs
1 #![crate_name = "foo"]
2
3 use std::ops::Add;
4 use std::fmt::Display;
5
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> {
10     Some(parameter_one + parameter_two)
11 }
12
13 //@count foo/fn.short_name.html //pre/br 0
14 pub fn short_name(param: i32) -> i32 { param + 1 }
15
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
24 {
25     let x = param_one + param_two;
26     println!("{} + {} = {}", param_one, param_two, x);
27     let y = param_two + param_one;
28     println!("{} + {} = {}", param_two, param_one, y);
29     println!("{} + {} = {}", x, y, x + y);
30 }