Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
d95a6cf
Add support for --test-args to cargotest
jyn514 May 1, 2021
3b4b1ea
Don't check bootstrap artifacts by default
jyn514 May 1, 2021
50c3890
bump deps
klensy May 1, 2021
aa68ec2
Retry clang+llvm download
Mark-Simulacrum May 4, 2021
abdba81
use CheckInAllocMsg::PointerArithmeticTest for ptr_offset error
RalfJung May 5, 2021
bcf622b
32bit bless
RalfJung May 6, 2021
cdbfea5
Sort rustdoc-gui tests
GuillaumeGomez May 6, 2021
cb70221
Coverage instruments closure bodies in macros (not the macro body)
richkadel May 4, 2021
f58a362
Update coverage docs and command line help
richkadel May 3, 2021
8075b28
Renamed compiler-flags file to name of compiler-flag: instrument-cove…
richkadel May 6, 2021
cd3a8c1
Removes unneeded check of `#[no_coverage]` in mapgen
richkadel May 3, 2021
2d496f4
Rollup merge of #84779 - jyn514:cargotest-args, r=Mark-Simulacrum
JohnTitor May 7, 2021
1224e13
Rollup merge of #84781 - jyn514:check-bootstrap, r=Mark-Simulacrum
JohnTitor May 7, 2021
246e8d1
Rollup merge of #84787 - klensy:deps-bump, r=Mark-Simulacrum
JohnTitor May 7, 2021
283ef86
Rollup merge of #84815 - richkadel:coverage-docs-update-2021-05, r=tm…
JohnTitor May 7, 2021
b088318
Rollup merge of #84875 - richkadel:no-coverage-dont-check-unused, r=t…
JohnTitor May 7, 2021
343a094
Rollup merge of #84897 - richkadel:cover-closure-macros, r=tmandry
JohnTitor May 7, 2021
326fec2
Rollup merge of #84911 - Mark-Simulacrum:retry-clang, r=pietroalbini
JohnTitor May 7, 2021
4705027
Rollup merge of #84972 - RalfJung:null-ptr-msg, r=oli-obk
JohnTitor May 7, 2021
87faf2e
Rollup merge of #84990 - GuillaumeGomez:sort-rustdoc-gui-tests, r=Mar…
JohnTitor May 7, 2021
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
3 changes: 3 additions & 0 deletions compiler/rustc_middle/src/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ impl fmt::Display for UndefinedBehaviorInfo<'_> {
ptr.alloc_id,
allocation_size.bytes()
),
DanglingIntPointer(_, CheckInAllocMsg::InboundsTest) => {
write!(f, "null pointer is not allowed for this operation")
}
DanglingIntPointer(i, msg) => {
write!(f, "{} failed: 0x{:x} is not a valid pointer", msg, i)
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/interpret/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
min_ptr,
Size::from_bytes(size),
None,
CheckInAllocMsg::InboundsTest,
CheckInAllocMsg::PointerArithmeticTest,
)?;
Ok(offset_ptr)
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_mir/src/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ pub trait Machine<'mir, 'tcx>: Sized {
) -> InterpResult<'tcx, Pointer<Self::PointerTag>> {
Err((if int == 0 {
// This is UB, seriously.
// (`DanglingIntPointer` with these exact arguments has special printing code.)
err_ub!(DanglingIntPointer(0, CheckInAllocMsg::InboundsTest))
} else {
// This is just something we cannot support during const-eval.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir/src/interpret/validity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
vtable,
3 * self.ecx.tcx.data_layout.pointer_size, // drop, size, align
Some(self.ecx.tcx.data_layout.pointer_align.abi),
CheckInAllocMsg::InboundsTest,
CheckInAllocMsg::InboundsTest, // will anyway be replaced by validity message
),
self.path,
err_ub!(DanglingIntPointer(..)) |
Expand Down Expand Up @@ -416,7 +416,7 @@ impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, '
place.ptr,
size,
Some(align),
CheckInAllocMsg::InboundsTest,
CheckInAllocMsg::InboundsTest, // will anyway be replaced by validity message
),
self.path,
err_ub!(AlignmentCheckFailed { required, has }) =>
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/ub-wide-ptr.32bit.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/ub-wide-ptr.rs:135:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inbounds test failed: 0x0 is not a valid pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ null pointer is not allowed for this operation

error[E0080]: could not evaluate static initializer
--> $DIR/ub-wide-ptr.rs:139:5
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/ub-wide-ptr.64bit.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/ub-wide-ptr.rs:135:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ inbounds test failed: 0x0 is not a valid pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ null pointer is not allowed for this operation

error[E0080]: could not evaluate static initializer
--> $DIR/ub-wide-ptr.rs:139:5
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/offset_from_ub.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ error: any use of this value will cause an error
LL | unsafe { intrinsics::ptr_offset_from(self, origin) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inbounds test failed: 0x0 is not a valid pointer
| null pointer is not allowed for this operation
| inside `ptr::const_ptr::<impl *const u8>::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `OFFSET_FROM_NULL` at $DIR/offset_from_ub.rs:36:14
|
Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/consts/offset_ub.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ error: any use of this value will cause an error
LL | unsafe { intrinsics::offset(self, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inbounds test failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
| pointer arithmetic failed: pointer must be in-bounds at offset 2, but is outside bounds of allocN which has size 1
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `AFTER_END` at $DIR/offset_ub.rs:7:43
|
Expand All @@ -41,7 +41,7 @@ error: any use of this value will cause an error
LL | unsafe { intrinsics::offset(self, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inbounds test failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
| pointer arithmetic failed: pointer must be in-bounds at offset 101, but is outside bounds of allocN which has size 100
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `AFTER_ARRAY` at $DIR/offset_ub.rs:8:45
|
Expand Down Expand Up @@ -131,7 +131,7 @@ error: any use of this value will cause an error
LL | unsafe { intrinsics::offset(self, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inbounds test failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
| pointer arithmetic failed: pointer must be in-bounds at offset 1, but is outside bounds of allocN which has size 0
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `ZERO_SIZED_ALLOC` at $DIR/offset_ub.rs:15:50
|
Expand Down Expand Up @@ -167,7 +167,7 @@ error: any use of this value will cause an error
LL | unsafe { intrinsics::offset(self, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inbounds test failed: 0x0 is not a valid pointer
| pointer arithmetic failed: 0x0 is not a valid pointer
| inside `ptr::const_ptr::<impl *const u8>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `NULL_OFFSET_ZERO` at $DIR/offset_ub.rs:19:50
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/consts/ptr_comparisons.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: any use of this value will cause an error
LL | unsafe { intrinsics::offset(self, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| inbounds test failed: pointer must be in-bounds at offset $TWO_WORDS, but is outside bounds of alloc2 which has size $WORD
| pointer arithmetic failed: pointer must be in-bounds at offset $TWO_WORDS, but is outside bounds of alloc2 which has size $WORD
| inside `ptr::const_ptr::<impl *const usize>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
| inside `_` at $DIR/ptr_comparisons.rs:61:34
|
Expand Down