Skip to content

Commit

Permalink
Auto merge of #58189 - kennytm:rollup, r=kennytm
Browse files Browse the repository at this point in the history
Rollup of 23 pull requests

Successful merges:

 - #58001 (proc_macro: make `TokenStream::from_streams` pre-allocate its vector.)
 - #58096 (Transition linkchecker to 2018 edition)
 - #58097 (Transition remote test to Rust 2018)
 - #58106 (libfmt_macros => 2018)
 - #58107 (libgraphviz => 2018)
 - #58108 (Add NVPTX target to a build manifest)
 - #58109 (librustc_privacy => 2018)
 - #58112 (libpanic_abort => 2018)
 - #58113 (Transition build-manifest to 2018 edition)
 - #58114 (Transition tidy and unstable-book-gen to 2018 edition)
 - #58116 (Include the span of attributes of the lhs to the span of the assignment expression)
 - #58117 (Transition rustdoc-theme to 2018 edition)
 - #58128 (libunwind => 2018)
 - #58138 (Fix #58101)
 - #58139 (hir: add more HirId methods)
 - #58141 (Remove weasel word in docs for iter's take_while())
 - #58142 (Remove stray FIXME)
 - #58145 (Add #[must_use] to core::task::Poll)
 - #58162 (Add more debugging code to track down appveyor 259 exit code)
 - #58169 (Update contributor name in .mailmap)
 - #58172 (update split docs)
 - #58182 (SGX target: handle empty user buffers correctly)
 - #58186 (Add Rustlings to the doc index)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Feb 5, 2019
2 parents b2c6b8c + c23871a commit 8bf7fda
Show file tree
Hide file tree
Showing 40 changed files with 188 additions and 62 deletions.
1 change: 1 addition & 0 deletions .mailmap
Expand Up @@ -155,6 +155,7 @@ Matt Brubeck <mbrubeck@limpet.net> <mbrubeck@cs.hmc.edu>
Matthew Auld <matthew.auld@intel.com>
Matthew McPherrin <matthew@mcpherrin.ca> <matt@mcpherrin.ca>
Matthijs Hofstra <thiezz@gmail.com>
Melody Horn <melody@boringcactus.com> <mathphreak@gmail.com>
Michael Williams <m.t.williams@live.com>
Michael Woerister <michaelwoerister@posteo> <michaelwoerister@gmail>
Mickaël Raybaud-Roig <raybaudroigm@gmail.com> m-r-r <raybaudroigm@gmail.com>
Expand Down
5 changes: 4 additions & 1 deletion appveyor.yml
Expand Up @@ -207,7 +207,10 @@ test_script:
- sh src/ci/init_repo.sh . /c/cache/rustsrc
- set SRC=.
- set NO_CCACHE=1
- sh src/ci/run.sh
# Added this debugging code to try tracking down https://github.com/rust-lang/rust/issues/58160
# Replace it with the commented line below after the issue with AppVeyor is fixed
- "sh src/ci/run.sh & set ret=%errorlevel% & echo exit code in appveyor.yml: %ret% & exit %ret%"
# - sh src/ci/run.sh

on_failure:
# Dump crash log
Expand Down
8 changes: 7 additions & 1 deletion src/ci/run.sh
Expand Up @@ -127,7 +127,13 @@ if [ ! -z "$SCRIPT" ]; then
set +e
sh -x -c "$SCRIPT"
ret=$?
echo "script exited with $ret"
echo "exit code in src/ci/run.sh: $ret"

echo "tasklist:"
tasklist
echo -n "location of sh: "
where sh

