Skip to content

Rollup of 10 pull requests #53150

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 21 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4897820
Remove unused arguments
Mark-Simulacrum Jul 30, 2018
33483fa
fixed broken links to char
r3drock Aug 4, 2018
6169707
deleted changed lines
r3drock Aug 4, 2018
79289b9
cleanup: Remove `Def::GlobalAsm`
petrochenkov Jul 30, 2018
3f92ff3
Change rustdoc style so fully qualified names do not overlap src links
iliekturtles Aug 4, 2018
3d44da6
Enable macros to pass $:literal to another macro
0e4ef622 Aug 5, 2018
60aa11d
Rename Executor trait to Spawn
MajorBreakfast Aug 6, 2018
a92b5cc
Remove references to `StaticMutex` which got removed a while ago
RalfJung Aug 6, 2018
d8e8a50
Building librustc_codegen_llvm in a separate directory
Mark-Simulacrum Aug 3, 2018
1fd8e57
Rust 2018: Disable catch_expr, not targeted for 2018 edition
joshtriplett Aug 6, 2018
ce1def1
set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target
danc86 Aug 6, 2018
4176888
Rollup merge of #52885 - Mark-Simulacrum:cleanup-typeck, r=nikomatsakis
kennytm Aug 7, 2018
2c388e0
Rollup merge of #52886 - petrochenkov:noga, r=alexcrichton
kennytm Aug 7, 2018
35d752f
Rollup merge of #53028 - Mark-Simulacrum:split-out-codegen, r=alexcri…
kennytm Aug 7, 2018
b1ca710
Rollup merge of #53052 - redroc:master, r=QuietMisdreavus
kennytm Aug 7, 2018
25e3290
Rollup merge of #53060 - iliekturtles:rustdoc-style, r=GuillaumeGomez
kennytm Aug 7, 2018
3385cae
Rollup merge of #53068 - MajorBreakfast:spawn, r=cramertj
kennytm Aug 7, 2018
c122061
Rollup merge of #53093 - 0e4ef622:issue-52169-fix, r=petrochenkov
kennytm Aug 7, 2018
a5cd4b5
Rollup merge of #53107 - RalfJung:static-mutex, r=alexcrichton
kennytm Aug 7, 2018
9da780d
Rollup merge of #53135 - joshtriplett:remove-catch-from-2018-preview,…
kennytm Aug 7, 2018
d9e9230
Rollup merge of #53139 - danc86:riscv-no-gdb-scripts, r=petrochenkov
kennytm Aug 7, 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
20 changes: 0 additions & 20 deletions src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2184,30 +2184,10 @@ dependencies = [
name = "rustc_codegen_llvm"
version = "0.0.0"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
"rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_allocator 0.0.0",
"rustc_apfloat 0.0.0",
"rustc_codegen_utils 0.0.0",
"rustc_data_structures 0.0.0",
"rustc_errors 0.0.0",
"rustc_incremental 0.0.0",
"rustc_llvm 0.0.0",
"rustc_mir 0.0.0",
"rustc_platform_intrinsics 0.0.0",
"rustc_target 0.0.0",
"serialize 0.0.0",
"syntax 0.0.0",
"syntax_pos 0.0.0",
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand Down
6 changes: 4 additions & 2 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,18 @@ impl Step for CodegenBackend {
let target = self.target;
let backend = self.backend;

let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));

let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check");
let features = builder.rustc_features().to_string();
cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
rustc_cargo_env(builder, &mut cargo);

// We won't build LLVM if it's not available, as it shouldn't affect `check`.

let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
run_cargo(builder,
cargo.arg("--features").arg(features),
&mut cargo,
&codegen_backend_stamp(builder, compiler, target, backend),
true);
}
Expand Down
9 changes: 5 additions & 4 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -670,16 +670,17 @@ impl Step for CodegenBackend {
return;
}

let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));

let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build");
let mut features = builder.rustc_features().to_string();
cargo.arg("--manifest-path")
.arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
rustc_cargo_env(builder, &mut cargo);

features += &build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);
let features = build_codegen_backend(&builder, &mut cargo, &compiler, target, backend);

let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target)
.join(".tmp.stamp");
let tmp_stamp = out_dir.join(".tmp.stamp");

