about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-17 11:33:40 +0000
committerbors <bors@rust-lang.org>2022-10-17 11:33:40 +0000
commitabd77441010d74430be5c34a2e62002e578fa165 (patch)
tree9bca7964fdcdbcb3f2088a4fa37124a5582c2e01
parentc19a893f87e70fc1c9bab193c3f9c83d9a9d71d3 (diff)
parentbb3f60b847ef725124beb097d1b30115bfb3e499 (diff)
downloadrust-abd77441010d74430be5c34a2e62002e578fa165.tar.gz
rust-abd77441010d74430be5c34a2e62002e578fa165.zip
Auto merge of #103145 - matthiaskrgr:rollup-mxwsysv, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #102962 (remote-test-server: Show command line arguments)
 - #103129 (rustdoc: remove unused `.sub-logo-container` DOM on non-source pages)
 - #103136 (Fix types in documentation for `Alignment::as_usize` and `Alignmnet::as_nonzero`)
 - #103139 (Duplicate comment in mod.rs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_middle/src/traits/mod.rs5
-rw-r--r--library/core/src/ptr/alignment.rs4
-rw-r--r--src/librustdoc/html/static/css/rustdoc.css16
-rw-r--r--src/librustdoc/html/templates/page.html2
-rw-r--r--src/test/rustdoc/logo-class-default.rs2
-rw-r--r--src/test/rustdoc/logo-class.rs4
-rw-r--r--src/tools/remote-test-server/src/main.rs25
7 files changed, 32 insertions, 26 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs
index a635e0463e5..e73d44bbb36 100644
--- a/compiler/rustc_middle/src/traits/mod.rs
+++ b/compiler/rustc_middle/src/traits/mod.rs
@@ -598,11 +598,6 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
 ///     // type parameters, ImplSource will carry resolutions for those as well:
 ///     concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
 ///
-///     // Case A: ImplSource points at a specific impl. Only possible when
-///     // type is concretely known. If the impl itself has bounded
-///     // type parameters, ImplSource will carry resolutions for those as well:
-///     concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
-///
 ///     // Case B: ImplSource must be provided by caller. This applies when
 ///     // type is a type parameter.
 ///     param.clone();    // ImplSource::Param
diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs
index 56c5e6cb724..846efbc4ebf 100644
--- a/library/core/src/ptr/alignment.rs
+++ b/library/core/src/ptr/alignment.rs
@@ -83,7 +83,7 @@ impl Alignment {
         unsafe { mem::transmute::<usize, Alignment>(align) }
     }
 
-    /// Returns the alignment as a [`NonZeroUsize`]
+    /// Returns the alignment as a [`usize`]
     #[unstable(feature = "ptr_alignment_type", issue = "102070")]
     #[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")]
     #[inline]
@@ -91,7 +91,7 @@ impl Alignment {
         self.0 as usize
     }
 
-    /// Returns the alignment as a [`usize`]
+    /// Returns the alignment as a [`NonZeroUsize`]
     #[unstable(feature = "ptr_alignment_type", issue = "102070")]
     #[inline]
     pub const fn as_nonzero(self) -> NonZeroUsize {
diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index 271dd177a4b..4bfc8ada280 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -372,15 +372,11 @@ img {
 }
 
 .sub-logo-container {
-	display: none;
-	margin-right: 20px;
-}
-
-.source .sub-logo-container {
 	display: block;
+	margin-right: 20px;
 }
 
-.source .sub-logo-container > img {
+.sub-logo-container > img {
 	height: 60px;
 	width: 60px;
 	object-fit: contain;
@@ -1716,12 +1712,6 @@ in storage.js plus the media query with (max-width: 700px)
 		margin-top: 16px;
 	}
 
-	/* When we expand the sidebar on the source code page, we hide the logo on the left of the
-	search bar to have more space. */
-	.source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
-		display: none;
-	}
-
 	.source-sidebar-expanded .source .sidebar {
 		width: 300px;
 	}
@@ -2025,7 +2015,7 @@ in storage.js plus the media query with (min-width: 701px)
 		align-self: center;
 	}
 
