Skip to content
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

Rollup of 8 pull requests #49744

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
211 changes: 211 additions & 0 deletions src/Cargo.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,10 +770,7 @@ def bootstrap(help_triggered):
if 'dev' in data:
build.set_dev_environment()

# No help text depends on submodules. This check saves ~1 minute of git commands, even if
# all the submodules are present and downloaded!
if not help_triggered:
build.update_submodules()
build.update_submodules()

# Fetch/build the bootstrap
build.build = args.build or build.build_triple()
Expand Down
6 changes: 6 additions & 0 deletions src/ci/docker/wasm32-unknown/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ ENV RUST_CONFIGURE_ARGS \
--set build.nodejs=/node-v9.2.0-linux-x64/bin/node \
--set rust.lld

# Some run-make tests have assertions about code size, and enabling debug
# assertions in libstd causes the binary to be much bigger than it would
# otherwise normally be. We already test libstd with debug assertions in lots of
# other contexts as well
ENV NO_DEBUG_ASSERTIONS=1

ENV SCRIPT python2.7 /checkout/x.py test --target $TARGETS \
src/test/run-make \
src/test/ui \
Expand Down
24 changes: 12 additions & 12 deletions src/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,65 +13,65 @@ unofficial documentation resources as well!
Many of these resources take the form of "books"; we collectively call these
"The Rust Bookshelf." Some are large, some are small.

## Learn Rust
# Learn Rust

If you'd like to learn Rust, this is the spot for you! All of these resources
assume that you have programmed before, but not in any specific language:

### The Rust Programming Language
## The Rust Programming Language

Affectionately nicknamed "the book," [The Rust Programming
Language](book/index.html) will give you an overview of the language from
first principles. You'll build a few projects along the way, and by the end,
you'll have a solid grasp of the language.

### Rust By Example
## Rust By Example

If reading multiple hundreds of pages about a language isn't your style, then
[Rust By Example](rust-by-example/index.html) has you covered. While the book talks about code with
a lot of words, RBE shows off a bunch of code, and keeps the talking to a
minimum. It also includes exercises!

## Use Rust
# Use Rust

Once you've gotten familliar with the language, these resources can help you
when you're actually using it day-to-day.

### The Standard Library
## The Standard Library

Rust's standard library has [extensive API documentation](std/index.html),
with explanations of how to use various things, as well as example code for
accomplishing various tasks.

### The Cargo Book
## The Cargo Book

[The Cargo Book](cargo/index.html) is a guide to Cargo, Rust's build tool and dependency manager.

### The Rustdoc Book
## The Rustdoc Book

[The Rustdoc Book](rustdoc/index.html) describes our documentation tool, `rustdoc`.

### Extended Error Listing
## Extended Error Listing

Many of Rust's errors come with error codes, and you can request extended
diagnostics from the compiler on those errors. You can also [read them
here](error-index.html), if you prefer to read them that way.

## Master Rust
# Master Rust

Once you're quite familiar with the language, you may find these advanced
resources useful.

### The Reference
## The Reference

[The Reference](reference/index.html) is not a formal spec, but is more detailed and
comprehensive than the book.

### The Rustonomicon
## The Rustonomicon

[The Rustonomicon](nomicon/index.html) is your guidebook to the dark arts of unsafe
Rust. It's also sometimes called "the 'nomicon."

### The Unstable Book
## The Unstable Book

[The Unstable Book](unstable-book/index.html) has documentation for unstable features.
10 changes: 10 additions & 0 deletions src/libcore/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,13 @@ impl<'a> fmt::Display for Location<'a> {
write!(formatter, "{}:{}:{}", self.file, self.line, self.col)
}
}

