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 13 pull requests #65009

Merged
merged 38 commits into from
Oct 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4aa526f
Improve sidebar styling to make its integration easier
GuillaumeGomez Oct 1, 2019
9fe138a
regression test for 64453 borrow check error.
pnkfelix Sep 30, 2019
4808106
fix typo
ztlpn Sep 16, 2019
057569e
fix spurious unreachable_code lints for try{} block ok-wrapping
ztlpn Sep 18, 2019
c474c6e
add tests
ztlpn Sep 18, 2019
ffa5269
address review comments
ztlpn Sep 18, 2019
cb4ed52
fix test after rebase
ztlpn Sep 22, 2019
6acdea4
Make comment about dummy type a bit more clear
spastorino Oct 1, 2019
738baa7
Update src/librustc/ty/mod.rs
spastorino Oct 1, 2019
75fdb95
change .node -> .kind after rebase
ztlpn Oct 1, 2019
a1ad38f
Pass attrs to `do_dataflow` in new const checker
ecstatic-morse Oct 1, 2019
8d84646
Don't mark zero-sized arrays as indirectly mutable when borrowed
ecstatic-morse Oct 1, 2019
4eeedd0
Add test cases for #64945
ecstatic-morse Oct 1, 2019
2427029
Fix typo passing flags to rustc
ecstatic-morse Oct 1, 2019
cf984d2
This needs to be build-pass since it involves debuginfo
ecstatic-morse Oct 1, 2019
f18535f
Refactor `rustc_peek`
ecstatic-morse Jul 6, 2019
767550e
Add `rustc_peek` support for `IndirectlyMutableLocals`
ecstatic-morse Oct 2, 2019
33aa5e8
Add test exposing unsoundness in `IndirectlyMutableLocals`
ecstatic-morse Oct 2, 2019
8e67180
Fix async/await ICE #64964
sinkuu Oct 2, 2019
f0fddb1
Do not collect to vec for debug output
sinkuu Oct 2, 2019
3a8932d
[const-prop] Correctly handle locals that can't be propagated
wesleywiser Oct 2, 2019
675ed48
Remove inline annotations from dep_node
Mark-Simulacrum Sep 30, 2019
70dcb99
Remove rustdoc warning
GuillaumeGomez Oct 2, 2019
8e9f635
rustc book: nitpick SLP vectorization
Oct 2, 2019
79dc862
Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions
spastorino Sep 30, 2019
18d0c03
Rollup merge of #64581 - ztlpn:fix-ok-wrapping-unreachable-code, r=Ce…
Centril Oct 2, 2019
b7290a0
Rollup merge of #64850 - Mark-Simulacrum:dedup-dep-node, r=michaelwoe…
Centril Oct 2, 2019
fe5fad8
Rollup merge of #64914 - pnkfelix:issue-64453-regression-test, r=niko…
Centril Oct 2, 2019
19d035c
Rollup merge of #64922 - spastorino:make-place-builder, r=nikomatsakis
Centril Oct 2, 2019
1c8ef98
Rollup merge of #64948 - GuillaumeGomez:improve-sidebar-styling, r=Ma…
Centril Oct 2, 2019
475f5d4
Rollup merge of #64961 - rust-lang:spastorino-patch-1, r=oli-obk
Centril Oct 2, 2019
ccf1d9c
Rollup merge of #64967 - ecstatic-morse:issue-64945, r=oli-obk
Centril Oct 2, 2019
10b0fe9
Rollup merge of #64973 - ecstatic-morse:fix-debuginfo-test, r=alexcri…
Centril Oct 2, 2019
7daf2e8
Rollup merge of #64980 - ecstatic-morse:better-rustc-peek, r=oli-obk
Centril Oct 2, 2019
028ffd1
Rollup merge of #64989 - sinkuu:fix_ice_64964, r=davidtwco
Centril Oct 2, 2019
34ea559
Rollup merge of #64991 - wesleywiser:fix_too_eager_const_prop, r=oli-obk
Centril Oct 2, 2019
ebbc9ce
Rollup merge of #64995 - GuillaumeGomez:libtest-rustdoc-warning, r=Ma…
Centril Oct 2, 2019
b961f96
Rollup merge of #64997 - rust-lang:nitpick-slp, r=jonas-schievink
Centril Oct 2, 2019
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 src/doc/rustc/src/codegen-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ flag will turn that behavior off.

## no-vectorize-slp

