Skip to content

Rollup of 8 pull requests #73401

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

Closed
wants to merge 21 commits into from
Closed
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
4004bf1
Don't run generator transform when there's a TyErr
jonas-schievink Jun 14, 2020
64a6de2
Join mutiple lines if it is more readable
tesuji Jun 15, 2020
b67bdb5
Re-order correctly the sections in the sidebar
GuillaumeGomez Jun 15, 2020
fe7456c
Use track caller for bug! macro
tesuji Jun 15, 2020
b34a417
Add more info to `x.py build --help` on default value for `-j JOBS`.
pnkfelix Jun 15, 2020
71c54db
Fix typo in docs of std::mem
ratijas Jun 15, 2020
0e6c333
Use `Ipv4Addr::from<[u8; 4]>` when possible
tesuji Jun 16, 2020
0bcefd9
remove visit_terminator_kind from MIR visitor
RalfJung May 31, 2020
302fb50
get rid of an unused 'span' field
RalfJung May 31, 2020
046165a
rename location field of Drop terminators to place
RalfJung Jun 10, 2020
6c5345f
fmt; make visit_terminator arg names consistent with the rest
RalfJung Jun 10, 2020
827ccf7
add probably accidentally missing super_* calls
RalfJung Jun 10, 2020
60410ef
Fix forge-platform-support URL
rnestler Jun 16, 2020
5d7a1ca
Rollup merge of #72814 - RalfJung:mir-visir-terminator, r=oli-obk
Dylan-DPC Jun 16, 2020
231911e
Rollup merge of #73339 - jonas-schievink:unbug, r=estebank
Dylan-DPC Jun 16, 2020
5136489
Rollup merge of #73372 - GuillaumeGomez:re-order-sidebar-sections, r=…
Dylan-DPC Jun 16, 2020
18b046f
Rollup merge of #73373 - lzutao:bug-trackcaller, r=Amanieu
Dylan-DPC Jun 16, 2020
a415fa4
Rollup merge of #73380 - pnkfelix:make-bootstrap-help-print-num-cpus,…
Dylan-DPC Jun 16, 2020
2199aa0
Rollup merge of #73381 - ratijas:fix-typo-std-mem, r=jonas-schievink
Dylan-DPC Jun 16, 2020
176d7eb
Rollup merge of #73389 - lzutao:from, r=kennytm
Dylan-DPC Jun 16, 2020
bf7b39a
Rollup merge of #73400 - rnestler:patch-1, r=jonas-schievink
Dylan-DPC Jun 16, 2020
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
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ Compatibility Notes
[`Duration::mul_f32`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f32
[`Duration::mul_f64`]: https://doc.rust-lang.org/std/time/struct.Duration.html#method.mul_f64
[`any::type_name`]: https://doc.rust-lang.org/std/any/fn.type_name.html
[forge-platform-support]: https://forge.rust-lang.org/platform-support.html
[forge-platform-support]: https://forge.rust-lang.org/release/platform-support.html
[pipeline-internals]: https://internals.rust-lang.org/t/evaluating-pipelined-rustc-compilation/10199

Version 1.37.0 (2019-08-15)
Expand Down
7 changes: 6 additions & 1 deletion src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
"N",
);
opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
opts.optopt("j", "jobs", "number of jobs to run in parallel", "JOBS");
let j_msg = format!(
"number of jobs to run in parallel; \
defaults to {} (this host's logical CPU count)",
num_cpus::get()
);
opts.optopt("j", "jobs", &j_msg, "JOBS");
opts.optflag("h", "help", "print this help message");
opts.optopt(
"",
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub use crate::intrinsics::transmute;
/// erring on the side of (double-)dropping.
///
/// Also, `ManuallyDrop` prevents us from having to "touch" `v` after transferring the
/// ownership to `s` - the final step of interacting with `v` to dispoe of it without
/// ownership to `s` the final step of interacting with `v` to dispose of it without
/// running its destructor is entirely avoided.
///
/// [drop]: fn.drop.html
Expand Down
9 changes: 3 additions & 6 deletions src/libcore/panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ pub struct PanicInfo<'a> {
impl<'a> PanicInfo<'a> {
#[unstable(
feature = "panic_internals",
reason = "internal details of the implementation of the `panic!` \
and related macros",
reason = "internal details of the implementation of the `panic!` and related macros",
issue = "none"
)]
#[doc(hidden)]
Expand All @@ -55,8 +54,7 @@ impl<'a> PanicInfo<'a> {

#[unstable(
feature = "panic_internals",
reason = "internal details of the implementation of the `panic!` \
and related macros",
reason = "internal details of the implementation of the `panic!` and related macros",
issue = "none"
)]
#[doc(hidden)]
Expand Down Expand Up @@ -244,8 +242,7 @@ impl<'a> Location<'a> {
impl<'a> Location<'a> {
#![unstable(
feature = "panic_internals",
reason = "internal details of the implementation of the `panic!` \
and related macros",
reason = "internal details of the implementation of the `panic!` and related macros",
issue = "none"
)]
#[doc(hidden)]
Expand Down
3 changes: 1 addition & 2 deletions src/libcore/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
#![allow(dead_code, missing_docs)]
#![unstable(
feature = "core_panic",
reason = "internal details of the implementation of the `panic!` \
and related macros",
reason = "internal details of the implementation of the `panic!` and related macros",
issue = "none"
)]

