Skip to content

Add "trace-macros" as a compiler flag #23703

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 80 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
5749a1f
std: Add missing stability on Range
alexcrichton Mar 17, 2015
1ec9adc
std: Tweak rt::at_exit behavior
alexcrichton Mar 21, 2015
3d04cb3
Note order of BinaryHeap::drain
steveklabnik Mar 22, 2015
558c427
Fix a typo in the Rust Book ownership page.
liammonahan Mar 23, 2015
3760113
Make the `Fn` traits inherit from one another and remove the bridging
nikomatsakis Feb 15, 2015
9330bae
Fallout from changing fn traits to use inheritance rather than bridge
nikomatsakis Mar 11, 2015
37dc801
Improve the wording of the example section description on the ownersh…
liammonahan Mar 24, 2015
a9b3196
Add the other S_I(RWX)(GRP/OTH) for posix `creat`
ubsan Mar 24, 2015
a34e87f
Add Examples for File
steveklabnik Mar 23, 2015
f2996c0
Add basic information about associated types
steveklabnik Mar 21, 2015
0031d57
Clean up Any's title line
steveklabnik Mar 24, 2015
f2e0810
correct reference wrt shifts
steveklabnik Mar 24, 2015
4ccf374
std: Zero memory when calling `read_to_end()`
alexcrichton Mar 24, 2015
4065246
An example for clone
steveklabnik Mar 24, 2015
95602a7
Add trivial cast lints.
nrc Mar 20, 2015
9374c21
Minor refactoring in coercion.rs
nrc Mar 23, 2015
088cd56
Remove the UnusedCasts lint
nrc Mar 23, 2015
dc206a9
Add tests
nrc Mar 23, 2015
e7122a5
Change lint names to plurals
nrc Mar 23, 2015
0e838f7
libcollections: move Vec::push slow path out
emberian Mar 24, 2015
227d304
std: Update docs for removal of ReadExt, WriteExt
Mar 24, 2015
00e14f1
core: Update docs for StrExt demotion in libstd
Mar 24, 2015
547a48e
collections: Update docs for slice since SliceExt was removed
Mar 24, 2015
5fa4b4c
Remove unnecessary bounds from Drop impl for `Arc` and `arc::Weak` and
pnkfelix Mar 21, 2015
0adab50
Added `T:Send` bound to `sync::mpsc::Receiver` and `sync::mpsc::Sender`.
pnkfelix Mar 21, 2015
26a79e3
Added `Write` bounds to avoid a specialized Drop impl for `BufWriter`.
pnkfelix Mar 21, 2015
1249e60
Added `T:Send` bound to `Queue<T>` to avoid specialized Drop impl.
pnkfelix Mar 21, 2015
1e71d2e
Added `W: Writer` bound to `BufferedWriter<W>` to avoid specialized `…
pnkfelix Mar 21, 2015
018eeb7
added `T:Send` bound to `Mutex<T>` to avoid specialized Drop impl.
pnkfelix Mar 21, 2015
123b5c1
Added `T:Send` bound to `Packet<T>` to avoid specialized `Drop` impl.
pnkfelix Mar 21, 2015
5f57fd5
Added `T:Send` bound to `Queue<T>` to avoid specialized `Drop` impl.
pnkfelix Mar 21, 2015
290c8de
Added `T:Send` bound to `JoinGuard<T>` to avoid specialized `Drop` impl.
pnkfelix Mar 21, 2015
5b2e869
Reject specialized Drop impls.
pnkfelix Mar 21, 2015
1955e05
Unit tests for Issue 8142, collected into one file.
pnkfelix Mar 24, 2015
7e3ee02
Bug fixes
nrc Mar 24, 2015
8f6c879
rollup merge of #23282: nikomatsakis/fn-trait-inheritance
alexcrichton Mar 24, 2015
f5b65c5
rollup merge of #23573: steveklabnik/doc_associated_types
alexcrichton Mar 24, 2015
6106345
rollup merge of #23592: alexcrichton/tweak-at-exit
alexcrichton Mar 24, 2015
6da0b9d
rollup merge of #23629: liammonahan/master
alexcrichton Mar 24, 2015
a1d2e62
rollup merge of #23630: nrc/coerce-tidy
alexcrichton Mar 24, 2015
37d57e7
rollup merge of #23646: steveklabnik/doc_file
alexcrichton Mar 24, 2015
5c74ed9
rollup merge of #23659: GBGamer/master
alexcrichton Mar 24, 2015
8a0bb42
rollup merge of #23661: steveklabnik/any_docs
alexcrichton Mar 24, 2015
020efc7
rollup merge of #23662: steveklabnik/gh23421
alexcrichton Mar 24, 2015
5ed8733
rollup merge of #23668: alexcrichton/io-zero
alexcrichton Mar 24, 2015
eb2f1d9
rustc: Add support for `extern crate foo as bar`
alexcrichton Mar 19, 2015
91b633a
rollup merge of #23546: alexcrichton/hyphens
alexcrichton Mar 24, 2015
3b13b9c
rollup merge of #23638: pnkfelix/fsk-reject-specialized-drops
alexcrichton Mar 24, 2015
19cd000
rollup merge of #23671: steveklabnik/doc_std_clone
alexcrichton Mar 24, 2015
492f07b
Fix some fallout in librustdoc
nagisa Mar 24, 2015
123a754
Auto merge of #23546 - alexcrichton:hyphens, r=brson
bors Mar 24, 2015
efaef24
Test fixes and rebase conflicts, round 1
alexcrichton Mar 24, 2015
db2c3ba
rollup merge of #23674: nagisa/fallout-1
alexcrichton Mar 24, 2015
3021d4c
Test fixes and rebase conflicts, round 2
alexcrichton Mar 24, 2015
593db00
Auto merge of #23681 - alexcrichton:rollup, r=alexcrichton
bors Mar 25, 2015
eb5ed10
[iOS] Fallout from 8389253
tamird Mar 25, 2015
1663665
Fix ICE on SIMD overflow checking
yjh0502 Mar 25, 2015
eefb8e2
unbreak bitrig/openbsd build after 8389253d
semarie Mar 25, 2015
928e2e2
Auto merge of #23670 - cmr:vec-push-slowpath, r=pcwalton
bors Mar 25, 2015
a99936b
make it use gdb instead of lldb when mac-android cross compile
Mar 25, 2015
c66a2b7
Ignore some tests on aarch64
Mar 25, 2015
b6783e6
Rollup merge of #23617 - steveklabnik:gh23564, r=Manishearth
Manishearth Mar 25, 2015
5535767
Rollup merge of #23664 - bluss:std-docs, r=steveklabnik
Manishearth Mar 25, 2015
858f543
Add "trace-macros" as a compiler flag
Mar 25, 2015
cc259fb
Always properly copy values into bindings when mutating the match dis…
dotdash Mar 25, 2015
5a5845d
Rollup merge of #23684 - tamird:ios-fallout, r=alexcrichton
Manishearth Mar 25, 2015
4283b2a
Rollup merge of #23692 - yjh0502:fix/simd-overflow, r=pnkfelix
Manishearth Mar 25, 2015
2354fc9
Rollup merge of #23693 - semarie:openbsd-pathbuf-new, r=nikomatsakis
Manishearth Mar 25, 2015
e962a1d
Rollup merge of #23702 - dotdash:match_reass, r=eddyb
Manishearth Mar 25, 2015
a923278
Auto merge of #23697 - Manishearth:rollup, r=Manishearth
bors Mar 25, 2015
a3b1361
Auto merge of #23434 - alexcrichton:misc-stab, r=aturon
bors Mar 25, 2015
65f24c8
Add more descriptive explanation of trace-macros flag
Mar 25, 2015
2790184
Auto merge of #23695 - sae-bom:mac-android-debuginfo, r=alexcrichton
bors Mar 25, 2015
02c6f6b
test: Make a test less flaky
alexcrichton Mar 25, 2015
d4ba1ca
Auto merge of #23718 - alexcrichton:flaky-test, r=huonw
bors Mar 26, 2015
b0fd67b
Auto merge of #23691 - richo:dedup-typeorigin-mergable, r=eddyb
bors Mar 26, 2015
42c59cd
Add "trace-macros" as a compiler flag
Mar 25, 2015
f3d4e64
Add more descriptive explanation of trace-macros flag
Mar 25, 2015
ce355d4
Add run-make test for trace-macros flag
Mar 26, 2015
32d800e
Merge branch 'issue-22619' of github.com:laumann/rust into issue-22619
Mar 26, 2015
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
Always properly copy values into bindings when mutating the match dis…
…criminant

The reassignment checker effectively only checks whether the last
assignment in a body affects the discriminant, but it should of course
check all the assignments.

Fixes #23698
  • Loading branch information
dotdash committed Mar 25, 2015
commit cc259fb6c36c6033d2befcb11535a98adda03b3f
4 changes: 2 additions & 2 deletions src/librustc_trans/trans/_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1352,12 +1352,12 @@ impl<'tcx> euv::Delegate<'tcx> for ReassignmentChecker {
fn mutate(&mut self, _: ast::NodeId, _: Span, cmt: mc::cmt, _: euv::MutateMode) {
match cmt.cat {
mc::cat_upvar(mc::Upvar { id: ty::UpvarId { var_id: vid, .. }, .. }) |
mc::cat_local(vid) => self.reassigned = self.node == vid,
mc::cat_local(vid) => self.reassigned |= self.node == vid,
mc::cat_interior(ref base_cmt, mc::InteriorField(field)) => {
match base_cmt.cat {
mc::cat_upvar(mc::Upvar { id: ty::UpvarId { var_id: vid, .. }, .. }) |
mc::cat_local(vid) => {
self.reassigned = self.node == vid && Some(field) == self.field
self.reassigned |= self.node == vid && Some(field) == self.field
},
_ => {}
}
Expand Down
30 changes: 30 additions & 0 deletions src/test/run-pass/match-reassign.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Regression test for #23698: The reassignment checker only cared
// about the last assigment in a match arm body

// Use an extra function to make sure no extra assignments
// are introduced by macros in the match statement
fn check_eq(x: i32, y: i32) {
assert_eq!(x, y);
}

#[allow(unused_assignments)]
fn main() {
let mut x = Box::new(1);
match x {
y => {
x = Box::new(2);
let _tmp = 1; // This assignment used to throw off the reassignment checker
check_eq(*y, 1);
}
}
}