Skip to content

Commit 18925de

Browse files
committed
Auto merge of #53150 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests Successful merges: - #52885 (Remove some unused method arguments from typeck) - #52886 (cleanup: Remove `Def::GlobalAsm`) - #53028 (Building librustc_codegen_llvm in a separate directory) - #53052 (fixed broken links to char) - #53060 (Change rustdoc style so fully qualified name does not overlap src link) - #53068 (Rename Executor trait to Spawn) - #53093 (Enable macros to pass $:literal to another macro) - #53107 (Remove references to `StaticMutex` which got removed a while ago) - #53135 (Rust 2018: Disable catch_expr, not targeted for 2018 edition) - #53139 (set emit_debug_gdb_scripts: false for riscv32imac-unknown-none target)
2 parents 9e472c2 + d9e9230 commit 18925de

File tree

28 files changed

+141
-212
lines changed

28 files changed

+141
-212
lines changed

src/Cargo.lock

-20
Original file line numberDiff line numberDiff line change
@@ -2184,30 +2184,10 @@ dependencies = [
21842184
name = "rustc_codegen_llvm"
21852185
version = "0.0.0"
21862186
dependencies = [
2187-
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
21882187
"cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
2189-
"env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
2190-
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
2191-
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
2192-
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
2193-
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
21942188
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
2195-
"rustc 0.0.0",
21962189
"rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
2197-
"rustc_allocator 0.0.0",
2198-
"rustc_apfloat 0.0.0",
2199-
"rustc_codegen_utils 0.0.0",
2200-
"rustc_data_structures 0.0.0",
2201-
"rustc_errors 0.0.0",
2202-
"rustc_incremental 0.0.0",
22032190
"rustc_llvm 0.0.0",
2204-
"rustc_mir 0.0.0",
2205-
"rustc_platform_intrinsics 0.0.0",
2206-
"rustc_target 0.0.0",
2207-
"serialize 0.0.0",
2208-
"syntax 0.0.0",
2209-
"syntax_pos 0.0.0",
2210-
"tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
22112191
]
22122192

22132193
[[package]]

src/bootstrap/check.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,18 @@ impl Step for CodegenBackend {
137137
let target = self.target;
138138
let backend = self.backend;
139139

140+
let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
141+
builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
142+
140143
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check");
141-
let features = builder.rustc_features().to_string();
142144
cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
143145
rustc_cargo_env(builder, &mut cargo);
144146

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

147149
let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
148150
run_cargo(builder,
149-
cargo.arg("--features").arg(features),
151+
&mut cargo,
150152
&codegen_backend_stamp(builder, compiler, target, backend),
151153
true);
152154
}

src/bootstrap/compile.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -670,16 +670,17 @@ impl Step for CodegenBackend {
670670
return;
671671
}
672672

673+
let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
674+
builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
675+
673676
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "build");
674-
let mut features = builder.rustc_features().to_string();
675677
cargo.arg("--manifest-path")
676678
.arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
677679
rustc_cargo_env(builder, &mut cargo);
678680

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

681-
let tmp_stamp = builder.cargo_out(compiler, Mode::Codegen, target)
682-
.join(".tmp.stamp");
683+
let tmp_stamp = out_dir.join(".tmp.stamp");
683684

