[Clippy] Swap open_options to use diagnostic items instead of paths · qinheping/verify-rust-std@cb771b2 (original) (raw)

Original file line number Diff line number Diff line change
@@ -466,6 +466,7 @@ impl File {
466 466 /// ```
467 467 #[must_use]
468 468 #[stable(feature = "with_options", since = "1.58.0")]
469 +#[cfg_attr(not(test), rustc_diagnostic_item = "file_options")]
469 470 pub fn options() -> OpenOptions {
470 471 OpenOptions::new()
471 472 }
@@ -1009,6 +1010,7 @@ impl OpenOptions {
1009 1010 /// let mut options = OpenOptions::new();
1010 1011 /// let file = options.read(true).open("foo.txt");
1011 1012 /// ```
1013 + #[cfg_attr(not(test), rustc_diagnostic_item = "open_options_new")]
1012 1014 #[stable(feature = "rust1", since = "1.0.0")]
1013 1015 #[must_use]
1014 1016 pub fn new() -> Self {