-	.source .sub-logo-container > img {
+	.sub-logo-container > img {
 		height: 35px;
 		width: 35px;
 	}
diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html
index 6e6bb70707d..123bd576d64 100644
--- a/src/librustdoc/html/templates/page.html
+++ b/src/librustdoc/html/templates/page.html
@@ -103,6 +103,7 @@
     <main> {#- -#}
         <div class="width-limiter"> {#- -#}
             <div class="sub-container"> {#- -#}
+                {%- if page.css_class == "source" -%}
                 <a class="sub-logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
                     {%- if !layout.logo.is_empty()  %}
                         <img src="{{layout.logo}}" alt="logo"> {#- -#}
@@ -110,6 +111,7 @@
                         <img class="rust-logo" src="{{static_root_path|safe}}rust-logo{{page.resource_suffix}}.svg" alt="logo"> {#- -#}
                     {%- endif -%}
                 </a> {#- -#}
+                {%- endif -%}
                 <nav class="sub"> {#- -#}
                     <form class="search-form"> {#- -#}
                         <div class="search-container"> {#- -#}
diff --git a/src/test/rustdoc/logo-class-default.rs b/src/test/rustdoc/logo-class-default.rs
index a7016d227b1..d2d4391997f 100644
--- a/src/test/rustdoc/logo-class-default.rs
+++ b/src/test/rustdoc/logo-class-default.rs
@@ -1,4 +1,4 @@
 // Note: this test is paired with logo-class.rs.
 // @has logo_class_default/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' ''
-// @has logo_class_default/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
+// @has src/logo_class_default/logo-class-default.rs.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
 pub struct SomeStruct;
diff --git a/src/test/rustdoc/logo-class.rs b/src/test/rustdoc/logo-class.rs
index f071f356a6d..d3aa446dab9 100644
--- a/src/test/rustdoc/logo-class.rs
+++ b/src/test/rustdoc/logo-class.rs
@@ -5,6 +5,6 @@
 // @has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
 // @!has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' ''
 //
-// @has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
-// @!has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
+// @has src/logo_class/logo-class.rs.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
+// @!has src/logo_class/logo-class.rs.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
 pub struct SomeStruct;
diff --git a/src/tools/remote-test-server/src/main.rs b/src/tools/remote-test-server/src/main.rs
index bed9d39161d..ec992da6812 100644
--- a/src/tools/remote-test-server/src/main.rs
+++ b/src/tools/remote-test-server/src/main.rs
@@ -74,7 +74,11 @@ impl Config {
                 "--bind" => next_is_bind = true,
                 "--sequential" => config.sequential = true,
                 "--verbose" | "-v" => config.verbose = true,
-                arg => panic!("unknown argument: {}", arg),
+                "--help" | "-h" => {
+                    show_help();
+                    std::process::exit(0);
+                }
+                arg => panic!("unknown argument: {}, use `--help` for known arguments", arg),
             }
         }
         if next_is_bind {
@@ -85,6 +89,22 @@ impl Config {
     }
 }
 
+fn show_help() {
+    eprintln!(
+        r#"Usage:
+
+{} [OPTIONS]
+
+OPTIONS:
+    --bind <IP>:<PORT>   Specify IP address and port to listen for requests, e.g. "0.0.0.0:12345"
+    --sequential         Run only one test at a time
+    -v, --verbose        Show status messages
+    -h, --help           Show this help screen
+"#,
+        std::env::args().next().unwrap()
+    );
+}
+
 fn print_verbose(s: &str, conf: Config) {
     if conf.verbose {
         println!("{}", s);
@@ -92,9 +112,8 @@ fn print_verbose(s: &str, conf: Config) {
 }
 
 fn main() {
-    println!("starting test server");
-
     let config = Config::parse_args();
+    println!("starting test server");
 
     let listener = t!(TcpListener::bind(config.bind));
     let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {