Skip to content

Commit

Permalink
Auto merge of #103145 - matthiaskrgr:rollup-mxwsysv, r=matthiaskrgr
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Oct 17, 2022
2 parents c19a893 + bb3f60b commit abd7744
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
5 changes: 0 additions & 5 deletions compiler/rustc_middle/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ 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]
pub const fn as_usize(self) -> usize {
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 {
Expand Down
16 changes: 3 additions & 13 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/librustdoc/html/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,15 @@ <h2 class="location"></h2> {#- -#}
<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"> {#- -#}
{%- else -%}
<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"> {#- -#}
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc/logo-class-default.rs
Original file line number Diff line number Diff line change
@@ -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;
4 changes: 2 additions & 2 deletions src/test/rustdoc/logo-class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
25 changes: 22 additions & 3 deletions src/tools/remote-test-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -85,16 +89,31 @@ 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);
}
}

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") {
Expand Down

0 comments on commit abd7744

Please sign in to comment.