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 13 pull requests #73498

Merged
merged 47 commits into from
Jun 19, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift click to select a range
730f736
Fix asinh of negative values
Ralith May 23, 2020
f7d745f
tag/niche terminology cleanup
RalfJung May 23, 2020
7a6d03c
miri errors: rename InvalidDiscriminant -> InvalidTag
RalfJung May 30, 2020
20abc70
Don't intern memory in const prop.
oli-obk Jun 3, 2020
1e88f13
Stop allowing `Indirect(..)` values to be propagated
wesleywiser Jun 8, 2020
9ceb9bb
Move copying of self-contained objects to new function
mati865 Jun 2, 2020
638ebbc
Move copying of MinGW CRT to the better location
mati865 Jun 2, 2020
961974f
Use enum to distinguish dependency type
mati865 Jun 2, 2020
5d29883
Move some libs to self-contained directory
mati865 Jun 11, 2020
e9ac01a
Get self-contained directory path via dedicated function
mati865 Jun 8, 2020
43905cd
Move shipped MinGW linker to self-contained dir
mati865 Jun 8, 2020
d5ea0e9
Report error when casting an C-like enum implementing Drop
oddg May 15, 2020
e32db84
Add rust features to print target features
aszenz Jun 14, 2020
a40156e
UI test for deprecation warning of casting enum implementing Drop
oddg Jun 14, 2020
0906066
Test that bounds checks are elided when slice len is checked up-front
erikdesjardins Jun 15, 2020
d3ca6fd
Enable static-pie for the x86_64-unknown-linux-musl target
haraldh Jun 15, 2020
b5809b0
Update src/librustc_typeck/check/cast.rs
nikomatsakis Jun 15, 2020
10c8d2a
add FIXME to EnumTagInfo
RalfJung Jun 15, 2020
e0975b9
elaborate, add check for exact bounds
erikdesjardins Jun 15, 2020
f3dfe80
Adjust error message
oddg Jun 16, 2020
1990f97
Disallow loading crates with non-ascii identifier name.
crlf0710 Jun 13, 2020
4506a35
add header for rust specific feature
aszenz Jun 16, 2020
9f50f84
break long line for formatting
aszenz Jun 16, 2020
457acbd
trim whitespace
aszenz Jun 16, 2020
caffb28
add blank line bw sections
aszenz Jun 17, 2020
6351850
ignore-debug: debug assertions in slice indexing prevent the optimiza…
erikdesjardins Jun 17, 2020
a7c2cf8
Reduce pointer casts in Box::into_boxed_slice
cuviper Jun 17, 2020
d134870
Document format correction
qy3u Jun 18, 2020
abb5800
Ensure std benchmarks get tested.
ehuss Jun 8, 2020
8aecafe
Fix liballoc doc spelling
pickfire Jun 18, 2020
ec8ff1c
Liballoc clean up macro_rules style
pickfire Jun 18, 2020
111c2d2
Rearrange liballoc __impl_slice_eq1
pickfire Jun 18, 2020
5a9ff05
Disable core benches on wasm (benches not supported).
ehuss Jun 18, 2020
35a2915
Remove now-redundant branch
Ralith Jun 19, 2020
27d4737
Rollup merge of #70740 - haraldh:static-pie, r=petrochenkov
RalfJung Jun 19, 2020
9c54c65
Rollup merge of #72331 - oddg:forbid-cast-of-cenum-implementing-drop,…
RalfJung Jun 19, 2020
99be102
Rollup merge of #72486 - Ralith:asinh-fix, r=dtolnay
RalfJung Jun 19, 2020
5e7eec2
Rollup merge of #72497 - RalfJung:tag-term, r=oli-obk
RalfJung Jun 19, 2020
ea3c309
Rollup merge of #72999 - mati865:separate-self-contained-dir, r=Mark-…
RalfJung Jun 19, 2020
098949b
Rollup merge of #73130 - wesleywiser:remove_const_prop_for_indirects,…
RalfJung Jun 19, 2020
78f3e9c
Rollup merge of #73142 - ehuss:std-benches, r=dtolnay
RalfJung Jun 19, 2020
3b4bec2
Rollup merge of #73305 - crlf0710:disallow_loading_monsters, r=petroc…
RalfJung Jun 19, 2020
8d79ebd
Rollup merge of #73346 - aszenz:patch-1, r=cuviper
RalfJung Jun 19, 2020
7d3238f
Rollup merge of #73362 - erikdesjardins:bounds, r=nikomatsakis
RalfJung Jun 19, 2020
fc2ce7c
Rollup merge of #73459 - cuviper:into_boxed_slice-unicast, r=dtolnay
RalfJung Jun 19, 2020
f7d833e
Rollup merge of #73464 - qy3u:fs-document-format-correction, r=jonas-…
RalfJung Jun 19, 2020
028c908
Rollup merge of #73479 - pickfire:liballoc-spell, r=dtolnay
RalfJung Jun 19, 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
Don't intern memory in const prop.
This isn't sound without validation. We don't want to report errors in case of failure to intern and validate, we just don't want to const prop. Interning and const prop is not built for this, let's not do it until we have a clearer picture on aggregate propagation.
  • Loading branch information
