Skip to content

Commit 781260a

Browse files
authored
Rollup merge of rust-lang#137807 - GuillaumeGomez:doctest-qualify-result, r=notriddle
Fully qualify `Result` in generated doctest code As discussed in https://lore.kernel.org/rust-for-linux/[email protected]/T/#u, it would require less code for RfL to be able to reach the same result (pun unintended). cc `@ojeda` r? `@notriddle`
2 parents ef4a359 + c86a7ef commit 781260a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/librustdoc/doctest/make.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ impl DocTestBuilder {
208208
let (main_pre, main_post) = if returns_result {
209209
(
210210
format!(
211-
"fn main() {{ {inner_attr}fn {inner_fn_name}() -> Result<(), impl core::fmt::Debug> {{\n",
211+
"fn main() {{ {inner_attr}fn {inner_fn_name}() -> core::result::Result<(), impl core::fmt::Debug> {{\n",
212212
),
213213
format!("\n}} {inner_fn_name}().unwrap() }}"),
214214
)

src/librustdoc/doctest/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ let mut input = String::new();
316316
io::stdin().read_line(&mut input)?;
317317
Ok::<(), io:Error>(())";
318318
let expected = "#![allow(unused)]
319-
fn main() { fn _inner() -> Result<(), impl core::fmt::Debug> {
319+
fn main() { fn _inner() -> core::result::Result<(), impl core::fmt::Debug> {
320320
use std::io;
321321
let mut input = String::new();
322322
io::stdin().read_line(&mut input)?;

0 commit comments

Comments
 (0)