Skip to content

Commit abd7744

Browse files
committed
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
2 parents c19a893 + bb3f60b commit abd7744

File tree

7 files changed

+32
-26
lines changed

7 files changed

+32
-26
lines changed

Diff for: compiler/rustc_middle/src/traits/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -598,11 +598,6 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
598598
/// // type parameters, ImplSource will carry resolutions for those as well:
599599
/// concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
600600
///
601-
/// // Case A: ImplSource points at a specific impl. Only possible when
602-
/// // type is concretely known. If the impl itself has bounded
603-
/// // type parameters, ImplSource will carry resolutions for those as well:
604-
/// concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
605-
///
606601
/// // Case B: ImplSource must be provided by caller. This applies when
607602
/// // type is a type parameter.
608603
/// param.clone(); // ImplSource::Param

Diff for: library/core/src/ptr/alignment.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ impl Alignment {
8383
unsafe { mem::transmute::<usize, Alignment>(align) }
8484
}
8585

86-
/// Returns the alignment as a [`NonZeroUsize`]
86+
/// Returns the alignment as a [`usize`]
8787
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
8888
#[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")]
8989
#[inline]
9090
pub const fn as_usize(self) -> usize {
9191
self.0 as usize
9292
}
9393

94-
/// Returns the alignment as a [`usize`]
94+
/// Returns the alignment as a [`NonZeroUsize`]
9595
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
9696
#[inline]
9797
pub const fn as_nonzero(self) -> NonZeroUsize {

Diff for: src/librustdoc/html/static/css/rustdoc.css

+3-13
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,11 @@ img {
372372
}
373373

374374
.sub-logo-container {
375-
display: none;
376-
margin-right: 20px;
377-
}
378-
379-
.source .sub-logo-container {
380375
display: block;
376+
margin-right: 20px;
381377
}
382378

383-
.source .sub-logo-container > img {
379+
.sub-logo-container > img {
384380
height: 60px;
385381
width: 60px;
386382
object-fit: contain;
@@ -1716,12 +1712,6 @@ in storage.js plus the media query with (max-width: 700px)
17161712
margin-top: 16px;
17171713
}
17181714

1719-
/* When we expand the sidebar on the source code page, we hide the logo on the left of the
1720-
search bar to have more space. */
1721-
.source-sidebar-expanded .source .sidebar + main .width-limiter .sub-logo-container.rust-logo {
1722-
display: none;
1723-
}
1724-
17251715
.source-sidebar-expanded .source .sidebar {
17261716
width: 300px;
17271717
}
@@ -2025,7 +2015,7 @@ in storage.js plus the media query with (min-width: 701px)
20252015
align-self: center;
20262016
}
20272017

2028-
.source .sub-logo-container > img {
2018+
.sub-logo-container > img {
20292019
height: 35px;
20302020
width: 35px;
20312021
}

Diff for: src/librustdoc/html/templates/page.html

+2
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ <h2 class="location"></h2> {#- -#}
103103
<main> {#- -#}
104104
<div class="width-limiter"> {#- -#}
105105
<div class="sub-container"> {#- -#}
106+
{%- if page.css_class == "source" -%}
106107
<a class="sub-logo-container" href="{{page.root_path|safe}}{{krate_with_trailing_slash|safe}}index.html"> {#- -#}
107108
{%- if !layout.logo.is_empty() %}
108109
<img src="{{layout.logo}}" alt="logo"> {#- -#}
109110
{%- else -%}
110111
<img class="rust-logo" src="{{static_root_path|safe}}rust-logo{{page.resource_suffix}}.svg" alt="logo"> {#- -#}
111112
{%- endif -%}
112113
</a> {#- -#}
114+
{%- endif -%}
113115
<nav class="sub"> {#- -#}
114116
<form class="search-form"> {#- -#}
115117
<div class="search-container"> {#- -#}

Diff for: src/test/rustdoc/logo-class-default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Note: this test is paired with logo-class.rs.
22
// @has logo_class_default/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' ''
3-
// @has logo_class_default/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
3+
// @has src/logo_class_default/logo-class-default.rs.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
44
pub struct SomeStruct;

Diff for: src/test/rustdoc/logo-class.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
// @has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
66
// @!has logo_class/struct.SomeStruct.html '//*[@class="logo-container"]/img[@class="rust-logo"]' ''
77
//
8-
// @has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@src="https://raw.githubusercontent.com/sagebind/isahc/master/media/isahc.svg.png"]' ''
9-
// @!has logo_class/struct.SomeStruct.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
8+
// @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"]' ''
9+
// @!has src/logo_class/logo-class.rs.html '//*[@class="sub-logo-container"]/img[@class="rust-logo"]' ''
1010
pub struct SomeStruct;

Diff for: src/tools/remote-test-server/src/main.rs

+22-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ impl Config {
7474
"--bind" => next_is_bind = true,
7575
"--sequential" => config.sequential = true,
7676
"--verbose" | "-v" => config.verbose = true,
77-
arg => panic!("unknown argument: {}", arg),
77+
"--help" | "-h" => {
78+
show_help();
79+
std::process::exit(0);
80+
}
81+
arg => panic!("unknown argument: {}, use `--help` for known arguments", arg),
7882
}
7983
}
8084
if next_is_bind {
@@ -85,16 +89,31 @@ impl Config {
8589
}
8690
}
8791

92+
fn show_help() {
93+
eprintln!(
94+
r#"Usage:
95+
96+
{} [OPTIONS]
97+
98+
OPTIONS:
99+
--bind <IP>:<PORT> Specify IP address and port to listen for requests, e.g. "0.0.0.0:12345"
100+
--sequential Run only one test at a time
101+
-v, --verbose Show status messages
102+
-h, --help Show this help screen
103+
"#,
104+
std::env::args().next().unwrap()
105+
);
106+
}
107+
88108
fn print_verbose(s: &str, conf: Config) {
89109
if conf.verbose {
90110
println!("{}", s);
91111
}
92112
}
93113

94114
fn main() {
95-
println!("starting test server");
96-
97115
let config = Config::parse_args();
116+
println!("starting test server");
98117

99118
let listener = t!(TcpListener::bind(config.bind));
100119
let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {

0 commit comments

Comments
 (0)