Skip to content

Commit d8a1bc7

Browse files
committed
Auto merge of #49489 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests - Successful merges: #49443, #49445, #49446, #49463, #49464, #49466, #49468, #49473, #49484, #49486 - Failed merges:
2 parents 15e8c5d + 67e0c2b commit d8a1bc7

File tree

20 files changed

+41
-33
lines changed

20 files changed

+41
-33
lines changed

RELEASES.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Libraries
3434
- [Implement libstd for CloudABI.][47268]
3535
- [`Float::{from_bits, to_bits}` is now available in libcore.][46931]
3636
- [Implement `AsRef<Path>` for Component][46985]
37-
- [Implemented `Write` for `Cursor<&mut Vec<T>>`][46830]
37+
- [Implemented `Write` for `Cursor<&mut Vec<u8>>`][46830]
3838
- [Moved `Duration` to libcore.][46666]
3939

4040
Stabilized APIs
@@ -47,8 +47,6 @@ eg. `static MINUTE: Duration = Duration::from_secs(60);`
4747
- [`Duration::new`][47300]
4848
- [`Duration::from_secs`][47300]
4949
- [`Duration::from_millis`][47300]
50-
- [`Duration::from_micros`][47300]
51-
- [`Duration::from_nanos`][47300]
5250

5351
Cargo
5452
-----

src/bootstrap/util.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ pub fn symlink_dir(src: &Path, dest: &Path) -> io::Result<()> {
288288
nOutBufferSize: DWORD,
289289
lpBytesReturned: LPDWORD,
290290
lpOverlapped: LPOVERLAPPED) -> BOOL;
291+
fn CloseHandle(hObject: HANDLE) -> BOOL;
291292
}
292293

293294
fn to_u16s<S: AsRef<OsStr>>(s: S) -> io::Result<Vec<u16>> {
@@ -341,11 +342,13 @@ pub fn symlink_dir(src: &Path, dest: &Path) -> io::Result<()> {
341342
&mut ret,
342343
ptr::null_mut());
343344

344-
if res == 0 {
345+
let out = if res == 0 {
345346
Err(io::Error::last_os_error())
346347
} else {
347348
Ok(())
348-
}
349+
};
350+
CloseHandle(h);
351+
out
349352
}
350353
}
351354
}

src/doc/rustdoc/src/unstable-features.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ $ rustdoc src/lib.rs -Z unstable-options --themes theme.css
305305

306306
Giving this flag to `rustdoc` will make it copy your theme into the generated crate docs and enable
307307
it in the theme selector. Note that `rustdoc` will reject your theme file if it doesn't style
308-
everything the "main" theme does. See `--theme-checker` below for details.
308+
everything the "light" theme does. See `--theme-checker` below for details.
309309

310310
### `--theme-checker`: verify theme CSS for validity
311311