/// An internal trait used by libstd to pass data from libstd to `panic_unwind`
/// and other panic runtimes. Not intended to be stabilized any time soon, do
/// not use.
#[unstable(feature = "std_internals", issue = "0")]
#[doc(hidden)]
pub unsafe trait BoxMeUp {
fn box_me_up(&mut self) -> *mut (Any + Send);
fn get(&self) -> &(Any + Send);
}
2 changes: 1 addition & 1 deletion src/libpanic_abort/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub unsafe extern fn __rust_maybe_catch_panic(f: fn(*mut u8),
// now hopefully.
#[no_mangle]
#[rustc_std_internal_symbol]
pub unsafe extern fn __rust_start_panic(_data: usize, _vtable: usize) -> u32 {
pub unsafe extern fn __rust_start_panic(_payload: usize) -> u32 {
abort();

#[cfg(any(unix, target_os = "cloudabi"))]
Expand Down
12 changes: 7 additions & 5 deletions src/libpanic_unwind/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
#![deny(warnings)]

#![feature(allocator_api)]
#![feature(alloc)]
#![feature(core_intrinsics)]
#![feature(lang_items)]
#![feature(libc)]
#![feature(panic_unwind)]
#![feature(raw)]
#![feature(staged_api)]
#![feature(std_internals)]
#![feature(unwind_attributes)]
#![cfg_attr(target_env = "msvc", feature(raw))]

Expand All @@ -48,9 +50,11 @@ extern crate libc;
#[cfg(not(any(target_env = "msvc", all(windows, target_arch = "x86_64", target_env = "gnu"))))]
extern crate unwind;

use alloc::boxed::Box;
use core::intrinsics;
use core::mem;
use core::raw;
use core::panic::BoxMeUp;

// Rust runtime's startup objects depend on these symbols, so make them public.
#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
Expand Down Expand Up @@ -114,9 +118,7 @@ pub unsafe extern "C" fn __rust_maybe_catch_panic(f: fn(*mut u8),
#[no_mangle]
#[cfg_attr(stage0, unwind)]
#[cfg_attr(not(stage0), unwind(allowed))]
pub unsafe extern "C" fn __rust_start_panic(data: usize, vtable: usize) -> u32 {
imp::panic(mem::transmute(raw::TraitObject {
data: data as *mut (),
vtable: vtable as *mut (),
}))
pub unsafe extern "C" fn __rust_start_panic(payload: usize) -> u32 {
let payload = payload as *mut &mut BoxMeUp;
imp::panic(Box::from_raw((*payload).box_me_up()))
}
30 changes: 21 additions & 9 deletions src/librustdoc/html/static/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,14 @@
};
}

function getPageId() {
var id = document.location.href.split('#')[1];
if (id) {
return id.split('?')[0].split('&')[0];
}
return null;
}

function hasClass(elem, className) {
if (elem && className && elem.className) {
var elemClass = elem.className;
Expand Down Expand Up @@ -1643,7 +1651,7 @@
}
}

function toggleAllDocs() {
function toggleAllDocs(pageId) {
var toggle = document.getElementById("toggle-all-docs");
if (hasClass(toggle, "will-expand")) {
updateLocalStorage("rustdoc-collapse", "false");
Expand All @@ -1664,12 +1672,12 @@
toggle.title = "expand all docs";

onEach(document.getElementsByClassName("collapse-toggle"), function(e) {
collapseDocs(e, "hide");
collapseDocs(e, "hide", pageId);
});
}
}

function collapseDocs(toggle, mode) {
function collapseDocs(toggle, mode, pageId) {
if (!toggle || !toggle.parentNode) {
return;
}
Expand Down Expand Up @@ -1745,14 +1753,18 @@
}
}

var relatedDoc = toggle.parentNode;
var parentElem = toggle.parentNode;
var relatedDoc = parentElem;
var docblock = relatedDoc.nextElementSibling;

while (!hasClass(relatedDoc, "impl-items")) {
relatedDoc = relatedDoc.nextElementSibling;
}

if (!relatedDoc && !hasClass(docblock, "docblock")) {
if ((!relatedDoc && !hasClass(docblock, "docblock")) ||
(pageId && onEach(relatedDoc.childNodes, function(e) {
return e.id === pageId;
}) === true)) {
return;
}

Expand Down Expand Up @@ -1782,15 +1794,15 @@
}
}

function autoCollapseAllImpls() {
function autoCollapseAllImpls(pageId) {
// Automatically minimize all non-inherent impls
onEach(document.getElementsByClassName('impl'), function(n) {
// inherent impl ids are like 'impl' or impl-<number>'
var inherent = (n.id.match(/^impl(?:-\d+)?$/) !== null);
if (!inherent) {
onEach(n.childNodes, function(m) {
if (hasClass(m, "collapse-toggle")) {
collapseDocs(m, "hide");
collapseDocs(m, "hide", pageId);
}
});
}
Expand Down Expand Up @@ -1900,7 +1912,7 @@
}
})

autoCollapseAllImpls();
autoCollapseAllImpls(getPageId());

function createToggleWrapper() {
var span = document.createElement('span');
Expand Down Expand Up @@ -2030,7 +2042,7 @@
};

if (getCurrentValue("rustdoc-collapse") === "true") {
toggleAllDocs();
toggleAllDocs(getPageId());
}
}());

Expand Down
3 changes: 3 additions & 0 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ a {
left: -5px;
}
.small-section-header > .anchor {
left: -20px;
}
.small-section-header > .anchor:not(.field) {
left: -28px;
}
.anchor:before {
Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ function onEach(arr, func) {
if (arr && arr.length > 0 && func) {
for (var i = 0; i < arr.length; i++) {
if (func(arr[i]) === true) {
break;
return true;
}
}
}
return false;
}

function updateLocalStorage(name, value) {
Expand Down
1 change: 1 addition & 0 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
#![feature(rand)]
#![feature(raw)]
#![feature(rustc_attrs)]
#![feature(std_internals)]
#![feature(stdsimd)]
#![feature(shrink_to)]
#![feature(slice_bytes)]
Expand Down
Loading