about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-14 19:38:08 +0000
committerbors <bors@rust-lang.org>2023-04-14 19:38:08 +0000
commit84dd17b56a931a631a23dfd5ef2018fd3ef49108 (patch)
tree54bf25e0b3e1f48be94752b14fadd46ed7dbed25 /src
parent276fa294809e914b1d04192392d256814aa5ce1a (diff)
parent0d97522ee751cf485f3daf621bcc0ff1e6771f0f (diff)
downloadrust-84dd17b56a931a631a23dfd5ef2018fd3ef49108.tar.gz
rust-84dd17b56a931a631a23dfd5ef2018fd3ef49108.zip
Auto merge of #110331 - matthiaskrgr:rollup-9vldvow, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #108687 (Reformulate `point_at_expr_source_of_inferred_type` to be more accurate)
 - #109272 (Add Command environment variable inheritance docs)
 - #109947 (Add links from `core::cmp` derives to their traits)
 - #110110 (Use `Display` in top-level example for `PanicInfo`)
 - #110154 (Fix typos in library)
 - #110244 (Remove some unneeded imports / qualified paths)
 - #110328 ([rustdoc] Add explanations for auto-disambiguation when an intra doc link is resolved to a proc-macro and a trait at the same time)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/cache.rs3
-rw-r--r--src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md7
-rw-r--r--src/librustdoc/clean/mod.rs1
-rw-r--r--src/librustdoc/clean/types.rs3
-rw-r--r--src/librustdoc/config.rs1
-rw-r--r--src/librustdoc/html/markdown.rs1
-rw-r--r--src/librustdoc/html/render/mod.rs1
-rw-r--r--src/librustdoc/html/render/search_index.rs2
-rw-r--r--src/librustdoc/json/conversions.rs1
-rw-r--r--src/librustdoc/lib.rs1
-rw-r--r--src/tools/bump-stage0/src/main.rs1
-rw-r--r--src/tools/tidy/src/bins.rs4
-rw-r--r--src/tools/tidy/src/pal.rs1
-rw-r--r--src/tools/unicode-table-generator/src/raw_emitter.rs1
-rw-r--r--src/tools/unicode-table-generator/src/skiplist.rs1
15 files changed, 12 insertions, 17 deletions
diff --git a/src/bootstrap/cache.rs b/src/bootstrap/cache.rs
index 05f25af68ea..5376c4ec9c3 100644
--- a/src/bootstrap/cache.rs
+++ b/src/bootstrap/cache.rs
@@ -1,9 +1,8 @@
 use std::any::{Any, TypeId};
 use std::borrow::Borrow;
 use std::cell::RefCell;
-use std::cmp::{Ord, Ordering, PartialOrd};
+use std::cmp::Ordering;
 use std::collections::HashMap;
-use std::convert::AsRef;
 use std::fmt;
 use std::hash::{Hash, Hasher};
 use std::marker::PhantomData;