684685
let _folder = builder.fold_output(|| format!("stage{}-rustc_codegen_llvm", compiler.stage));
685686
let files = run_cargo(builder,

src/bootstrap/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,8 @@ impl Build {
555555
let suffix = match mode {
556556
Mode::Std => "-std",
557557
Mode::Test => "-test",
558-
Mode::Codegen => "-rustc",
559558
Mode::Rustc => "-rustc",
559+
Mode::Codegen => "-codegen",
560560
Mode::ToolBootstrap => "-bootstrap-tools",
561561
Mode::ToolStd => "-tools",
562562
Mode::ToolRustc => "-tools",

src/liballoc/boxed.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use core::marker::{Unpin, Unsize};
6767
use core::mem::{self, PinMut};
6868
use core::ops::{CoerceUnsized, Deref, DerefMut, Generator, GeneratorState};
6969
use core::ptr::{self, NonNull, Unique};
70-
use core::task::{Context, Poll, Executor, SpawnErrorKind, SpawnObjError};
70+
use core::task::{Context, Poll, Spawn, SpawnErrorKind, SpawnObjError};
7171

7272
use raw_vec::RawVec;
7373
use str::from_boxed_utf8_unchecked;
@@ -973,11 +973,14 @@ unsafe impl<'a, T, F> UnsafeFutureObj<'a, T> for PinBox<F>
973973
}
974974

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

983986
fn status(&self) -> Result<(), SpawnErrorKind> {

src/libcore/str/mod.rs

-33
Original file line numberDiff line numberDiff line change
@@ -2117,8 +2117,6 @@ impl str {
21172117
/// This length is in bytes, not [`char`]s or graphemes. In other words,
21182118
/// it may not be what a human considers the length of the string.
21192119
///
2120-
/// [`char`]: primitive.char.html
2121-
///
21222120
/// # Examples
21232121
///
21242122
/// Basic usage:
@@ -2590,8 +2588,6 @@ impl str {
25902588
/// Value, and may not match your idea of what a 'character' is. Iteration
25912589
/// over grapheme clusters may be what you actually want.
25922590
///
2593-
/// [`char`]: primitive.char.html
2594-
///
25952591
/// # Examples
25962592
///
25972593
/// Basic usage:
@@ -2643,8 +2639,6 @@ impl str {
26432639
/// The iterator yields tuples. The position is first, the [`char`] is
26442640
/// second.
26452641
///
2646-
/// [`char`]: primitive.char.html
2647-
///
26482642
/// # Examples
26492643
///
26502644
/// Basic usage:
@@ -2946,7 +2940,6 @@ impl str {
29462940
/// The pattern can be a `&str`, [`char`], or a closure that determines if
29472941
/// a character matches.
29482942
///
2949-
/// [`char`]: primitive.char.html
29502943
/// [`None`]: option/enum.Option.html#variant.None
29512944
///
29522945
/// # Examples
@@ -2994,7 +2987,6 @@ impl str {
29942987
/// The pattern can be a `&str`, [`char`], or a closure that determines if
29952988
/// a character matches.
29962989
///
2997-
/// [`char`]: primitive.char.html
29982990
/// [`None`]: option/enum.Option.html#variant.None
29992991
///
30002992
/// # Examples
@@ -3050,7 +3042,6 @@ impl str {
30503042
/// If the pattern allows a reverse search but its results might differ
30513043
/// from a forward search, the [`rsplit`] method can be used.
30523044
///
3053-
/// [`char`]: primitive.char.html
30543045
/// [`rsplit`]: #method.rsplit
30553046
///
30563047
/// # Examples
@@ -3157,8 +3148,6 @@ impl str {
31573148
/// The pattern can be a `&str`, [`char`], or a closure that determines the
31583149
/// split.
31593150
///
3160-
/// [`char`]: primitive.char.html
3161-
///
31623151
/// # Iterator behavior
31633152
///
31643153
/// The returned iterator requires that the pattern supports a reverse
@@ -3224,7 +3213,6 @@ impl str {
32243213
/// elements. This is true for, eg, [`char`] but not for `&str`.
32253214
///
32263215
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
3227-
/// [`char`]: primitive.char.html
32283216
///
32293217
/// If the pattern allows a reverse search but its results might differ
32303218
/// from a forward search, the [`rsplit_terminator`] method can be used.
@@ -3259,8 +3247,6 @@ impl str {
32593247
/// Additional libraries might provide more complex patterns like
32603248
/// regular expressions.
32613249
///
3262-
/// [`char`]: primitive.char.html
3263-
///
32643250
/// Equivalent to [`split`], except that the trailing substring is
32653251
/// skipped if empty.
32663252
///
@@ -3306,8 +3292,6 @@ impl str {
33063292
/// The pattern can be a `&str`, [`char`], or a closure that determines the
33073293
/// split.
33083294
///
3309-
/// [`char`]: primitive.char.html
3310-
///
33113295
/// # Iterator behavior
33123296
///
33133297
/// The returned iterator will not be double ended, because it is
@@ -3361,8 +3345,6 @@ impl str {
33613345
/// The pattern can be a `&str`, [`char`], or a closure that
33623346
/// determines the split.
33633347
///
3364-
/// [`char`]: primitive.char.html
3365-
///
33663348
/// # Iterator behavior
33673349
///
33683350
/// The returned iterator will not be double ended, because it is not
@@ -3407,16 +3389,13 @@ impl str {
34073389
/// The pattern can be a `&str`, [`char`], or a closure that
34083390
/// determines if a character matches.
34093391
///
3410-
/// [`char`]: primitive.char.html
3411-
///
34123392
/// # Iterator behavior
34133393
///
34143394
/// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
34153395
/// allows a reverse search and forward/reverse search yields the same
34163396
/// elements. This is true for, eg, [`char`] but not for `&str`.
34173397
///
34183398
/// [`DoubleEndedIterator`]: iter/trait.DoubleEndedIterator.html
3419-
/// [`char`]: primitive.char.html
34203399
///
34213400
/// If the pattern allows a reverse search but its results might differ
34223401
/// from a forward search, the [`rmatches`] method can be used.
@@ -3446,8 +3425,6 @@ impl str {
34463425
/// The pattern can be a `&str`, [`char`], or a closure that determines if
34473426
/// a character matches.
34483427
///
3449-
/// [`char`]: primitive.char.html
3450-
///
34513428
/// # Iterator behavior
34523429
///
34533430
/// The returned iterator requires that the pattern supports a reverse
@@ -3488,8 +3465,6 @@ impl str {
34883465
/// The pattern can be a `&str`, [`char`], or a closure that determines
34893466
/// if a character matches.
34903467
///
3491-
/// [`char`]: primitive.char.html
3492-
///
34933468
/// # Iterator behavior
34943469
///
34953470
/// The returned iterator will be a [`DoubleEndedIterator`] if the pattern
@@ -3532,8 +3507,6 @@ impl str {
35323507
/// The pattern can be a `&str`, [`char`], or a closure that determines if a
35333508
/// character matches.
35343509
///
3535-
/// [`char`]: primitive.char.html
3536-
///
35373510
/// # Iterator behavior
35383511
///
35393512
/// The returned iterator requires that the pattern supports a reverse
@@ -3665,8 +3638,6 @@ impl str {
36653638
/// The pattern can be a [`char`] or a closure that determines if a
36663639
/// character matches.
36673640
///
3668-
/// [`char`]: primitive.char.html
3669-
///
36703641
/// # Examples
36713642
///
36723643
/// Simple patterns:
@@ -3711,8 +3682,6 @@ impl str {
37113682
/// The pattern can be a `&str`, [`char`], or a closure that determines if
37123683
/// a character matches.
37133684
///
3714-
/// [`char`]: primitive.char.html
3715-
///
37163685
/// # Text directionality
37173686
///
37183687
/// A string is a sequence of bytes. 'Left' in this context means the first
@@ -3750,8 +3719,6 @@ impl str {
37503719
/// The pattern can be a `&str`, [`char`], or a closure that
37513720
/// determines if a character matches.
37523721
///
3753-
/// [`char`]: primitive.char.html
3754-
///
37553722
/// # Text directionality
37563723
///
37573724
/// A string is a sequence of bytes. 'Right' in this context means the last

src/libcore/task/context.rs

+25-19
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
issue = "50547")]
1414

1515
use fmt;
16-
use super::{Executor, Waker, LocalWaker};
16+
use super::{Spawn, Waker, LocalWaker};
1717

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

2727
impl<'a> fmt::Debug for Context<'a> {
@@ -32,13 +32,14 @@ impl<'a> fmt::Debug for Context<'a> {
3232
}
3333

3434
impl<'a> Context<'a> {
35-
/// Create a new task `Context` with the provided `local_waker`, `waker`, and `executor`.
35+
/// Create a new task `Context` with the provided `local_waker`, `waker`,
36+
/// and `spawner`.
3637
#[inline]
37-
pub fn new(local_waker: &'a LocalWaker, executor: &'a mut dyn Executor) -> Context<'a> {
38-
Context {
39-
local_waker,
40-
executor,
41-
}
38+
pub fn new(
39+
local_waker: &'a LocalWaker,
40+
spawner: &'a mut dyn Spawn,
41+
) -> Context<'a> {
42+
Context { local_waker, spawner }
4243
}
4344

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

56-
/// Get the default executor associated with this task.
57+
/// Get the spawner associated with this task.
5758
///
5859
/// This method is useful primarily if you want to explicitly handle
5960
/// spawn failures.
6061
#[inline]
61-
pub fn executor(&mut self) -> &mut dyn Executor {
62-
self.executor
62+
pub fn spawner(&mut self) -> &mut dyn Spawn {
63+
self.spawner
6364
}
6465

65-
/// Produce a context like the current one, but using the given waker instead.
66+
/// Produce a context like the current one, but using the given waker
67+
/// instead.
6668
///
6769
/// This advanced method is primarily used when building "internal
6870
/// schedulers" within a task, where you want to provide some customized
6971
/// wakeup logic.
7072
#[inline]
71-
pub fn with_waker<'b>(&'b mut self, local_waker: &'b LocalWaker) -> Context<'b> {
73+
pub fn with_waker<'b>(
74+
&'b mut self,
75+
local_waker: &'b LocalWaker,
76+
) -> Context<'b> {
7277
Context {
7378
local_waker,
74-
executor: self.executor,
79+
spawner: self.spawner,
7580
}
7681
}
7782

78-
/// Produce a context like the current one, but using the given executor
83+
/// Produce a context like the current one, but using the given spawner
7984
/// instead.
8085
///
8186
/// This advanced method is primarily used when building "internal
8287
/// schedulers" within a task.
8388
#[inline]
84-
pub fn with_executor<'b, E>(&'b mut self, executor: &'b mut E) -> Context<'b>
85-
where E: Executor
86-
{
89+
pub fn with_spawner<'b, Sp: Spawn>(
90+
&'b mut self,
91+
spawner: &'b mut Sp,
92+
) -> Context<'b> {
8793
Context {
8894
local_waker: self.local_waker,
89-
executor,
95+
spawner,
9096
}
9197
}
9298
}

src/libcore/task/mod.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
mod context;
1818
pub use self::context::Context;
1919

20-
mod executor;
21-
pub use self::executor::{
22-
Executor, SpawnErrorKind, SpawnObjError, SpawnLocalObjError
23-
};
20+
mod spawn;
21+
pub use self::spawn::{Spawn, SpawnErrorKind, SpawnObjError, SpawnLocalObjError};
2422

2523
mod poll;
2624
pub use self::poll::Poll;

0 commit comments

Comments
 (0)