Code
use std::{fs::Path};
fn main() {}
Current output
error[E0603]: struct `Path` is private
--> main.rs:1:15
|
1 | use std::{fs::Path};
| ^^^^ private struct
|
note: the struct `Path` is defined here
--> /rustc/a5c825cd824ee0ef9463021078a2f464b4cc1a0d/library/std/src/fs.rs:46:18
help: import `Path` directly
|
1 - use std::{fs::Path};
1 + use std::{std::path::Path};
|
Desired output
error[E0603]: struct `Path` is private
--> main.rs:1:15
|
1 | use std::{fs::Path};
| ^^^^ private struct
|
note: the struct `Path` is defined here
--> /rustc/a5c825cd824ee0ef9463021078a2f464b4cc1a0d/library/std/src/fs.rs:46:18
help: import `Path` directly
|
1 - use std::{fs::Path};
1 + use std::{path::Path};
|
Rationale and extra context
No response
Other cases
Rust Version
$ rustc --version --verbose
rustc 1.97.0-nightly (a5c825cd8 2026-04-14)
binary: rustc
commit-hash: a5c825cd824ee0ef9463021078a2f464b4cc1a0d
commit-date: 2026-04-14
host: x86_64-unknown-linux-gnu
release: 1.97.0-nightly
LLVM version: 22.1.2
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
No response
Other cases
Rust Version
Anything else?
No response