8000 Rollup of 9 pull requests by RalfJung · Pull Request #72203 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 9 pull requests #72203

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 31 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cb27039
Use min_specialization in liballoc
matthewjasper Apr 19, 2020
e5a1be8
Use `LocalDefId` in `DumpVisitor::nest_tables`
marmeladema May 2, 2020
3471bc8
Fix unused_parens false positive when using binary operations
mibac138 May 4, 2020
717a7a8
Update src/test/ui/lint/issue-71290-unused-paren-binop.rs
mibac138 May 5, 2020
4b7a928
Fix unused_parens nested binary op false positive
mibac138 May 5, 2020
1fce203
expand "incomplete feature" message to include unsoundness and link t…
RalfJung May 9, 2020
6a8cf4a
adjust tests
RalfJung Apr 22, 2020
c400f75
Miri interning: replace ICEs by proper errors, make intern_shallow ty…
RalfJung Apr 29, 2020
8e48a30
remove some dead code, and assert we do not swallow allocating errors
RalfJung Apr 29, 2020
ff39457
avoid raising interpreter errors from interning
RalfJung Apr 29, 2020
d3b2e1f
fmt
RalfJung Apr 29, 2020
a06740c
Typo
RalfJung Apr 29, 2020
e73ee41
rebase fallout
RalfJung May 4, 2020
5e35493
cargo update -p serde_derive
Xanewok May 5, 2020
403a9d0
cargo update -p failure_derive
Xanewok May 5, 2020
8c6e568
cargo update -p pest_generator
Xanewok May 5, 2020
3bdaced
cargo update -p derive-new
Xanewok May 5, 2020
e26f35d
rustbook: Bump mdbook dependency
Xanewok May 5, 2020
9111d8b
Fix the new capacity measurement in arenas.
nnethercote May 4, 2020
40d4868
Be less aggressive with `DroplessArena`/`TypedArena` growth.
nnethercote May 4, 2020
31fbf33
Clean up E0589 explanation
GuillaumeGomez May 14, 2020
f6aa161
Don't ICE on missing `Unsize` impl
cofibrant May 14, 2020
73c227c
Rollup merge of #71321 - matthewjasper:alloc-min-spec, r=sfackler
RalfJung May 14, 2020
47960fe
Rollup merge of #71665 - RalfJung:miri-intern-no-ice, r=oli-obk
RalfJung May 14, 2020
ef55dc0
Rollup merge of #71809 - marmeladema:fix-issue-71104, r=eddyb
RalfJung May 14, 2020
8bd2319
Rollup merge of #71872 - nnethercote:less-aggressive-arena-growth, r=…
RalfJung May 14, 2020
91cd222
Rollup merge of #71910 - mibac138:necessary-paren, r=cuviper
RalfJung May 14, 2020
30811cf
Rollup merge of #71919 - Xanewok:bump-syn-1, r=Mark-Simulacrum
RalfJung May 14, 2020
c038ea1
Rollup merge of #72045 - RalfJung:incomplete-unsound, r=petrochenkov
RalfJung May 14, 2020
8cc6147
Rollup merge of #72191 - GuillaumeGomez:cleanup-e0589, r=Dylan-DPC
RalfJung May 14, 2020
2b03aa2
Rollup merge of #72194 - doctorn:dispatch-from-dyn-ice, r=estebank
RalfJung May 14, 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
fmt
  • Loading branch information
RalfJung committed May 10, 2020
commit d3b2e1fb9ed93575c9780e63f29a28d478b36c2b
43 changes: 16 additions & 27 deletions src/librustc_mir/interpret/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,7 @@ impl<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx>> InternVisitor<'rt, 'mir
mode: InternMode,
ty: Option<Ty<'tcx>>,
) -> Option<IsStaticOrFn> {
intern_shallow(
self.ecx,
self.leftover_allocations,
alloc_id,
mode,
ty,
)
intern_shallow(self.ecx, self.leftover_allocations, alloc_id, mode, ty)
}
}

Expand Down Expand Up @@ -216,10 +210,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx>> ValueVisitor<'mir
self.intern_shallow(vtable.alloc_id, InternMode::ConstInner, None);
} else {
// Let validation show the error message, but make sure it *does* error.
tcx.sess.delay_span_bug(
tcx.span,
"vtables pointers cannot be integer pointers",
);
tcx.sess
.delay_span_bug(tcx.span, "vtables pointers cannot be integer pointers");
}
}
// Check if we have encountered this pointer+layout combination before.
Expand Down Expand Up @@ -264,7 +256,8 @@ impl<'rt, 'mir, 'tcx: 'mir, M: CompileTimeMachine<'mir, 'tcx>> ValueVisitor<'mir
ty::Array(_, n)
if n.eval_usize(tcx.tcx, self.ecx.param_env) == 0 => {}
ty::Slice(_)
if mplace.meta.unwrap_meta().to_machine_usize(self.ecx)? == 0 => {}
if mplace.meta.unwrap_meta().to_machine_usize(self.ecx)?
== 0 => {}
_ => mutable_memory_in_const(tcx, "`&mut`"),
}
} else {
Expand Down Expand Up @@ -315,16 +308,16 @@ pub fn intern_const_alloc_recursive<M: CompileTimeMachine<'mir, 'tcx>>(
intern_kind: InternKind,
ret: MPlaceTy<'tcx>,
ignore_interior_mut_in_const: bool,
)
where
) where
'tcx: 'mir,
{
let tcx = ecx.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::ConstProp | InternKind::Promoted => {
InternMode::ConstBase
}
};

// Type based interning.
Expand Down Expand Up @@ -362,7 +355,7 @@ where
// references are "leftover"-interned, and later validation will show a proper error
// and point at the right part of the value causing the problem.
match res {
Ok(()) => {},
Ok(()) => {}
Err(error) => {
ecx.tcx.sess.delay_span_bug(
ecx.tcx.span,
Expand Down Expand Up @@ -412,10 +405,9 @@ where
// is tracked by const-checking.
// FIXME: downgrade this to a warning? It rejects some legitimate consts,
// such as `const CONST_RAW: *const Vec<i32> = &Vec::new() as *const _;`.
ecx.tcx.sess.span_err(
ecx.tcx.span,
"untyped pointers are not allowed in constant",
);
ecx.tcx
.sess
.span_err(ecx.tcx.span, "untyped pointers are not allowed in constant");
// For better errors later, mark the allocation as immutable.
alloc.mutability = Mutability::Not;
}
Expand All @@ -430,13 +422,10 @@ where
} else if ecx.memory.dead_alloc_map.contains_key(&alloc_id) {
// Codegen does not like dangling pointers, and generally `tcx` assumes that
// all allocations referenced anywhere actually exist. So, make sure we error here.
ecx.tcx.sess.span_err(
ecx.tcx.span,
"encountered dangling pointer in final constant",
);
ecx.tcx.sess.span_err(ecx.tcx.span, "encountered dangling pointer in final constant");
} else if ecx.tcx.get_global_alloc(alloc_id).is_none() {
// We have hit an `AllocId` that is neither in local or global memory and isn't
// marked as dangling by local memory. That should be impossible.
// We have hit an `AllocId` that is neither in local or global memory and isn't
// marked as dangling by local memory. That should be impossible.
span_bug!(ecx.tcx.span, "encountered unknown alloc id {:?}", alloc_id);
}
}
Expand Down
0