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 15 pull requests #77001

Closed
wants to merge 39 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b1375cd
Deny unsafe op in unsafe fns without the unsafe keyword, first part f…
poliorcetics Jul 10, 2020
3a22b21
Finished documenting all unsafe op inside unsafe fn
poliorcetics Jul 10, 2020
ee289d2
Improve some SAFETY comments following suggestions
poliorcetics Aug 29, 2020
4675a31
Use intra-doc links in core/src/iter when possible
poliorcetics Sep 18, 2020
bffd211
Finish moving to intra doc links for std::sync
poliorcetics Sep 18, 2020
982ec0d
Fix broken link
poliorcetics Sep 18, 2020
b534d9f
Fix broken link
poliorcetics Sep 18, 2020
0bc405e
Remove DeclareMethods
khyperia Sep 18, 2020
65edf54
Add a regression test for copy propagation miscompilation
tmiasko Sep 20, 2020
cebbd9f
Use as_nanos in bench.rs and base.rs
est31 Sep 20, 2020
43193dc
Use as_secs_f64 in profiling.rs
est31 Sep 20, 2020
4bc0e55
Replace write_fmt with write!
est31 Sep 20, 2020
b2c5f99
Add test for issue #34634
bugadani Sep 20, 2020
812ff66
Use const_cstr macro in consts.rs
est31 Sep 20, 2020
c2dad1c
Remove unused static_assert macro
est31 Sep 20, 2020
5ef1db3
Revert adding Atomic::from_mut.
m-ou-se Sep 20, 2020
0e56b52
Fix accordingly to review
poliorcetics Sep 20, 2020
08b85a6
use iter:: before free functions
poliorcetics Sep 20, 2020
8169989
Add non-`unsafe` `.get_mut()` for `UnsafeCell`
danielhenrymantilla Sep 19, 2020
5886c38
Replace unneeded `unsafe` calls to `.get()` with calls to `.get_mut()`
danielhenrymantilla Sep 19, 2020
aaddcdb
Fix nits
poliorcetics Sep 20, 2020
d99bb9d
liballoc bench use imported path Bencher
pickfire Sep 20, 2020
37ec045
BTreeMap: extra testing unveiling mistakes in future PR
ssomers Sep 19, 2020
c9c8fb8
Add sample defaults for config.toml
jyn514 Sep 12, 2020
be347bc
Rollup merge of #74225 - poliorcetics:std-thread-unsafe-op-in-unsafe-…
RalfJung Sep 21, 2020
eb0f3dd
Rollup merge of #76628 - jyn514:default-config-files, r=Mark-Simulacrum
RalfJung Sep 21, 2020
d93e2b6
Rollup merge of #76867 - poliorcetics:intra-doc-core-iter, r=jyn514
RalfJung Sep 21, 2020
a44e0b0
Rollup merge of #76868 - poliorcetics:intra-doc-std-sync, r=jyn514
RalfJung Sep 21, 2020
d79401c
Rollup merge of #76872 - khyperia:remove_declare_methods, r=eddyb
RalfJung Sep 21, 2020
1f8ee01
Rollup merge of #76936 - danielhenrymantilla:unsafecell_get_mut, r=Ra…
RalfJung Sep 21, 2020
fe325cc
Rollup merge of #76958 - est31:ns, r=oli-obk
RalfJung Sep 21, 2020
19c382a
Rollup merge of #76959 - est31:write, r=oli-obk
RalfJung Sep 21, 2020
18d1b1b
Rollup merge of #76961 - bugadani:test-34634, r=Mark-Simulacrum
RalfJung Sep 21, 2020
62a2e1f
Rollup merge of #76962 - est31:const_cstr, r=oli-obk
RalfJung Sep 21, 2020
7261beb
Rollup merge of #76963 - est31:remove_static_assert, r=oli-obk
RalfJung Sep 21, 2020
7d1cd3a
Rollup merge of #76967 - fusion-engineering-forks:revert-atomic-from-…
RalfJung Sep 21, 2020
ab68b8b
Rollup merge of #76977 - tmiasko:issue-76740, r=wesleywiser
RalfJung Sep 21, 2020
5f47246
Rollup merge of #76981 - pickfire:patch-5, r=Mark-Simulacrum
RalfJung Sep 21, 2020
6ef1377
Rollup merge of #76983 - ssomers:btree_extra_test, r=Mark-Simulacrum
RalfJung Sep 21, 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
30 changes: 30 additions & 0 deletions src/test/ui/mir/issue-76740-copy-propagation.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Regression test for issue #76740.
// run-fail FIXME: change to run-pass once #76899 lands
// compile-flags: -Zmir-opt-level=3

#[derive(Copy, Clone)]
pub struct V([usize; 4]);

impl V {
fn new() -> Self {
V([0; 4])
}

#[inline(never)]
fn check(mut self) {
assert_eq!(self.0[0], 0);
self.0[0] = 1;
}
}

fn main() {
let v = V::new();
let mut i = 0;
while i != 10 {
// Copy propagation incorrectly assumed that Operand::Move does not
// mutate the local, and used the same v for each V::check call,
// rather than a copy.
v.check();
i += 1;
}
}