exit $ret
else
do_make() {
Expand Down
6 changes: 6 additions & 0 deletions src/doc/index.md
Expand Up @@ -52,6 +52,12 @@ If reading multiple hundreds of pages about a language isn't your style, then
a lot of words, RBE shows off a bunch of code, and keeps the talking to a
minimum. It also includes exercises!

## Rustlings

[Rustlings](https://github.com/rust-lang/rustlings) guides you through downloading and setting up the Rust toolchain,
and teaches you the basics of reading and writing Rust syntax. It's an
alternative to Rust by Example that works with your own environment.

# Use Rust

Once you've gotten familiar with the language, these resources can help you
Expand Down
3 changes: 1 addition & 2 deletions src/libcore/iter/traits/iterator.rs
Expand Up @@ -952,8 +952,7 @@ pub trait Iterator {
/// ```
///
/// The `3` is no longer there, because it was consumed in order to see if
/// the iteration should stop, but wasn't placed back into the iterator or
/// some similar thing.
/// the iteration should stop, but wasn't placed back into the iterator.
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> where
Expand Down
28 changes: 14 additions & 14 deletions src/libcore/str/mod.rs
Expand Up @@ -2961,8 +2961,8 @@ impl str {
/// An iterator over substrings of this string slice, separated by
/// characters matched by a pattern.
///
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
///
/// # Iterator behavior
///
Expand Down Expand Up @@ -3078,8 +3078,8 @@ impl str {
/// An iterator over substrings of the given string slice, separated by
/// characters matched by a pattern and yielded in reverse order.
///
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
///
/// # Iterator behavior
///
Expand Down Expand Up @@ -3128,8 +3128,8 @@ impl str {
/// An iterator over substrings of the given string slice, separated by
/// characters matched by a pattern.
///
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
///
/// Equivalent to [`split`], except that the trailing substring
/// is skipped if empty.
Expand Down Expand Up @@ -3175,8 +3175,8 @@ impl str {
/// An iterator over substrings of `self`, separated by characters
/// matched by a pattern and yielded in reverse order.
///
/// The pattern can be a simple `&str`, [`char`], or a closure that
/// determines the split.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
Expand Down Expand Up @@ -3222,8 +3222,8 @@ impl str {
/// If `n` substrings are returned, the last substring (the `n`th substring)
/// will contain the remainder of the string.
///
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
///
/// # Iterator behavior
///
Expand Down Expand Up @@ -3275,8 +3275,8 @@ impl str {
/// If `n` substrings are returned, the last substring (the `n`th substring)
/// will contain the remainder of the string.
///
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines the split.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
///
/// # Iterator behavior
///
Expand Down Expand Up @@ -3319,8 +3319,8 @@ impl str {
/// An iterator over the disjoint matches of a pattern within the given string
/// slice.
///
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines if a character matches.
/// The pattern can be any type that implements the Pattern trait. Notable
/// examples are `&str`, [`char`], and closures that determines the split.
///
/// # Iterator behavior
///
Expand Down
1 change: 1 addition & 0 deletions src/libcore/task/poll.rs
Expand Up @@ -7,6 +7,7 @@ use result::Result;

/// Indicates whether a value is available or if the current task has been
/// scheduled to receive a wakeup instead.
#[must_use = "this `Poll` may be a `Pending` variant, which should be handled"]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub enum Poll<T> {
/// Represents that a value is immediately ready.
Expand Down
1 change: 1 addition & 0 deletions src/libfmt_macros/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "fmt_macros"
version = "0.0.0"
edition = "2018"

[lib]
name = "fmt_macros"
Expand Down
13 changes: 7 additions & 6 deletions src/libfmt_macros/lib.rs
Expand Up @@ -10,14 +10,15 @@
html_playground_url = "https://play.rust-lang.org/",
test(attr(deny(warnings))))]

#![feature(nll)]
#![deny(rust_2018_idioms)]

#![feature(rustc_private)]

pub use self::Piece::*;
pub use self::Position::*;
pub use self::Alignment::*;
pub use self::Flag::*;
pub use self::Count::*;
pub use Piece::*;
pub use Position::*;
pub use Alignment::*;
pub use Flag::*;
pub use Count::*;

use std::str;
use std::string;
Expand Down
1 change: 1 addition & 0 deletions src/libgraphviz/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "graphviz"
version = "0.0.0"
edition = "2018"

[lib]
name = "graphviz"
Expand Down
11 changes: 6 additions & 5 deletions src/libgraphviz/lib.rs
Expand Up @@ -276,10 +276,11 @@
html_root_url = "https://doc.rust-lang.org/nightly/",
test(attr(allow(unused_variables), deny(warnings))))]

#![feature(nll)]
#![deny(rust_2018_idioms)]

#![feature(str_escape)]

use self::LabelText::*;
use LabelText::*;

use std::borrow::Cow;
use std::io::prelude::*;
Expand Down Expand Up @@ -548,12 +549,12 @@ impl<'a> LabelText<'a> {
}

/// Puts `prefix` on a line above this label, with a blank line separator.
pub fn prefix_line(self, prefix: LabelText) -> LabelText<'static> {
pub fn prefix_line(self, prefix: LabelText<'_>) -> LabelText<'static> {
prefix.suffix_line(self)
}

/// Puts `suffix` on a line below this label, with a blank line separator.
pub fn suffix_line(self, suffix: LabelText) -> LabelText<'static> {
pub fn suffix_line(self, suffix: LabelText<'_>) -> LabelText<'static> {
let mut prefix = self.pre_escaped_content().into_owned();
let suffix = suffix.pre_escaped_content();
prefix.push_str(r"\n\n");
Expand Down Expand Up @@ -686,7 +687,7 @@ pub fn render_opts<'a, N, E, G, W>(g: &'a G,

#[cfg(test)]
mod tests {
use self::NodeLabels::*;
use NodeLabels::*;
use super::{Id, Labeller, Nodes, Edges, GraphWalk, render, Style};
use super::LabelText::{self, LabelStr, EscStr, HtmlStr};
use std::io;
Expand Down
1 change: 1 addition & 0 deletions src/libpanic_abort/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "panic_abort"
version = "0.0.0"
edition = "2018"

[lib]
path = "lib.rs"
Expand Down
4 changes: 2 additions & 2 deletions src/libpanic_abort/lib.rs
Expand Up @@ -10,11 +10,12 @@
html_root_url = "https://doc.rust-lang.org/nightly/",
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
#![panic_runtime]

#![allow(unused_features)]
#![deny(rust_2018_idioms)]

#![feature(core_intrinsics)]
#![feature(libc)]
#![feature(nll)]
#![feature(panic_runtime)]
#![feature(staged_api)]
#![feature(rustc_attrs)]
Expand Down Expand Up @@ -46,7 +47,6 @@ pub unsafe extern fn __rust_start_panic(_payload: usize) -> u32 {

#[cfg(any(unix, target_os = "cloudabi"))]
unsafe fn abort() -> ! {
extern crate libc;
libc::abort();
}

Expand Down
60 changes: 60 additions & 0 deletions src/librustc/hir/map/mod.rs
Expand Up @@ -401,6 +401,12 @@ impl<'hir> Map<'hir> {
}
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn describe_def_by_hir_id(&self, hir_id: HirId) -> Option<Def> {
let node_id = self.hir_to_node_id(hir_id);
self.describe_def(node_id)
}

fn entry_count(&self) -> usize {
self.map.len()
}
Expand Down Expand Up @@ -445,6 +451,12 @@ impl<'hir> Map<'hir> {
}
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn fn_decl_by_hir_id(&self, hir_id: HirId) -> Option<FnDecl> {
let node_id = self.hir_to_node_id(hir_id);
self.fn_decl(node_id)
}

/// Returns the `NodeId` that corresponds to the definition of
/// which this is the body of, i.e., a `fn`, `const` or `static`
/// item (possibly associated), a closure, or a `hir::AnonConst`.
Expand Down Expand Up @@ -855,6 +867,12 @@ impl<'hir> Map<'hir> {
self.local_def_id(self.get_parent(id))
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn get_parent_did_by_hir_id(&self, id: HirId) -> DefId {
let node_id = self.hir_to_node_id(id);
self.get_parent_did(node_id)
}

pub fn get_foreign_abi(&self, id: NodeId) -> Abi {
let parent = self.get_parent(id);
if let Some(entry) = self.find_entry(parent) {
Expand All @@ -868,6 +886,12 @@ impl<'hir> Map<'hir> {
bug!("expected foreign mod or inlined parent, found {}", self.node_to_string(parent))
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn get_foreign_abi_by_hir_id(&self, id: HirId) -> Abi {
let node_id = self.hir_to_node_id(id);
self.get_foreign_abi(node_id)
}

pub fn expect_item(&self, id: NodeId) -> &'hir Item {
match self.find(id) { // read recorded by `find`
Some(Node::Item(item)) => item,
Expand All @@ -888,6 +912,18 @@ impl<'hir> Map<'hir> {
}
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn expect_impl_item_by_hir_id(&self, id: HirId) -> &'hir ImplItem {
let node_id = self.hir_to_node_id(id);
self.expect_impl_item(node_id)
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn expect_trait_item_by_hir_id(&self, id: HirId) -> &'hir TraitItem {
let node_id = self.hir_to_node_id(id);
self.expect_trait_item(node_id)
}

pub fn expect_trait_item(&self, id: NodeId) -> &'hir TraitItem {
match self.find(id) {
Some(Node::TraitItem(item)) => item,
Expand Down Expand Up @@ -931,6 +967,12 @@ impl<'hir> Map<'hir> {
}
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn expect_expr_by_hir_id(&self, id: HirId) -> &'hir Expr {
let node_id = self.hir_to_node_id(id);
self.expect_expr(node_id)
}

/// Returns the name associated with the given NodeId's AST.
pub fn name(&self, id: NodeId) -> Name {
match self.get(id) {
Expand All @@ -948,6 +990,12 @@ impl<'hir> Map<'hir> {
}
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn name_by_hir_id(&self, id: HirId) -> Name {
let node_id = self.hir_to_node_id(id);
self.name(node_id)
}

/// Given a node ID, get a list of attributes associated with the AST
/// corresponding to the Node ID
pub fn attrs(&self, id: NodeId) -> &'hir [ast::Attribute] {
Expand All @@ -970,6 +1018,12 @@ impl<'hir> Map<'hir> {
attrs.unwrap_or(&[])
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn attrs_by_hir_id(&self, id: HirId) -> &'hir [ast::Attribute] {
let node_id = self.hir_to_node_id(id);
self.attrs(node_id)
}

/// Returns an iterator that yields the node id's with paths that
/// match `parts`. (Requires `parts` is non-empty.)
///
Expand Down Expand Up @@ -1019,6 +1073,12 @@ impl<'hir> Map<'hir> {
}
}

// FIXME(@ljedrz): replace the NodeId variant
pub fn span_by_hir_id(&self, id: HirId) -> Span {
let node_id = self.hir_to_node_id(id);
self.span(node_id)
}

pub fn span_if_local(&self, id: DefId) -> Option<Span> {
self.as_local_node_id(id).map(|id| self.span(id))
}
Expand Down
4 changes: 3 additions & 1 deletion src/librustc/middle/stability.rs
Expand Up @@ -765,7 +765,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
}
}
EvalResult::Unmarked => {
span_bug!(span, "encountered unmarked API: {:?}", def_id);
// The API could be uncallable for other reasons, for example when a private module
// was referenced.
self.sess.delay_span_bug(span, &format!("encountered unmarked API: {:?}", def_id));
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_privacy/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
authors = ["The Rust Project Developers"]
name = "rustc_privacy"
version = "0.0.0"
edition = "2018"

[lib]
name = "rustc_privacy"
Expand Down

0 comments on commit 8bf7fda

Please sign in to comment.