about summary refs log tree commit diff
path: root/library
diff options
context:
space:
mode:
authorGnomedDev <david2005thomas@gmail.com>2024-09-19 12:19:48 +0100
committerGnomedDev <david2005thomas@gmail.com>2024-09-19 13:13:43 +0100
commitb2eebeeea982c544f6740fb3883ea046ded39e7f (patch)
treea65bae300108eb9f588f178761b4ad7435390c79 /library
parent364e5529403bff3847fc43cc18ff4c5bb357e784 (diff)
downloadrust-b2eebeeea982c544f6740fb3883ea046ded39e7f.tar.gz
rust-b2eebeeea982c544f6740fb3883ea046ded39e7f.zip
[Clippy] Swap `open_options` to use diagnostic items instead of paths
Diffstat (limited to 'library')
-rw-r--r--library/std/src/fs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs
index abf7d5d294a..92d3838d9f2 100644
--- a/library/std/src/fs.rs
+++ b/library/std/src/fs.rs
@@ -466,6 +466,7 @@ impl File {
     /// ```
     #[must_use]
     #[stable(feature = "with_options", since = "1.58.0")]
+    #[cfg_attr(not(test), rustc_diagnostic_item = "file_options")]
     pub fn options() -> OpenOptions {
         OpenOptions::new()
     }
@@ -1009,6 +1010,7 @@ impl OpenOptions {
     /// let mut options = OpenOptions::new();
     /// let file = options.read(true).open("foo.txt");
     /// ```
+    #[cfg_attr(not(test), rustc_diagnostic_item = "open_options_new")]
     #[stable(feature = "rust1", since = "1.0.0")]
     #[must_use]
     pub fn new() -> Self {