oli-obk authored and wesleywiser committed Jun 7, 2020
commit 20abc70e04eefa252e5a8bfe934cb54c51c1da37
12 changes: 6 additions & 6 deletions src/librustc_mir/interpret/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 294,6 @@ pub enum InternKind {
Static(hir::Mutability),
Constant,
Promoted,
ConstProp,
}

/// Intern `ret` and everything it references.
Expand All @@ -315,9 314,7 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
let base_intern_mode = match intern_kind {
InternKind::Static(mutbl) => InternMode::Static(mutbl),
// FIXME: what about array lengths, array initializers?
InternKind::Constant | InternKind::ConstProp | InternKind::Promoted => {
InternMode::ConstBase
}
InternKind::Constant | InternKind::Promoted => InternMode::ConstBase,
};

// Type based interning.
Expand Down Expand Up @@ -359,7 356,10 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
Err(error) => {
ecx.tcx.sess.delay_span_bug(
ecx.tcx.span,
"error during interning should later cause validation failure",
&format!(
"error during interning should later cause validation failure: {}",
error
),
);
// Some errors shouldn't come up because creating them causes
// an allocation, which we should avoid. When that happens,
Expand Down Expand Up @@ -400,7 400,7 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
// immutability is so important.
alloc.mutability = Mutability::Not;
}
InternKind::Constant | InternKind::ConstProp => {
InternKind::Constant => {
// If it's a constant, we should not have any "leftovers" as everything
// is tracked by const-checking.
// FIXME: downgrade this to a warning? It rejects some legitimate consts,
Expand Down
12 changes: 4 additions & 8 deletions src/librustc_mir/transform/const_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 27,9 @@ use rustc_trait_selection::traits;

use crate::const_eval::error_to_const_error;
use crate::interpret::{
self, compile_time_machine, intern_const_alloc_recursive, AllocId, Allocation, Frame, ImmTy,
Immediate, InternKind, InterpCx, LocalState, LocalValue, Memory, MemoryKind, OpTy,
Operand as InterpOperand, PlaceTy, Pointer, ScalarMaybeUninit, StackPopCleanup,
self, compile_time_machine, AllocId, Allocation, Frame, ImmTy, Immediate, InterpCx, LocalState,
LocalValue, Memory, MemoryKind, OpTy, Operand as InterpOperand, PlaceTy, Pointer,
ScalarMaybeUninit, StackPopCleanup,
};
use crate::transform::{MirPass, MirSource};

Expand Down Expand Up @@ -707,11 707,7 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
ScalarMaybeUninit::Scalar(l),
ScalarMaybeUninit::Scalar(r),
)) => l.is_bits() && r.is_bits(),
interpret::Operand::Indirect(_) if mir_opt_level >= 2 => {
let mplace = op.assert_mem_place(&self.ecx);
intern_const_alloc_recursive(&mut self.ecx, InternKind::ConstProp, mplace, false);
true
}
interpret::Operand::Indirect(_) if mir_opt_level >= 2 => true,
_ => false,
}
}
Expand Down