Skip to content

Various const eval and pattern matching ICE fixes #67192

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

Merged
merged 22 commits into from
Dec 27, 2019
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1e40681
Don't ICE on the use of integer addresses for ZST constants in patter…
oli-obk Dec 13, 2019
b5b5258
Retire `to_ptr` which should already have no users but still kept get…
oli-obk Dec 13, 2019
bb1ecee
Simplify `force_allocation_maybe_sized`
oli-obk Dec 13, 2019
13694de
Comment on a few odd things that we should look at
oli-obk Dec 13, 2019
a0bd1a6
Prevent an ICE on invalid transmutes
oli-obk Dec 13, 2019
0e969b7
Interning even happens when validation of a constant fails
oli-obk Dec 14, 2019
a7a011d
Immediately evaluate and validate constants when we want them as oper…
oli-obk Dec 20, 2019
6b651b1
Add regression test for ZST statics being allowed to "read" from them…
oli-obk Dec 20, 2019
41d5818
Explain ParamEnv::reveal_all usage
oli-obk Dec 22, 2019
8a88ff1
Comments should start capitalized and end in a period
oli-obk Dec 22, 2019
cb8d1c3
Explain what we are doing with parameter environments for statics
oli-obk Dec 22, 2019
6937ca2
Explain the currently necessary existance of `TransmuteSizeDiff`
oli-obk Dec 22, 2019
72ebce0
Remove unintended noisy log statement
oli-obk Dec 22, 2019
0e3fafa
Typo
oli-obk Dec 22, 2019
9520551
Explain why `const_eval` is ok here
oli-obk Dec 22, 2019
1acbf4b
Early abort instead of building up zero sized values
oli-obk Dec 22, 2019
20c1b3f
Add a `const_eval` helper to `InterpCx`
oli-obk Dec 22, 2019
1531c39
Documentation nit
oli-obk Dec 22, 2019
b476344
Reintroduce the recursion comment
oli-obk Dec 22, 2019
aaffe12
Use the targetted const eval functions
oli-obk Dec 23, 2019
12a4c2c
Fix rebase fallout
oli-obk Dec 23, 2019
f65a91e
Make ui test bitwidth independent
oli-obk Dec 24, 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
Prev Previous commit
Next Next commit
Comments should start capitalized and end in a period
  • Loading branch information
oli-obk committed Dec 26, 2019
commit 8a88ff1006189de229c0c92c48e1ddd7a3144e81
8 changes: 4 additions & 4 deletions src/librustc_mir/interpret/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,15 @@ impl<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx
if let ty::Ref(_, referenced_ty, mutability) = ty.kind {
let value = self.ecx.read_immediate(mplace.into())?;
let mplace = self.ecx.ref_to_mplace(value)?;
// Handle trait object vtables
// Handle trait object vtables.
if let ty::Dynamic(..) =
self.ecx.tcx.struct_tail_erasing_lifetimes(referenced_ty, self.ecx.param_env).kind
{
// Validation has already errored on an invalid vtable pointer so we can safely not
// do anything if this is not a real pointer
// do anything if this is not a real pointer.
if let Scalar::Ptr(vtable) = mplace.meta.unwrap() {
// explitly choose `Immutable` here, since vtables are immutable, even
// if the reference of the fat pointer is mutable
// Explitly choose `Immutable` here, since vtables are immutable, even
// if the reference of the fat pointer is mutable.
self.intern_shallow(vtable.alloc_id, Mutability::Not, None)?;
} else {
self.ecx().tcx.sess.delay_span_bug(
Expand Down