Skip to content

Rollup of 10 pull requests #49489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Mar 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1f143bc
Explicitly mention `Option` in `?` error message.
frewsxcv Mar 28, 2018
93f96be
Fix tooltip position
GuillaumeGomez Mar 28, 2018
082e50d
Don't mention unstable constructors in release notes
tinaun Mar 28, 2018
77c70a8
rustbuild: Don't leak file handles when creating junctions on Windows
ollie27 Mar 28, 2018
262be13
Use f{32,64}::to_bits for is_zero test in vec::SpecFromElem
glandium Mar 29, 2018
6462c0b
Remove unnecessary use core::hash in liballoc/boxed.rs
glandium Mar 29, 2018
39fe29b
src/libcore/ptr.rs: Fix documentation for size of `Option<NonNull<T>>`
joshtriplett Mar 29, 2018
772a802
Rename main theme into light theme
GuillaumeGomez Mar 28, 2018
b404ec4
Ignore stack-probes tests on powerpc/s390x too
cuviper Mar 29, 2018
9a73bd9
correct a typo in RELEASES.md
oconnor663 Mar 29, 2018
3d316a5
Rollup merge of #49443 - GuillaumeGomez:fix-tooltip-position, r=Quiet…
kennytm Mar 29, 2018
eb3e2fe
Rollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavus
kennytm Mar 29, 2018
d06abdb
Rollup merge of #49446 - frewsxcv:frewsxcv-mention-optiono, r=Guillau…
kennytm Mar 29, 2018
07ea35f
Rollup merge of #49463 - tinaun:patch-2, r=alexcrichton
kennytm Mar 29, 2018
9ab97a8
Rollup merge of #49464 - ollie27:rustbuild_junction_handle_leak, r=al…
kennytm Mar 29, 2018
361ddfe
Rollup merge of #49466 - glandium:master, r=rkruppe
kennytm Mar 29, 2018
dd5f17a
Rollup merge of #49468 - glandium:cleanup, r=pnkfelix
kennytm Mar 29, 2018
801deae
Rollup merge of #49473 - joshtriplett:nonnull-size, r=steveklabnik
kennytm Mar 29, 2018
f1642f8
Rollup merge of #49484 - cuviper:ignore-ibm-stack-probes, r=alexcrichton
kennytm Mar 29, 2018
67e0c2b
Rollup merge of #49486 - oconnor663:releases_typo, r=steveklabnik
kennytm Mar 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Libraries
- [Implement libstd for CloudABI.][47268]
- [`Float::{from_bits, to_bits}` is now available in libcore.][46931]
- [Implement `AsRef<Path>` for Component][46985]
- [Implemented `Write` for `Cursor<&mut Vec<T>>`][46830]
- [Implemented `Write` for `Cursor<&mut Vec<u8>>`][46830]
- [Moved `Duration` to libcore.][46666]

Stabilized APIs
Expand All @@ -47,8 +47,6 @@ eg. `static MINUTE: Duration = Duration::from_secs(60);`
- [`Duration::new`][47300]
- [`Duration::from_secs`][47300]
- [`Duration::from_millis`][47300]
- [`Duration::from_micros`][47300]
- [`Duration::from_nanos`][47300]

Cargo
-----
Expand Down
7 changes: 5 additions & 2 deletions src/bootstrap/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ pub fn symlink_dir(src: &Path, dest: &Path) -> io::Result<()> {
nOutBufferSize: DWORD,
lpBytesReturned: LPDWORD,
lpOverlapped: LPOVERLAPPED) -> BOOL;
fn CloseHandle(hObject: HANDLE) -> BOOL;
}

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