diff --git a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md
index 36bc312b9c9..eb2285ef906 100644
--- a/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md
+++ b/src/doc/rustdoc/src/write-documentation/linking-to-items-by-name.md
@@ -103,6 +103,13 @@ macro_rules! foo {
 }
 ```
 
+There is one case where the disambiguation will be performed automatically: if an intra doc
+link is resolved at the same time as a trait and as a derive proc-macro. In this case, it'll
+always generate a link to the trait and not emit a "missing disambiguation" warning. A good
+example of this case is when you link to the `Clone` trait: there is also a `Clone`
+proc-macro but it ignores it in this case. If you want to link to the proc-macro, you can
+use the `macro@` disambiguator.
+
 ## Warnings, re-exports, and scoping
 
 Links are resolved in the scope of the module where the item is defined, even
diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs
index 6ceba1b1f8e..5fa0c120fba 100644
--- a/src/librustdoc/clean/mod.rs
+++ b/src/librustdoc/clean/mod.rs
@@ -35,7 +35,6 @@ use rustc_span::{self, ExpnKind};
 use std::borrow::Cow;
 use std::collections::hash_map::Entry;
 use std::collections::BTreeMap;
-use std::default::Default;
 use std::hash::Hash;
 use std::mem;
 use thin_vec::ThinVec;
diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs
index e34ece9264c..6d2ce9e2833 100644
--- a/src/librustdoc/clean/types.rs
+++ b/src/librustdoc/clean/types.rs
@@ -1,6 +1,5 @@
 use std::borrow::Cow;
 use std::cell::RefCell;
-use std::default::Default;
 use std::hash::Hash;
 use std::path::PathBuf;
 use std::rc::Rc;
@@ -980,7 +979,7 @@ pub(crate) trait NestedAttributesExt {
     /// Returns `true` if the attribute list contains a specific `word`
     fn has_word(self, word: Symbol) -> bool
     where
-        Self: std::marker::Sized,
+        Self: Sized,
     {
         <Self as NestedAttributesExt>::get_word_attr(self, word).is_some()
     }
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 512c5c85d6a..1be4f364ead 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -1,5 +1,4 @@
 use std::collections::BTreeMap;
-use std::convert::TryFrom;
 use std::ffi::OsStr;
 use std::fmt;
 use std::path::PathBuf;
diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index fd81a21f5a9..00aadb8e82a 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -36,7 +36,6 @@ use rustc_span::{Span, Symbol};
 use once_cell::sync::Lazy;
 use std::borrow::Cow;
 use std::collections::VecDeque;
-use std::default::Default;
 use std::fmt::Write;
 use std::ops::{ControlFlow, Range};
 use std::str;
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 1e3cd266850..463184acaa1 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -38,7 +38,6 @@ pub(crate) use self::context::*;
 pub(crate) use self::span_map::{collect_spans_and_sources, LinkFromSrc};
 
 use std::collections::VecDeque;
-use std::default::Default;
 use std::fmt::{self, Write};
 use std::fs;
 use std::iter::Peekable;
diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs
index 08a0e1c377e..f5b4a3f5abd 100644
--- a/src/librustdoc/html/render/search_index.rs
+++ b/src/librustdoc/html/render/search_index.rs
@@ -59,7 +59,7 @@ pub(crate) fn build_index<'tcx>(
         // `sort_unstable_by_key` produces lifetime errors
         let k1 = (&k1.path, k1.name.as_str(), &k1.ty, &k1.parent);
         let k2 = (&k2.path, k2.name.as_str(), &k2.ty, &k2.parent);
-        std::cmp::Ord::cmp(&k1, &k2)
+        Ord::cmp(&k1, &k2)
     });
 
     // Set up alias indexes.
diff --git a/src/librustdoc/json/conversions.rs b/src/librustdoc/json/conversions.rs
index c39caf73a93..cd6509607d5 100644
--- a/src/librustdoc/json/conversions.rs
+++ b/src/librustdoc/json/conversions.rs
@@ -4,7 +4,6 @@
 
 #![allow(rustc::default_hash_types)]
 
-use std::convert::From;
 use std::fmt;
 
 use rustc_ast::ast;
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 60c98cc3831..4a88dc5254d 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -69,7 +69,6 @@ extern crate test;
 #[cfg(feature = "jemalloc")]
 extern crate jemalloc_sys;
 
-use std::default::Default;
 use std::env::{self, VarError};
 use std::io::{self, IsTerminal};
 use std::process;
diff --git a/src/tools/bump-stage0/src/main.rs b/src/tools/bump-stage0/src/main.rs
index f530a4d73d3..b007f9a22c3 100644
--- a/src/tools/bump-stage0/src/main.rs
+++ b/src/tools/bump-stage0/src/main.rs
@@ -2,7 +2,6 @@ use anyhow::{Context, Error};
 use curl::easy::Easy;
 use indexmap::IndexMap;
 use std::collections::HashMap;
-use std::convert::TryInto;
 
 const PATH: &str = "src/stage0.json";
 const COMPILER_COMPONENTS: &[&str] = &["rustc", "rust-std", "cargo"];
diff --git a/src/tools/tidy/src/bins.rs b/src/tools/tidy/src/bins.rs
index 7e5b4d810ba..197e9a9965f 100644
--- a/src/tools/tidy/src/bins.rs
+++ b/src/tools/tidy/src/bins.rs
@@ -57,8 +57,8 @@ mod os_impl {
             match fs::File::create(&path) {
                 Ok(file) => {
                     let exec = is_executable(&path).unwrap_or(false);
-                    std::mem::drop(file);
-                    std::fs::remove_file(&path).expect("Deleted temp file");
+                    drop(file);
+                    fs::remove_file(&path).expect("Deleted temp file");
                     // If the file is executable, then we assume that this
                     // filesystem does not track executability, so skip this check.
                     return if exec { Unsupported } else { Supported };
diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs
index d40c4ad0711..6fd41e83362 100644
--- a/src/tools/tidy/src/pal.rs
+++ b/src/tools/tidy/src/pal.rs
@@ -31,7 +31,6 @@
 //! this in the long term.
 
 use crate::walk::{filter_dirs, walk};
-use std::iter::Iterator;
 use std::path::Path;
 
 // Paths that may contain platform-specific code.
diff --git a/src/tools/unicode-table-generator/src/raw_emitter.rs b/src/tools/unicode-table-generator/src/raw_emitter.rs
index 890ff986c2b..7547b49ab2a 100644
--- a/src/tools/unicode-table-generator/src/raw_emitter.rs
+++ b/src/tools/unicode-table-generator/src/raw_emitter.rs
@@ -1,6 +1,5 @@
 use crate::fmt_list;
 use std::collections::{BTreeMap, BTreeSet, HashMap};
-use std::convert::TryFrom;
 use std::fmt::{self, Write};
 use std::ops::Range;
 
diff --git a/src/tools/unicode-table-generator/src/skiplist.rs b/src/tools/unicode-table-generator/src/skiplist.rs
index 6e439968c3b..9b613a94c57 100644
--- a/src/tools/unicode-table-generator/src/skiplist.rs
+++ b/src/tools/unicode-table-generator/src/skiplist.rs
@@ -1,6 +1,5 @@
 use crate::fmt_list;
 use crate::raw_emitter::RawEmitter;
-use std::convert::TryInto;
 use std::fmt::Write as _;
 use std::ops::Range;