8000 Rollup of 10 pull requests by Dylan-DPC-zz · Pull Request #78232 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 10 pull requests #78232

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 43 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3b37d94
Add some tests
Nadrieril Oct 17, 2020
bb81110
Destructure byte array constants to array patterns instead of keeping…
oli-obk Sep 29, 2020
c3d0445
Destructure byte slices and remove all the workarounds
oli-obk Oct 1, 2020
99852e0
A ConstantValue constructor with a slice pattern is an error
Nadrieril Oct 17, 2020
3708c86
Treat booleans as integers with valid range 0..=1
oli-obk Oct 2, 2020
f504e9a
Fix comment
Nadrieril Oct 17, 2020
aa41720
Handle ranges of float consistently
Nadrieril Oct 17, 2020
d1a784e
Treat string literals separately from other constants
Nadrieril Oct 17, 2020
da0ba2f
The only remaining constant patterns are opaque
Nadrieril Oct 18, 2020
c4ae6c2
Add comment
Nadrieril Oct 18, 2020
13a5067
Unignore test
Oct 13, 2020
0558e6e
bootstrap: fall back to auto-detected CXX
jonas-schievink Oct 14, 2020
77a7ccf
bootstrap: configure native toolchain for run-make
jonas-schievink Oct 14, 2020
e36de6b
Move issue-36710 test to run-make
jonas-schievink Oct 14, 2020
a671604
Ignore test on WASM
jonas-schievink Oct 14, 2020
d7c7649
ignore-thumb
jonas-schievink Oct 16, 2020
60594b1
Ignore on 32-bit targets
Oct 19, 2020
2780e35
Throw core::panic!("message") as &str instead of String.
m-ou-se Oct 19, 2020
9890217
Fix ui test for updated core::panic behaviour.
m-ou-se Oct 19, 2020
d80f127
Avoid panic_bounds_check in fmt::write.
m-ou-se Oct 19, 2020
5bfd3e7
Accidentally fixed #78071
Nadrieril Oct 19, 2020
ea24395
Add debug_asserts for the unsafe indexing in fmt::write.
m-ou-se Oct 20, 2020
5948e62
Sync LLVM submodule if it has been initialized
est31 Oct 20, 2020
356d5b5
Add test to check for fmt::write bloat.
m-ou-se Oct 20, 2020
e852a4a
Update cargo
ehuss Oct 20, 2020
52640f2
[mir-opt] Allow debuginfo to be generated for a constant or a Place
wesleywiser May 30, 2020
2202653
Miri engine validity check: simplify code with 'matches!'
RalfJung Oct 21, 2020
fcaf233
Miri engine interning: improve comments, and entirely skip ZST
RalfJung Oct 21, 2020
3519411
Add a test for #53708
Nadrieril Oct 21, 2020
faf8710
Explain the `Opaque` special case in specialization
Nadrieril Oct 21, 2020
484d9eb
Move fmt-write-bloat test to run-make-fulldeps.
m-ou-se Oct 21, 2020
3a58ad9
Update `compiler_builtins` to 0.1.36
JohnTitor Oct 21, 2020
10d6f2d
Add regression test for #73298
varkor Oct 21, 2020
7fecaca
Rollup merge of #73210 - wesleywiser:consts_in_debuginfo, r=oli-obk
Dylan-DPC Oct 22, 2020
80897de
Rollup merge of #77901 - jonas-schievink:unignore-test-36710, r=Mark-…
Dylan-DPC Oct 22, 2020
d08f484
Rollup merge of #78072 - Nadrieril:cleanup-constant-matching, r=varkor
Dylan-DPC Oct 22, 2020
4b223d7
Rollup merge of #78119 - fusion-engineering-forks:panic-use-as-str, r…
Dylan-DPC Oct 22, 2020
4816d30
Rollup merge of #78122 - fusion-engineering-forks:fmt-write-bounds-ch…
Dylan-DPC Oct 22, 2020
8b861e3
Rollup merge of #78153 - est31:downloaded_llvm_maybe_sync, r=Mark-Sim…
Dylan-DPC Oct 22, 2020
faa1d37
Rollup merge of #78169 - ehuss:update-cargo, r=ehuss
Dylan-DPC Oct 22, 2020
03a4fcb
Rollup merge of #78179 - RalfJung:miri-comments, r=oli-obk
Dylan-DPC Oct 22, 2020
db12963
Rollup merge of #78207 - varkor:issue-73298, r=lcnr
Dylan-DPC Oct 22, 2020
62ffb30
Rollup merge of #78209 - JohnTitor:compiler-builtins, r=Amanieu
Dylan-DPC Oct 22, 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
Prev Previous commit
Next Next commit
Miri engine validity check: simplify code with 'matches!'
and improve a comment a bit
  • Loading branch information
RalfJung committed Oct 21, 2020
commit 22026538931f7349a1b78d7644b0288ff3282db2
20 changes: 8 additions & 12 deletions compiler/rustc_mir/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -775,17 +775,13 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
);
}
ty::Array(tys, ..) | ty::Slice(tys)
if {
// This optimization applies for types that can hold arbitrary bytes (such as
// integer and floating point types) or for structs or tuples with no fields.
// FIXME(wesleywiser) This logic could be extended further to arbitrary structs
// or tuples made up of integer/floating point types or inhabited ZSTs with no
// padding.
match tys.kind() {
ty::Int(..) | ty::Uint(..) | ty::Float(..) => true,
_ => false,
}
} =>
// This optimization applies for types that can hold arbitrary bytes (such as
// integer and floating point types) or for structs or tuples with no fields.
// FIXME(wesleywiser) This logic could be extended further to arbitrary structs
// or tuples made up of integer/floating point types or inhabited ZSTs with no
// padding.
if matches!(tys.kind(), ty::Int(..) | ty::Uint(..) | ty::Float(..))
=>
{
// Optimized handling for arrays of integer/float type.

Expand Down Expand Up @@ -853,7 +849,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M>
// of an array and not all of them, because there's only a single value of a specific
// ZST type, so either validation fails for all elements or none.
ty::Array(tys, ..) | ty::Slice(tys) if self.ecx.layout_of(tys)?.is_zst() => {
// Validate just the first element
// Validate just the first element (if any).
self.walk_aggregate(op, fields.take(1))?
}
_ => {
Expand Down
0