let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
let files = run_cargo(builder,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,8 @@ impl Build {
let suffix = match mode {
Mode::Std => "-std",
Mode::Test => "-test",
Mode::Codegen => "-rustc",
Mode::Rustc => "-rustc",
Mode::Codegen => "-codegen",
Mode::ToolBootstrap => "-bootstrap-tools",
Mode::ToolStd => "-tools",
Mode::ToolRustc => "-tools",
Expand Down
13 changes: 8 additions & 5 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use core::marker::{Unpin, Unsize};
use core::mem::{self, PinMut};
use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState};
use core::ptr::{self, NonNull, Unique};
use core::task::{Context, Poll, Executor, SpawnErrorKind, SpawnObjError};
use core::task::{Context, Poll, Spawn, SpawnErrorKind, SpawnObjError};

use raw_vec::RawVec;
use str::from_boxed_utf8_unchecked;
Expand Down Expand Up @@ -973,11 +973,14 @@ unsafe impl<'a, T, F> UnsafeFutureObj<'a, T> for PinBox<F>
}

#[unstable(feature = "futures_api", issue = "50547")]
impl<E> Executor for Box<E>
where E: Executor + ?Sized
impl<Sp> Spawn for Box<Sp>
where Sp: Spawn + ?Sized
{
fn spawn_obj(&mut self, task: FutureObj<'static, ()>) -> Result<(), SpawnObjError> {
(**self).spawn_obj(task)
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>,
) -> Result<(), SpawnObjError> {
(**self).spawn_obj(future)
}

fn status(&self) -> Result<(), SpawnErrorKind> {
Expand Down
33 changes: 0 additions & 33 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2117,8 +2117,6 @@ impl str {
/// This length is in bytes, not [`char`]s or graphemes. In other words,
/// it may not be what a human considers the length of the string.
///
/// [`char`]: primitive.char.html
///
/// # Examples
///
/// Basic usage:
Expand Down Expand Up @@ -2590,8 +2588,6 @@ impl str {
/// Value, and may not match your idea of what a 'character' is. Iteration
/// over grapheme clusters may be what you actually want.
///
/// [`char`]: primitive.char.html
///
/// # Examples
///
/// Basic usage:
Expand Down Expand Up @@ -2643,8 +2639,6 @@ impl str {
/// The iterator yields tuples. The position is first, the [`char`] is
/// second.
///
/// [`char`]: primitive.char.html
///
/// # Examples
///
/// Basic usage:
Expand Down Expand Up @@ -2946,7 +2940,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
/// [`char`]: primitive.char.html
/// [`None`]: option/enum.Option.html#variant.None
///
/// # Examples
Expand Down Expand Up @@ -2994,7 +2987,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
/// [`char`]: primitive.char.html
/// [`None`]: option/enum.Option.html#variant.None
///
/// # Examples
Expand Down Expand Up @@ -3050,7 +3042,6 @@ impl str {
/// If the pattern allows a reverse search but its results might differ
/// from a forward search, the [`rsplit`] method can be used.
///
/// [`char`]: primitive.char.html
/// [`rsplit`]: #method.rsplit
///
/// # Examples
Expand Down Expand Up @@ -3157,8 +3148,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator requires that the pattern supports a reverse
Expand Down Expand Up @@ -3224,7 +3213,6 @@ impl str {
/// elements. This is true for, eg, [`char`] but not for `&str`.
///
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
/// [`char`]: primitive.char.html
///
/// If the pattern allows a reverse search but its results might differ
/// from a forward search, the [`rsplit_terminator`] method can be used.
Expand Down Expand Up @@ -3259,8 +3247,6 @@ impl str {
/// Additional libraries might provide more complex patterns like
/// regular expressions.
///
/// [`char`]: primitive.char.html
///
/// Equivalent to [`split`], except that the trailing substring is
/// skipped if empty.
///
Expand Down Expand Up @@ -3306,8 +3292,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines the
/// split.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator will not be double ended, because it is
Expand Down Expand Up @@ -3361,8 +3345,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines the split.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator will not be double ended, because it is not
Expand Down Expand Up @@ -3407,16 +3389,13 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines if a character matches.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
/// allows a reverse search and forward/reverse search yields the same
/// elements. This is true for, eg, [`char`] but not for `&str`.
///
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
/// [`char`]: primitive.char.html
///
/// If the pattern allows a reverse search but its results might differ
/// from a forward search, the [`rmatches`] method can be used.
Expand Down Expand Up @@ -3446,8 +3425,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator requires that the pattern supports a reverse
Expand Down Expand Up @@ -3488,8 +3465,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines
/// if a character matches.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
Expand Down Expand Up @@ -3532,8 +3507,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines if a
/// character matches.
///
/// [`char`]: primitive.char.html
///
/// # Iterator behavior
///
/// The returned iterator requires that the pattern supports a reverse
Expand Down Expand Up @@ -3665,8 +3638,6 @@ impl str {
/// The pattern can be a [`char`] or a closure that determines if a
/// character matches.
///
/// [`char`]: primitive.char.html
///
/// # Examples
///
/// Simple patterns:
Expand Down Expand Up @@ -3711,8 +3682,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that determines if
/// a character matches.
///
/// [`char`]: primitive.char.html
///
/// # Text directionality
///
/// A string is a sequence of bytes. 'Left' in this context means the first
Expand Down Expand Up @@ -3750,8 +3719,6 @@ impl str {
/// The pattern can be a `&str`, [`char`], or a closure that
/// determines if a character matches.
///
/// [`char`]: primitive.char.html
///
/// # Text directionality
///
/// A string is a sequence of bytes. 'Right' in this context means the last
Expand Down
44 changes: 25 additions & 19 deletions src/libcore/task/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
issue = "50547")]

use fmt;
use super::{Executor, Waker, LocalWaker};
use super::{Spawn, Waker, LocalWaker};

/// Information about the currently-running task.
///
/// Contexts are always tied to the stack, since they are set up specifically
/// when performing a single `poll` step on a task.
pub struct Context<'a> {
local_waker: &'a LocalWaker,
executor: &'a mut dyn Executor,
spawner: &'a mut dyn Spawn,
}

impl<'a> fmt::Debug for Context<'a> {
Expand All @@ -32,13 +32,14 @@ impl<'a> fmt::Debug for Context<'a> {
}

impl<'a> Context<'a> {
/// Create a new task `Context` with the provided `local_waker`, `waker`, and `executor`.
/// Create a new task `Context` with the provided `local_waker`, `waker`,
/// and `spawner`.
#[inline]
pub fn new(local_waker: &'a LocalWaker, executor: &'a mut dyn Executor) -> Context<'a> {
Context {
local_waker,
executor,
}
pub fn new(
local_waker: &'a LocalWaker,
spawner: &'a mut dyn Spawn,
) -> Context<'a> {
Context { local_waker, spawner }
}

/// Get the `LocalWaker` associated with the current task.
Expand All @@ -53,40 +54,45 @@ impl<'a> Context<'a> {
unsafe { &*(self.local_waker as *const LocalWaker as *const Waker) }
}

/// Get the default executor associated with this task.
/// Get the spawner associated with this task.
///
/// This method is useful primarily if you want to explicitly handle
/// spawn failures.
#[inline]
pub fn executor(&mut self) -> &mut dyn Executor {
self.executor
pub fn spawner(&mut self) -> &mut dyn Spawn {
self.spawner
}

/// Produce a context like the current one, but using the given waker instead.
/// Produce a context like the current one, but using the given waker
/// instead.
///
/// This advanced method is primarily used when building "internal
/// schedulers" within a task, where you want to provide some customized
/// wakeup logic.
#[inline]
pub fn with_waker<'b>(&'b mut self, local_waker: &'b LocalWaker) -> Context<'b> {
pub fn with_waker<'b>(
&'b mut self,
local_waker: &'b LocalWaker,
) -> Context<'b> {
Context {
local_waker,
executor: self.executor,
spawner: self.spawner,
}
}

/// Produce a context like the current one, but using the given executor
/// Produce a context like the current one, but using the given spawner
/// instead.
///
/// This advanced method is primarily used when building "internal
/// schedulers" within a task.
#[inline]
pub fn with_executor<'b, E>(&'b mut self, executor: &'b mut E) -> Context<'b>
where E: Executor
{
pub fn with_spawner<'b, Sp: Spawn>(
&'b mut self,
spawner: &'b mut Sp,
) -> Context<'b> {
Context {
local_waker: self.local_waker,
executor,
spawner,
}
}
}
6 changes: 2 additions & 4 deletions src/libcore/task/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
mod context;
pub use self::context::Context;

mod executor;
pub use self::executor::{
Executor, SpawnErrorKind, SpawnObjError, SpawnLocalObjError
};
mod spawn;
pub use self::spawn::{Spawn, SpawnErrorKind, SpawnObjError, SpawnLocalObjError};

mod poll;
pub use self::poll::Poll;
Expand Down
Loading