Expand Down
6 changes: 3 additions & 3 deletions src/librustc_codegen_ssa/mir/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
self.visit_rvalue(rvalue, location);
}

fn visit_terminator_kind(&mut self, kind: &mir::TerminatorKind<'tcx>, location: Location) {
let check = match *kind {
fn visit_terminator(&mut self, terminator: &mir::Terminator<'tcx>, location: Location) {
let check = match terminator.kind {
mir::TerminatorKind::Call { func: mir::Operand::Constant(ref c), ref args, .. } => {
match c.literal.ty.kind {
ty::FnDef(did, _) => Some((did, args)),
Expand All @@ -259,7 +259,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
}
}

self.super_terminator_kind(kind, location);
self.super_terminator(terminator, location);
}

fn visit_place(&mut self, place: &mir::Place<'tcx>, context: PlaceContext, location: Location) {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_codegen_ssa/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 +998,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
bx.unreachable();
}

mir::TerminatorKind::Drop { location, target, unwind } => {
self.codegen_drop_terminator(helper, bx, location, target, unwind);
mir::TerminatorKind::Drop { place, target, unwind } => {
self.codegen_drop_terminator(helper, bx, place, target, unwind);
}

mir::TerminatorKind::Assert { ref cond, expected, ref msg, target, cleanup } => {
Expand Down
18 changes: 11 additions & 7 deletions src/librustc_middle/macros.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#[macro_export]
macro_rules! bug {
() => ( bug!("impossible case reached") );
($($message:tt)*) => ({
$crate::util::bug::bug_fmt(file!(), line!(), format_args!($($message)*))
})
() => ( $crate::bug!("impossible case reached") );
($msg:expr) => ({ $crate::util::bug::bug_fmt(::std::format_args!($msg)) });
($msg:expr,) => ({ $crate::bug!($msg) });
($fmt:expr, $($arg:tt)+) => ({
$crate::util::bug::bug_fmt(::std::format_args!($fmt, $($arg)+))
});
}

#[macro_export]
macro_rules! span_bug {
($span:expr, $($message:tt)*) => ({
$crate::util::bug::span_bug_fmt(file!(), line!(), $span, format_args!($($message)*))
})
($span:expr, $msg:expr) => ({ $crate::util::bug::span_bug_fmt($span, ::std::format_args!($msg)) });
($span:expr, $msg:expr,) => ({ $crate::span_bug!($span, $msg) });
($span:expr, $fmt:expr, $($arg:tt)+) => ({
$crate::util::bug::span_bug_fmt($span, ::std::format_args!($fmt, $($arg)+))
});
}

///////////////////////////////////////////////////////////////////////////
Expand Down
10 changes: 5 additions & 5 deletions src/librustc_middle/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,7 +1112,7 @@ pub enum TerminatorKind<'tcx> {
Unreachable,

/// Drop the `Place`.
Drop { location: Place<'tcx>, target: BasicBlock, unwind: Option<BasicBlock> },
Drop { place: Place<'tcx>, target: BasicBlock, unwind: Option<BasicBlock> },

/// Drop the `Place` and assign the new value over it. This ensures
/// that the assignment to `P` occurs *even if* the destructor for
Expand Down Expand Up @@ -1141,7 +1141,7 @@ pub enum TerminatorKind<'tcx> {
/// }
/// ```
DropAndReplace {
location: Place<'tcx>,
place: Place<'tcx>,
value: Operand<'tcx>,
target: BasicBlock,
unwind: Option<BasicBlock>,
Expand Down Expand Up @@ -1607,9 +1607,9 @@ impl<'tcx> TerminatorKind<'tcx> {
Abort => write!(fmt, "abort"),
Yield { value, resume_arg, .. } => write!(fmt, "{:?} = yield({:?})", resume_arg, value),
Unreachable => write!(fmt, "unreachable"),
Drop { location, .. } => write!(fmt, "drop({:?})", location),
DropAndReplace { location, value, .. } => {
write!(fmt, "replace({:?} <- {:?})", location, value)
Drop { place, .. } => write!(fmt, "drop({:?})", place),
DropAndReplace { place, value, .. } => {
write!(fmt, "replace({:?} <- {:?})", place, value)
}
Call { func, args, destination, .. } => {
if let Some((destination, _)) = destination {
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_middle/mir/type_foldable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
values: values.clone(),
targets: targets.clone(),
},
Drop { ref location, target, unwind } => {
Drop { location: location.fold_with(folder), target, unwind }
Drop { ref place, target, unwind } => {
Drop { place: place.fold_with(folder), target, unwind }
}
DropAndReplace { ref location, ref value, target, unwind } => DropAndReplace {
location: location.fold_with(folder),
DropAndReplace { ref place, ref value, target, unwind } => DropAndReplace {
place: place.fold_with(folder),
value: value.fold_with(folder),
target,
unwind,
Expand Down Expand Up @@ -97,9 +97,9 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
SwitchInt { ref discr, switch_ty, .. } => {
discr.visit_with(visitor) || switch_ty.visit_with(visitor)
}
Drop { ref location, .. } => location.visit_with(visitor),
DropAndReplace { ref location, ref value, .. } => {
location.visit_with(visitor) || value.visit_with(visitor)
Drop { ref place, .. } => place.visit_with(visitor),
DropAndReplace { ref place, ref value, .. } => {
place.visit_with(visitor) || value.visit_with(visitor)
}
Yield { ref value, .. } => value.visit_with(visitor),
Call { ref func, ref args, ref destination, .. } => {
Expand Down
56 changes: 22 additions & 34 deletions src/librustc_middle/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,6 @@ macro_rules! make_mir_visitor {
self.super_terminator(terminator, location);
}

fn visit_terminator_kind(&mut self,
kind: & $($mutability)? TerminatorKind<'tcx>,
location: Location) {
self.super_terminator_kind(kind, location);
}

fn visit_assert_message(&mut self,
msg: & $($mutability)? AssertMessage<'tcx>,
location: Location) {
Expand Down Expand Up @@ -417,12 +411,6 @@ macro_rules! make_mir_visitor {
let Terminator { source_info, kind } = terminator;

self.visit_source_info(source_info);
self.visit_terminator_kind(kind, location);
}

fn super_terminator_kind(&mut self,
kind: & $($mutability)? TerminatorKind<'tcx>,
source_location: Location) {
match kind {
TerminatorKind::Goto { .. } |
TerminatorKind::Resume |
Expand All @@ -440,7 +428,7 @@ macro_rules! make_mir_visitor {
self.visit_local(
& $($mutability)? local,
PlaceContext::NonMutatingUse(NonMutatingUseContext::Move),
source_location,
location,
);

assert_eq!(
Expand All @@ -456,34 +444,34 @@ macro_rules! make_mir_visitor {
values: _,
targets: _
} => {
self.visit_operand(discr, source_location);
self.visit_ty(switch_ty, TyContext::Location(source_location));
self.visit_operand(discr, location);
self.visit_ty(switch_ty, TyContext::Location(location));
}

TerminatorKind::Drop {
location,
place,
target: _,
unwind: _,
} => {
self.visit_place(
location,
place,
PlaceContext::MutatingUse(MutatingUseContext::Drop),
source_location
location
);
}

TerminatorKind::DropAndReplace {
location,
place,
value,
target: _,
unwind: _,
} => {
self.visit_place(
location,
place,
PlaceContext::MutatingUse(MutatingUseContext::Drop),
source_location
location
);
self.visit_operand(value, source_location);
self.visit_operand(value, location);
}

TerminatorKind::Call {
Expand All @@ -494,15 +482,15 @@ macro_rules! make_mir_visitor {
from_hir_call: _,
fn_span: _
} => {
self.visit_operand(func, source_location);
self.visit_operand(func, location);
for arg in args {
self.visit_operand(arg, source_location);
self.visit_operand(arg, location);
}
if let Some((destination, _)) = destination {
self.visit_place(
destination,
PlaceContext::MutatingUse(MutatingUseContext::Call),
source_location
location
);
}
}
Expand All @@ -514,8 +502,8 @@ macro_rules! make_mir_visitor {
target: _,
cleanup: _,
} => {
self.visit_operand(cond, source_location);
self.visit_assert_message(msg, source_location);
self.visit_operand(cond, location);
self.visit_assert_message(msg, location);
}

TerminatorKind::Yield {
Expand All @@ -524,11 +512,11 @@ macro_rules! make_mir_visitor {
resume_arg,
drop: _,
} => {
self.visit_operand(value, source_location);
self.visit_operand(value, location);
self.visit_place(
resume_arg,
PlaceContext::MutatingUse(MutatingUseContext::Yield),
source_location,
location,
);
}

Expand All @@ -543,29 +531,29 @@ macro_rules! make_mir_visitor {
match op {
InlineAsmOperand::In { value, .. }
| InlineAsmOperand::Const { value } => {
self.visit_operand(value, source_location);
self.visit_operand(value, location);
}
InlineAsmOperand::Out { place, .. } => {
if let Some(place) = place {
self.visit_place(
place,
PlaceContext::MutatingUse(MutatingUseContext::Store),
source_location,
location,
);
}
}
InlineAsmOperand::InOut { in_value, out_place, .. } => {
self.visit_operand(in_value, source_location);
self.visit_operand(in_value, location);
if let Some(out_place) = out_place {
self.visit_place(
out_place,
PlaceContext::MutatingUse(MutatingUseContext::Store),
source_location,
location,
);
}
}
InlineAsmOperand::SymFn { value } => {
self.visit_constant(value, source_location);
self.visit_constant(value, location);
}
InlineAsmOperand::SymStatic { def_id: _ } => {}
}
Expand Down
3 changes: 1 addition & 2 deletions src/librustc_middle/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ fn validate_hir_id_for_typeck_tables(
if hir_id.owner != hir_owner {
ty::tls::with(|tcx| {
bug!(
"node {} with HirId::owner {:?} cannot be placed in \
TypeckTables with hir_owner {:?}",
"node {} with HirId::owner {:?} cannot be placed in TypeckTables with hir_owner {:?}",
tcx.hir().node_to_string(hir_id),
hir_id.owner,
hir_owner
Expand Down
Loading