if res == 0 {
let out = if res == 0 {
Err(io::Error::last_os_error())
} else {
Ok(())
}
};
CloseHandle(h);
out
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/doc/rustdoc/src/unstable-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ $ rustdoc src/lib.rs -Z unstable-options --themes theme.css

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

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

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

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use core::any::Any;
use core::borrow;
use core::cmp::Ordering;
use core::fmt;
use core::hash::{self, Hash, Hasher};
use core::hash::{Hash, Hasher};
use core::iter::FusedIterator;
use core::marker::{self, Unpin, Unsize};
use core::mem::{self, Pin};
Expand Down Expand Up @@ -508,7 +508,7 @@ impl<T: ?Sized + Eq> Eq for Box<T> {}

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized + Hash> Hash for Box<T> {
fn hash<H: hash::Hasher>(&self, state: &mut H) {
fn hash<H: Hasher>(&self, state: &mut H) {
(**self).hash(state);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1599,8 +1599,8 @@ impl_spec_from_elem!(u64, |x| x == 0);
impl_spec_from_elem!(u128, |x| x == 0);
impl_spec_from_elem!(usize, |x| x == 0);

impl_spec_from_elem!(f32, |x: f32| x == 0. && x.is_sign_positive());
impl_spec_from_elem!(f64, |x: f64| x == 0. && x.is_sign_positive());
impl_spec_from_elem!(f32, |x: f32| x.to_bits() == 0);
impl_spec_from_elem!(f64, |x: f64| x.to_bits() == 0);

////////////////////////////////////////////////////////////////////////////////
// Common trait implementations for Vec
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ops/try.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
any(from_method="from_error", from_method="from_ok"),
from_desugaring="?"),
message="the `?` operator can only be used in a \
function that returns `Result` \
function that returns `Result` or `Option` \
(or another type that implements `{Try}`)",
label="cannot use the `?` operator in a function that returns `{Self}`"),
on(all(from_method="into_result", from_desugaring="?"),
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2653,7 +2653,7 @@ impl<'a, T: ?Sized> From<NonNull<T>> for Unique<T> {
///
/// Unlike `*mut T`, the pointer must always be non-null, even if the pointer
/// is never dereferenced. This is so that enums may use this forbidden value
/// as a discriminant -- `Option<NonNull<T>>` has the same size as `NonNull<T>`.
/// as a discriminant -- `Option<NonNull<T>>` has the same size as `*mut T`.
/// However the pointer may still dangle if it isn't dereferenced.
///
/// Unlike `*mut T`, `NonNull<T>` is covariant over `T`. If this is incorrect
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ r##"<!DOCTYPE html>
id="mainThemeStyle">
{themes}
<link rel="stylesheet" type="text/css" href="{root_path}dark{suffix}.css">
<link rel="stylesheet" type="text/css" href="{root_path}main{suffix}.css" id="themeStyle">
<link rel="stylesheet" type="text/css" href="{root_path}light{suffix}.css" id="themeStyle">
<script src="{root_path}storage{suffix}.js"></script>
{css_extension}

Expand Down
12 changes: 6 additions & 6 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ pub struct SharedContext {
pub sort_modules_alphabetically: bool,
/// Additional themes to be added to the generated docs.
pub themes: Vec<PathBuf>,
/// Suffix to be added on resource files (if suffix is "-v2" then "main.css" becomes
/// "main-v2.css").
/// Suffix to be added on resource files (if suffix is "-v2" then "light.css" becomes
/// "light-v2.css").
pub resource_suffix: String,
}

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

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

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

write(cx.dst.join(&format!("brush{}.svg", cx.shared.resource_suffix)),
include_bytes!("static/brush.svg"))?;
write(cx.dst.join(&format!("main{}.css", cx.shared.resource_suffix)),
include_bytes!("static/themes/main.css"))?;
themes.insert("main".to_owned());
write(cx.dst.join(&format!("light{}.css", cx.shared.resource_suffix)),
include_bytes!("static/themes/light.css"))?;
themes.insert("light".to_owned());
write(cx.dst.join(&format!("dark{}.css", cx.shared.resource_suffix)),
include_bytes!("static/themes/dark.css"))?;
themes.insert("dark".to_owned());
Expand Down
6 changes: 4 additions & 2 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ h3.impl, h3.method, h4.method, h3.type, h4.type, h4.associatedconstant {
position: relative;
}
h3.impl, h3.method, h3.type {
margin-top: 15px;
padding-left: 15px;
}

Expand Down Expand Up @@ -470,7 +469,10 @@ h4 > code, h3 > code, .invisible > code {
font-size: 0.8em;
}

.content .methods > div:not(.important-traits) { margin-left: 40px; }
.content .methods > div:not(.important-traits) {
margin-left: 40px;
margin-bottom: 15px;
}

.content .impl-items .docblock, .content .impl-items .stability {
margin-bottom: .6em;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ function switchTheme(styleElem, mainStyleElem, newTheme) {
}
}

switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'main');
switchTheme(currentTheme, mainTheme, getCurrentValue('rustdoc-theme') || 'light');
8 changes: 4 additions & 4 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ pub fn opts() -> Vec<RustcOptGroup> {
unstable("resource-suffix", |o| {
o.optopt("",
"resource-suffix",
"suffix to add to CSS and JavaScript files, e.g. \"main.css\" will become \
\"main-suffix.css\"",
"suffix to add to CSS and JavaScript files, e.g. \"light.css\" will become \
\"light-suffix.css\"",
"PATH")
}),
]
Expand Down Expand Up @@ -322,7 +322,7 @@ pub fn main_args(args: &[String]) -> isize {

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

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

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

for (theme_file, theme_s) in matches.opt_strs("themes")
.iter()
Expand Down
1 change: 1 addition & 0 deletions src/test/codegen/stack-probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-s390x
// ignore-wasm
// ignore-emscripten
// ignore-windows
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/stack-probes-lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-s390x
// ignore-wasm
// ignore-cloudabi no processes
// ignore-emscripten no processes
Expand Down
2 changes: 2 additions & 0 deletions src/test/run-pass/stack-probes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// ignore-aarch64
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-s390x
// ignore-wasm
// ignore-cloudabi no processes
// ignore-emscripten no processes
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/suggestions/try-on-option.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LL | x?; //~ the trait bound
|
= note: required by `std::convert::From::from`

error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/try-on-option.rs:23:5
|
LL | x?; //~ the `?` operator
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/suggestions/try-operator-on-main.stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
error[E0277]: the `?` operator can only be used in a function that returns `Result` (or another type that implements `std::ops::Try`)
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/try-operator-on-main.rs:19:5
|
LL | std::fs::File::open("foo")?; //~ ERROR the `?` operator can only
Expand Down
4 changes: 2 additions & 2 deletions src/tools/error_index_generator/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ impl Formatter for HTMLFormatter {
<head>
<title>Rust Compiler Error Index</title>
<meta charset="utf-8">
<!-- Include rust.css after main.css so its rules take priority. -->
<link rel="stylesheet" type="text/css" href="main.css"/>
<!-- Include rust.css after light.css so its rules take priority. -->
<link rel="stylesheet" type="text/css" href="light.css"/>
<link rel="stylesheet" type="text/css" href="rust.css"/>
<style>
.error-undescribed {{
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rustdoc-themes/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::fs::read_dir;
use std::path::Path;
use std::process::{Command, exit};

const FILES_TO_IGNORE: &[&str] = &["main.css"];
const FILES_TO_IGNORE: &[&str] = &["light.css"];

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