Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
8d2af4a
Update to new system calls and enviromental variables
jackpot51 Aug 11, 2018
b400005
Remove unused type parameter
jackpot51 Aug 11, 2018
8c277d8
Don't forget to close executable file
jackpot51 Aug 17, 2018
9d42b1b
Interpret shebangs on redox
jD91mZM2 Oct 15, 2018
91c1b7a
Revert liblibc submodule url
jD91mZM2 Oct 18, 2018
51e2a63
Fix tidy checks
jD91mZM2 Oct 18, 2018
52deb6b
Add link to std::mem::size_of to size_of intrinsic documentation
fhartwig Oct 30, 2018
19aa101
Speed up String::from_utf16
ljedrz Oct 31, 2018
7eece47
Add BufWriter::buffer method
fintelia Oct 19, 2018
07d966d
Add some tests
fintelia Oct 27, 2018
40e4144
Suggested edits
fintelia Nov 1, 2018
59a0309
Fix compile errors in test
fintelia Nov 1, 2018
2d368b5
NetBSD: link libstd with librt in addition to libpthread
jakllsch Sep 25, 2018
ece4f47
For diagnostics, set spans of drops of temps to be that of the statem…
pnkfelix Nov 8, 2018
3011ecd
Narrow span of temp holding the value of a Block expression to the bl…
pnkfelix Nov 8, 2018
556f583
Regression test for issue #54382
pnkfelix Nov 8, 2018
e7e1a52
Refactor code so that block_context observations has nicely named (an…
pnkfelix Nov 8, 2018
dd63982
Revise the temp creation for blocks in `stmt_expr` to setup `BlockTai…
pnkfelix Nov 8, 2018
3977133
Allow unsized types in mem::drop and mem::forget
Nov 8, 2018
06cf9ae
Fix return type of forget intrinsic
Nov 8, 2018
f211581
Use T: ?Sized in intrinsics::forget
Nov 8, 2018
c148714
Rewrite `...` as `..=` as a MachineApplicable 2018 idiom lint
varkor Nov 10, 2018
c63df7c
Use non-short suggestion for parenthesised ..=
varkor Nov 10, 2018
0c6a093
Unix RwLock: avoid racy access to write_locked
RalfJung Nov 11, 2018
db13390
do not skip return code check in release builds
RalfJung Nov 11, 2018
39a0969
Make `NodeId` a `newtype_index` to enable niche optimizations
oli-obk Nov 7, 2018
a1d8926
Turn `HirLocalId` into a `newtype_index`
oli-obk Nov 7, 2018
4bf7c33
Fix rustdoc
oli-obk Nov 8, 2018
4c9ee59
Reintroduce the original debug formatting for NodeIds
oli-obk Nov 8, 2018
e5fd34c
Fix fulldeps test with NodeId
oli-obk Nov 8, 2018
3e5dfdd
Typo nit
oli-obk Nov 9, 2018
2203959
Fix fallout it rustc_driver tests
oli-obk Nov 9, 2018
4d2934e
Add forget_unsized only
Nov 12, 2018
56d3a82
Update docs
Nov 12, 2018
2f7b95d
Change sidebar selector to fix compatibility with docs.rs
cynecx Nov 13, 2018
58a2267
hir: remove an unused hir_vec macro pattern
ljedrz Nov 13, 2018
5ea0e0d
hir: simplify fmt::Debug for hir::Path
ljedrz Nov 13, 2018
3d91929
hir: remove an unused type alias
ljedrz Nov 13, 2018
cf4f5c3
hir: simplify a match expression
ljedrz Nov 13, 2018
4e35cbb
fix various typos in doc comments
euclio Nov 12, 2018
98f61a3
core/benches: Add `char::to_digit()` benchmarks
Turbo87 Nov 13, 2018
04aade8
core/char: Replace condition + `panic!()` with `assert!()`
Turbo87 Nov 13, 2018
17f08fe
core/char: Speed up `to_digit()` for `radix <= 10`
Turbo87 Nov 13, 2018
98dab33
Wrap some query results in `Lrc`.
nnethercote Nov 8, 2018
15e7df8
Remove unneeded newline.
frewsxcv Nov 14, 2018
818257e
Use `Mmap` to open the rmeta file.
nnethercote Oct 31, 2018
64a5172
core/char: Drop `radix == 10` special case
Turbo87 Nov 14, 2018
7843e27
core/char: Add comment to `to_digit()`
Turbo87 Nov 14, 2018
055e7b7
add test for issue #55587
euclio Nov 14, 2018
e2ef0f7
add test for issue #54348
euclio Nov 14, 2018
f4ecc1f
Rollup merge of #55182 - jD91mZM2:rebased, r=alexcrichton
pietroalbini Nov 15, 2018
b20bba4
Rollup merge of #55211 - fintelia:bufwriter-buffer, r=shepmaster
pietroalbini Nov 15, 2018
d7c833b
Rollup merge of #55507 - fhartwig:size_of_intrinsic_docs, r=frewsxcv
pietroalbini Nov 15, 2018
3b40434
Rollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapin
pietroalbini Nov 15, 2018
9c5b8aa
Rollup merge of #55556 - nnethercote:MmapMeta, r=eddyb
pietroalbini Nov 15, 2018
756870a
Rollup merge of #55622 - jakllsch:netbsd-librt, r=alexcrichton
pietroalbini Nov 15, 2018
1d5829d
Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoerister
pietroalbini Nov 15, 2018
97d0d89
Rollup merge of #55778 - nnethercote:LrcPreds, r=eddyb
pietroalbini Nov 15, 2018
6ca7bc0
Rollup merge of #55781 - pnkfelix:issue-54382-more-precise-spans-for-…
pietroalbini Nov 15, 2018
202724c
Rollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichton
pietroalbini Nov 15, 2018
3c7acc7
Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis
pietroalbini Nov 15, 2018
fb45532
Rollup merge of #55865 - RalfJung:unix-rwlock, r=alexcrichton
pietroalbini Nov 15, 2018
66fcb3c
Rollup merge of #55901 - euclio:speling, r=petrochenkov
pietroalbini Nov 15, 2018
12556a4
Rollup merge of #55926 - cynecx:fix-rustdoc-mobile-css, r=GuillaumeGomez
pietroalbini Nov 15, 2018
c915f92
Rollup merge of #55930 - ljedrz:hir_bonuses, r=cramertj
pietroalbini Nov 15, 2018
f40f04b
Rollup merge of #55932 - Turbo87:to_digit, r=alexcrichton
pietroalbini Nov 15, 2018
d0e08ce
Rollup merge of #55956 - euclio:issue-55587, r=estebank
pietroalbini Nov 15, 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
Prev Previous commit
Next Next commit
For diagnostics, set spans of drops of temps to be that of the statem…
…ent's terminating semicolon.
  • Loading branch information
pnkfelix committed Nov 8, 2018
commit ece4f472c923d72faf50efaaba60a8f51c143bec
4 changes: 2 additions & 2 deletions src/librustc_mir/build/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {

let source_info = this.source_info(span);
for stmt in stmts {
let Stmt { kind, opt_destruction_scope } = this.hir.mirror(stmt);
let Stmt { kind, opt_destruction_scope, span: stmt_span } = this.hir.mirror(stmt);
match kind {
StmtKind::Expr { scope, expr } => {
this.block_context.push(BlockFrame::Statement { ignores_expr_result: true });
Expand All @@ -99,7 +99,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
let si = (scope, source_info);
this.in_scope(si, LintLevel::Inherited, block, |this| {
let expr = this.hir.mirror(expr);
this.stmt_expr(block, expr)
this.stmt_expr(block, expr, Some(stmt_span))
})
}));
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/expr/as_rvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
block.and(Rvalue::Aggregate(adt, fields))
}
ExprKind::Assign { .. } | ExprKind::AssignOp { .. } => {
block = unpack!(this.stmt_expr(block, expr));
block = unpack!(this.stmt_expr(block, expr, None));
block.and(this.unit_rvalue())
}
ExprKind::Yield { value } => {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/expr/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
| ExprKind::Break { .. }
| ExprKind::InlineAsm { .. }
| ExprKind::Return { .. } => {
unpack!(block = this.stmt_expr(block, expr));
unpack!(block = this.stmt_expr(block, expr, None));
this.cfg.push_assign_unit(block, source_info, destination);
block.unit()
}
Expand Down
25 changes: 22 additions & 3 deletions src/librustc_mir/build/expr/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ use hair::*;
use rustc::mir::*;

impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
pub fn stmt_expr(&mut self, mut block: BasicBlock, expr: Expr<'tcx>) -> BlockAnd<()> {
/// Builds a block of MIR statements to evaluate the HAIR `expr`.
/// If the original expression was an AST statement,
/// (e.g. `some().code(&here());`) then `opt_stmt_span` is the
/// span of that statement (including its semicolon, if any).
/// Diagnostics use this span (which may be larger than that of
/// `expr`) to identify when statement temporaries are dropped.
pub fn stmt_expr(&mut self,
mut block: BasicBlock,
expr: Expr<'tcx>,
opt_stmt_span: Option<StatementSpan>)
-> BlockAnd<()>
{
let this = self;
let expr_span = expr.span;
let source_info = this.source_info(expr.span);
Expand All @@ -29,7 +40,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
} => {
let value = this.hir.mirror(value);
this.in_scope((region_scope, source_info), lint_level, block, |this| {
this.stmt_expr(block, value)
this.stmt_expr(block, value, opt_stmt_span)
})
}
ExprKind::Assign { lhs, rhs } => {
Expand Down Expand Up @@ -192,7 +203,15 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
let expr_ty = expr.ty;
let temp = this.temp(expr.ty.clone(), expr_span);
unpack!(block = this.into(&temp, block, expr));
unpack!(block = this.build_drop(block, expr_span, temp, expr_ty));

// Attribute drops of the statement's temps to the
// semicolon at the statement's end.
let drop_point = this.hir.tcx().sess.source_map().end_point(match opt_stmt_span {
None => expr_span,
Some(StatementSpan(span)) => span,
});

unpack!(block = this.build_drop(block, drop_point, temp, expr_ty));
block.unit()
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/librustc_mir/hair/cx/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ fn mirror_stmts<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
for (index, stmt) in stmts.iter().enumerate() {
let hir_id = cx.tcx.hir.node_to_hir_id(stmt.node.id());
let opt_dxn_ext = cx.region_scope_tree.opt_destruction_scope(hir_id.local_id);
let stmt_span = StatementSpan(cx.tcx.hir.span(stmt.node.id()));
match stmt.node {
hir::StmtKind::Expr(ref expr, _) |
hir::StmtKind::Semi(ref expr, _) => {
Expand All @@ -69,6 +70,7 @@ fn mirror_stmts<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
expr: expr.to_ref(),
},
opt_destruction_scope: opt_dxn_ext,
span: stmt_span,
})))
}
hir::StmtKind::Decl(ref decl, _) => {
Expand Down Expand Up @@ -111,6 +113,7 @@ fn mirror_stmts<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
lint_level: cx.lint_level_of(local.id),
},
opt_destruction_scope: opt_dxn_ext,
span: stmt_span,
})));
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_mir/hair/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ pub enum StmtRef<'tcx> {
Mirror(Box<Stmt<'tcx>>),
}

#[derive(Clone, Debug)]
pub struct StatementSpan(pub Span);

#[derive(Clone, Debug)]
pub struct Stmt<'tcx> {
pub kind: StmtKind<'tcx>,
pub opt_destruction_scope: Option<region::Scope>,
pub span: StatementSpan,
}

#[derive(Clone, Debug)]
Expand Down