Skip to content

Commit

Permalink
Unrolled build for rust-lang#137807
Browse files Browse the repository at this point in the history
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/20250228132553.880126-1-guillaume1.gomez@gmail.com/T/#u, it would require less code for RfL to be able to reach the same result (pun unintended).

cc ``@ojeda``

r? ``@notriddle``
  • Loading branch information
rust-timer authored Mar 2, 2025
2 parents 351686b + c86a7ef commit a9f8166
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 a9f8166

Please sign in to comment.