Skip to content

Commit

Permalink
Fully qualify Result in generated doctest code
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Feb 28, 2025
1 parent ac91805 commit c86a7ef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librustdoc/doctest/make.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl DocTestBuilder {
let (main_pre, main_post) = if returns_result {
(
format!(
"fn main() {{ {inner_attr}fn {inner_fn_name}() -> Result<(), impl core::fmt::Debug> {{\n",
"fn main() {{ {inner_attr}fn {inner_fn_name}() -> core::result::Result<(), impl core::fmt::Debug> {{\n",
),
format!("\n}} {inner_fn_name}().unwrap() }}"),
)
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/doctest/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ let mut input = String::new();
io::stdin().read_line(&mut input)?;
Ok::<(), io:Error>(())";
let expected = "#![allow(unused)]
fn main() { fn _inner() -> Result<(), impl core::fmt::Debug> {
fn main() { fn _inner() -> core::result::Result<(), impl core::fmt::Debug> {
use std::io;
let mut input = String::new();
io::stdin().read_line(&mut input)?;
Expand Down

0 comments on commit c86a7ef

Please sign in to comment.