By default, `rustc` will attempt to vectorize loops using [superword-level
By default, `rustc` will attempt to vectorize code using [superword-level
parallelism](https://llvm.org/docs/Vectorizers.html#the-slp-vectorizer). This
flag will turn that behavior off.

Expand Down
40 changes: 18 additions & 22 deletions src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ macro_rules! define_dep_nodes {

impl DepKind {
#[allow(unreachable_code)]
#[inline]
pub fn can_reconstruct_query_key<$tcx>(&self) -> bool {
match *self {
$(
Expand Down Expand Up @@ -150,7 +149,6 @@ macro_rules! define_dep_nodes {
}
}

#[inline(always)]
pub fn is_eval_always(&self) -> bool {
match *self {
$(
Expand Down Expand Up @@ -199,7 +197,6 @@ macro_rules! define_dep_nodes {

impl DepNode {
#[allow(unreachable_code, non_snake_case)]
#[inline(always)]
pub fn new<'tcx>(tcx: TyCtxt<'tcx>,
dep: DepConstructor<'tcx>)
-> DepNode
Expand All @@ -219,14 +216,16 @@ macro_rules! define_dep_nodes {
hash
};

if cfg!(debug_assertions) &&
!dep_node.kind.can_reconstruct_query_key() &&
(tcx.sess.opts.debugging_opts.incremental_info ||
tcx.sess.opts.debugging_opts.query_dep_graph)
#[cfg(debug_assertions)]
{
tcx.dep_graph.register_dep_node_debug_str(dep_node, || {
arg.to_debug_str(tcx)
});
if !dep_node.kind.can_reconstruct_query_key() &&
(tcx.sess.opts.debugging_opts.incremental_info ||
tcx.sess.opts.debugging_opts.query_dep_graph)
{
tcx.dep_graph.register_dep_node_debug_str(dep_node, || {
arg.to_debug_str(tcx)
});
}
}

return dep_node;
Expand All @@ -242,14 +241,16 @@ macro_rules! define_dep_nodes {
hash
};

if cfg!(debug_assertions) &&
!dep_node.kind.can_reconstruct_query_key() &&
(tcx.sess.opts.debugging_opts.incremental_info ||
tcx.sess.opts.debugging_opts.query_dep_graph)
#[cfg(debug_assertions)]
{
tcx.dep_graph.register_dep_node_debug_str(dep_node, || {
tupled_args.to_debug_str(tcx)
});
if !dep_node.kind.can_reconstruct_query_key() &&
(tcx.sess.opts.debugging_opts.incremental_info ||
tcx.sess.opts.debugging_opts.query_dep_graph)
{
tcx.dep_graph.register_dep_node_debug_str(dep_node, || {
tupled_args.to_debug_str(tcx)
});
}
}

return dep_node;
Expand All @@ -267,7 +268,6 @@ macro_rules! define_dep_nodes {
/// Construct a DepNode from the given DepKind and DefPathHash. This
/// method will assert that the given DepKind actually requires a
/// single DefId/DefPathHash parameter.
#[inline(always)]
pub fn from_def_path_hash(kind: DepKind,
def_path_hash: DefPathHash)
-> DepNode {
Expand All @@ -281,7 +281,6 @@ macro_rules! define_dep_nodes {
/// Creates a new, parameterless DepNode. This method will assert
/// that the DepNode corresponding to the given DepKind actually
/// does not require any parameters.
#[inline(always)]
pub fn new_no_params(kind: DepKind) -> DepNode {
debug_assert!(!kind.has_params());
DepNode {
Expand All @@ -300,7 +299,6 @@ macro_rules! define_dep_nodes {
/// DepNode. Condition (2) might not be fulfilled if a DepNode
/// refers to something from the previous compilation session that
/// has been removed.
#[inline]
pub fn extract_def_id(&self, tcx: TyCtxt<'_>) -> Option<DefId> {
if self.kind.can_reconstruct_query_key() {
let def_path_hash = DefPathHash(self.hash);
Expand Down Expand Up @@ -386,14 +384,12 @@ impl fmt::Debug for DepNode {


impl DefPathHash {
#[inline(always)]
pub fn to_dep_node(self, kind: DepKind) -> DepNode {
DepNode::from_def_path_hash(kind, self)
}
}

impl DefId {
#[inline(always)]
pub fn to_dep_node(self, tcx: TyCtxt<'_>, kind: DepKind) -> DepNode {
DepNode::from_def_path_hash(kind, tcx.def_path_hash(self))
}
Expand Down
37 changes: 27 additions & 10 deletions src/librustc/hir/lowering/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,32 +392,49 @@ impl LoweringContext<'_> {
)
}

/// Desugar `try { <stmts>; <expr> }` into `{ <stmts>; ::std::ops::Try::from_ok(<expr>) }`,
/// `try { <stmts>; }` into `{ <stmts>; ::std::ops::Try::from_ok(()) }`
/// and save the block id to use it as a break target for desugaring of the `?` operator.
fn lower_expr_try_block(&mut self, body: &Block) -> hir::ExprKind {
self.with_catch_scope(body.id, |this| {
let unstable_span = this.mark_span_with_reason(
let mut block = this.lower_block(body, true).into_inner();

let try_span = this.mark_span_with_reason(
DesugaringKind::TryBlock,
body.span,
this.allow_try_trait.clone(),
);
let mut block = this.lower_block(body, true).into_inner();
let tail = block.expr.take().map_or_else(
|| this.expr_unit(this.sess.source_map().end_point(unstable_span)),

// Final expression of the block (if present) or `()` with span at the end of block
let tail_expr = block.expr.take().map_or_else(
|| this.expr_unit(this.sess.source_map().end_point(try_span)),
|x: P<hir::Expr>| x.into_inner(),
);
block.expr = Some(this.wrap_in_try_constructor(sym::from_ok, tail, unstable_span));

let ok_wrapped_span = this.mark_span_with_reason(
DesugaringKind::TryBlock,
tail_expr.span,
None
);

// `::std::ops::Try::from_ok($tail_expr)`
block.expr = Some(this.wrap_in_try_constructor(
sym::from_ok, try_span, tail_expr, ok_wrapped_span));

hir::ExprKind::Block(P(block), None)
})
}

fn wrap_in_try_constructor(
&mut self,
method: Symbol,
e: hir::Expr,
unstable_span: Span,
method_span: Span,
expr: hir::Expr,
overall_span: Span,
) -> P<hir::Expr> {
let path = &[sym::ops, sym::Try, method];
let from_err = P(self.expr_std_path(unstable_span, path, None, ThinVec::new()));
P(self.expr_call(e.span, from_err, hir_vec![e]))
let constructor = P(self.expr_std_path(method_span, path, None, ThinVec::new()));
P(self.expr_call(overall_span, constructor, hir_vec![expr]))
}

fn lower_arm(&mut self, arm: &Arm) -> hir::Arm {
Expand Down Expand Up @@ -1244,7 +1261,7 @@ impl LoweringContext<'_> {
self.expr_call_std_path(try_span, from_path, hir_vec![err_expr])
};
let from_err_expr =
self.wrap_in_try_constructor(sym::from_error, from_expr, unstable_span);
self.wrap_in_try_constructor(sym::from_error, unstable_span, from_expr, try_span);
let thin_attrs = ThinVec::from(attrs);
let catch_scope = self.catch_scopes.last().map(|x| *x);
let ret_expr = if let Some(catch_node) = catch_scope {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ pub struct Block {
pub span: Span,
/// If true, then there may exist `break 'a` values that aim to
/// break out of this block early.
/// Used by `'label: {}` blocks and by `catch` statements.
/// Used by `'label: {}` blocks and by `try {}` blocks.
pub targeted_by_break: bool,
}

Expand Down
6 changes: 6 additions & 0 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,12 @@ pub struct GeneratorInteriorTypeCause<'tcx> {
pub scope_span: Option<Span>,
}

BraceStructTypeFoldableImpl! {
impl<'tcx> TypeFoldable<'tcx> for GeneratorInteriorTypeCause<'tcx> {
ty, span, scope_span
}
}

#[derive(RustcEncodable, RustcDecodable, Debug)]
pub struct TypeckTables<'tcx> {
/// The HirId::owner all ItemLocalIds in this table are relative to.
Expand Down
3 changes: 2 additions & 1 deletion src/librustc/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ impl<'tcx> rustc_serialize::UseSpecializedDecodable for Ty<'tcx> {}
pub type CanonicalTy<'tcx> = Canonical<'tcx, Ty<'tcx>>;

extern {
/// A dummy type used to force `List` to by unsized without requiring fat pointers.
/// A dummy type used to force `List` to be unsized while not requiring references to it be wide
/// pointers.
type OpaqueListContents;
}

Expand Down
Loading