@@ -316,7 +316,7 @@ $ rustdoc -Z unstable-options --theme-checker theme.css
316316
```
317317

318318
Before including your theme in crate docs, `rustdoc` will compare all the CSS rules it contains
319-
against the "main" theme included by default. Using this flag will allow you to see which rules are
319+
against the "light" theme included by default. Using this flag will allow you to see which rules are
320320
missing if `rustdoc` rejects your theme.
321321

322322
### `--resource-suffix`: modifying the name of CSS/JavaScript in crate docs
@@ -330,7 +330,7 @@ $ rustdoc src/lib.rs -Z unstable-options --resource-suffix suf
330330
When rendering docs, `rustdoc` creates several CSS and JavaScript files as part of the output. Since
331331
all these files are linked from every page, changing where they are can be cumbersome if you need to
332332
specially cache them. This flag will rename all these files in the output to include the suffix in
333-
the filename. For example, `main.css` would become `main-suf.css` with the above command.
333+
the filename. For example, `light.css` would become `light-suf.css` with the above command.
334334

335335
### `--display-warnings`: display warnings when documenting or running documentation tests
336336

src/liballoc/boxed.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ use core::any::Any;
6262
use core::borrow;
6363
use core::cmp::Ordering;
6464
use core::fmt;
65-
use core::hash::{self, Hash, Hasher};
65+
use core::hash::{Hash, Hasher};
6666
use core::iter::FusedIterator;
6767
use core::marker::{self, Unpin, Unsize};
6868
use core::mem::{self, Pin};
@@ -508,7 +508,7 @@ impl<T: ?Sized + Eq> Eq for Box<T> {}
508508

509509
#[stable(feature = "rust1", since = "1.0.0")]
510510
impl<T: ?Sized + Hash> Hash for Box<T> {
511-
fn hash<H: hash::Hasher>(&self, state: &mut H) {
511+
fn hash<H: Hasher>(&self, state: &mut H) {
512512
(**self).hash(state);
513513
}
514514
}

src/liballoc/vec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1599,8 +1599,8 @@ impl_spec_from_elem!(u64, |x| x == 0);
15991599
impl_spec_from_elem!(u128, |x| x == 0);
16001600
impl_spec_from_elem!(usize, |x| x == 0);
16011601

1602-
impl_spec_from_elem!(f32, |x: f32| x == 0. && x.is_sign_positive());
1603-
impl_spec_from_elem!(f64, |x: f64| x == 0. && x.is_sign_positive());
1602+
impl_spec_from_elem!(f32, |x: f32| x.to_bits() == 0);
1603+
impl_spec_from_elem!(f64, |x: f64| x.to_bits() == 0);
16041604

16051605
////////////////////////////////////////////////////////////////////////////////
16061606
// Common trait implementations for Vec

src/libcore/ops/try.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
any(from_method="from_error", from_method="from_ok"),
2121
from_desugaring="?"),
2222
message="the `?` operator can only be used in a \
23-
function that returns `Result` \
23+
function that returns `Result` or `Option` \
2424
(or another type that implements `{Try}`)",
2525
label="cannot use the `?` operator in a function that returns `{Self}`"),
2626
on(all(from_method="into_result", from_desugaring="?"),

src/libcore/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2653,7 +2653,7 @@ impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
26532653
///
26542654
/// Unlike `*mut T`, the pointer must always be non-null, even if the pointer
26552655
/// is never dereferenced. This is so that enums may use this forbidden value
2656-
/// as a discriminant -- `Option<NonNull<T>>` has the same size as `NonNull<T>`.
2656+
/// as a discriminant -- `Option<NonNull<T>>` has the same size as `*mut T`.
26572657
/// However the pointer may still dangle if it isn't dereferenced.
26582658
///
26592659
/// Unlike `*mut T`, `NonNull<T>` is covariant over `T`. If this is incorrect

src/librustdoc/html/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ r##"<!DOCTYPE html>
5353
id="mainThemeStyle">
5454
{themes}
5555
<link rel="stylesheet" type="text/css" href="{root_path}dark{suffix}.css">
56-
<link rel="stylesheet" type="text/css" href="{root_path}main{suffix}.css" id="themeStyle">
56+
<link rel="stylesheet" type="text/css" href="{root_path}light{suffix}.css" id="themeStyle">
5757
<script src="{root_path}storage{suffix}.js"></script>
5858
{css_extension}
5959

src/librustdoc/html/render.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ pub struct SharedContext {
129129
pub sort_modules_alphabetically: bool,
130130
/// Additional themes to be added to the generated docs.
131131
pub themes: Vec<PathBuf>,
132-
/// Suffix to be added on resource files (if suffix is "-v2" then "main.css" becomes
133-
/// "main-v2.css").
132+
/// Suffix to be added on resource files (if suffix is "-v2" then "light.css" becomes
133+
/// "light-v2.css").
134134
pub resource_suffix: String,
135135
}
136136

@@ -743,7 +743,7 @@ fn write_shared(cx: &Context,
743743
write(cx.dst.join(&format!("rustdoc{}.css", cx.shared.resource_suffix)),
744744
include_bytes!("static/rustdoc.css"))?;
745745

746-
// To avoid "main.css" to be overwritten, we'll first run over the received themes and only
746+
// To avoid "light.css" to be overwritten, we'll first run over the received themes and only
747747
// then we'll run over the "official" styles.
748748
let mut themes: HashSet<String> = HashSet::new();
749749

@@ -761,9 +761,9 @@ fn write_shared(cx: &Context,
761761

762762
write(cx.dst.join(&format!("brush{}.svg", cx.shared.resource_suffix)),
763763
include_bytes!("static/brush.svg"))?;
764-
write(cx.dst.join(&format!("main{}.css", cx.shared.resource_suffix)),
765-
include_bytes!("static/themes/main.css"))?;
766-
themes.insert("main".to_owned());
764+
write(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)),
765+
include_bytes!("static/themes/light.css"))?;
766+
themes.insert("light".to_owned());
767767
write(cx.dst.join(&format!("dark{}.css", cx.shared.resource_suffix)),
768768
include_bytes!("static/themes/dark.css"))?;
769769
themes.insert("dark".to_owned());

src/librustdoc/html/static/rustdoc.css

+4-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
109109
position: relative;
110110
}
111111
h3.impl, h3.method, h3.type {
112-
margin-top: 15px;
113112
padding-left: 15px;
114113
}
115114

@@ -470,7 +469,10 @@ h4 > code, h3 > code, .invisible > code {
470469
font-size: 0.8em;
471470
}
472471

473-
.content .methods > div:not(.important-traits) { margin-left: 40px; }
472+
.content .methods > div:not(.important-traits) {
473+
margin-left: 40px;
474+
margin-bottom: 15px;
475+
}
474476

475477
.content .impl-items .docblock, .content .impl-items .stability {
476478
margin-bottom: .6em;

src/librustdoc/html/static/storage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,4 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
6767
}
6868
}
6969

70-
switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'main');
70+
switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'light');

src/librustdoc/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ pub fn opts() -> Vec<RustcOptGroup> {
267267
unstable("resource-suffix", |o| {
268268
o.optopt("",
269269
"resource-suffix",
270-
"suffix to add to CSS and JavaScript files, e.g. \"main.css\" will become \
271-
\"main-suffix.css\"",
270+
"suffix to add to CSS and JavaScript files, e.g. \"light.css\" will become \
271+
\"light-suffix.css\"",
272272
"PATH")
273273
}),
274274
]
@@ -322,7 +322,7 @@ pub fn main_args(args: &[String]) -> isize {
322322

323323
let to_check = matches.opt_strs("theme-checker");
324324
if !to_check.is_empty() {
325-
let paths = theme::load_css_paths(include_bytes!("html/static/themes/main.css"));
325+
let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
326326
let mut errors = 0;
327327

328328
println!("rustdoc: [theme-checker] Starting tests!");
@@ -393,7 +393,7 @@ pub fn main_args(args: &[String]) -> isize {
393393

394394
let mut themes = Vec::new();
395395
if matches.opt_present("themes") {
396-
let paths = theme::load_css_paths(include_bytes!("html/static/themes/main.css"));
396+
let paths = theme::load_css_paths(include_bytes!("html/static/themes/light.css"));
397397

398398
for (theme_file, theme_s) in matches.opt_strs("themes")
399399
.iter()

src/test/codegen/stack-probes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ignore-mips
1414
// ignore-mips64
1515
// ignore-powerpc
16+
// ignore-s390x
1617
// ignore-wasm
1718
// ignore-emscripten
1819
// ignore-windows

src/test/run-pass/stack-probes-lto.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// ignore-aarch64
1313
// ignore-mips
1414
// ignore-mips64
15+
// ignore-powerpc
16+
// ignore-s390x
1517
// ignore-wasm
1618
// ignore-cloudabi no processes
1719
// ignore-emscripten no processes

src/test/run-pass/stack-probes.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// ignore-aarch64
1313
// ignore-mips
1414
// ignore-mips64
15+
// ignore-powerpc
16+
// ignore-s390x
1517
// ignore-wasm
1618
// ignore-cloudabi no processes
1719
// ignore-emscripten no processes

src/test/ui/suggestions/try-on-option.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | x?; //~ the trait bound
66
|
77
= note: required by `std::convert::From::from`
88

9-
error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
9+
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
1010
--> $DIR/try-on-option.rs:23:5
1111
|
1212
LL | x?; //~ the `?` operator

src/test/ui/suggestions/try-operator-on-main.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
1+
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
22
--> $DIR/try-operator-on-main.rs:19:5
33
|
44
LL | std::fs::File::open("foo")?; //~ ERROR the `?` operator can only

src/tools/error_index_generator/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl Formatter for HTMLFormatter {
6161
<head>
6262
<title>Rust Compiler Error Index</title>
6363
<meta charset="utf-8">
64-
<!-- Include rust.css after main.css so its rules take priority. -->
65-
<link rel="stylesheet" type="text/css" href="main.css"/>
64+
<!-- Include rust.css after light.css so its rules take priority. -->
65+
<link rel="stylesheet" type="text/css" href="light.css"/>
6666
<link rel="stylesheet" type="text/css" href="rust.css"/>
6767
<style>
6868
.error-undescribed {{

src/tools/rustdoc-themes/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fs::read_dir;
1313
use std::path::Path;
1414
use std::process::{Command, exit};
1515

16-
const FILES_TO_IGNORE: &[&str] = &["main.css"];
16+
const FILES_TO_IGNORE: &[&str] = &["light.css"];
1717

1818
fn get_folders<P: AsRef<Path>>(folder_path: P) -> Vec<String> {
1919
let mut ret = Vec::with_capacity(10);

0 commit comments

Comments
 (0)