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 8 pull requests #125691

Merged
merged 25 commits into from
May 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ac59bdc
Add `--print=check-cfg` to get the expected configs
Urgau Apr 22, 2024
8693064
miri: avoid making a full copy of all new allocations
RalfJung May 27, 2024
d9d013b
rewrite lto-smoke to rmake
Oneirical May 28, 2024
634270e
rewrite mixing-deps in rmake
Oneirical May 28, 2024
b119e42
Add run-make-support to x doc
ChrisDenton May 28, 2024
ef9e6ca
Fix run-make-support doc errors
ChrisDenton May 28, 2024
d82be82
Enable a few tests on macOS
madsmtm May 27, 2024
37ae2b6
Disable stack overflow handler tests on iOS-like platforms
madsmtm May 16, 2024
e6b9bb7
Make more of the test suite run on Mac Catalyst
madsmtm May 27, 2024
37c54db
Silence some resolve errors when there have been glob import errors
estebank May 21, 2024
89f3651
Get rid of manual Trace calls
compiler-errors May 28, 2024
cc97376
Rewrite simple-rlib to rmake
Oneirical May 28, 2024
2bd5050
Remove Trace
compiler-errors May 28, 2024
459ce3f
Add an intrinsic for `ptr::metadata`
scottmcm Apr 21, 2024
7150839
Add custom mir support for `PtrMetadata`
scottmcm May 25, 2024
5a8c1f3
Add Miri tests for `PtrMetadata` UB
scottmcm May 26, 2024
57948c8
Add Miri smoke pass test for ptr_metadata intrinsic
scottmcm May 27, 2024
2d3b1e0
Rollup merge of #124251 - scottmcm:unop-ptr-metadata, r=oli-obk
jieyouxu May 29, 2024
7e441a1
Rollup merge of #124320 - Urgau:print-check-cfg, r=petrochenkov
jieyouxu May 29, 2024
3cc59ae
Rollup merge of #125226 - madsmtm:fix-mac-catalyst-tests, r=workingju…
jieyouxu May 29, 2024
bc1a069
Rollup merge of #125381 - estebank:issue-96799, r=petrochenkov
jieyouxu May 29, 2024
305137d
Rollup merge of #125633 - RalfJung:miri-no-copy, r=saethlin
jieyouxu May 29, 2024
7e93a63
Rollup merge of #125638 - Oneirical:lets-find-some-tests, r=jieyouxu
jieyouxu May 29, 2024
98f3217
Rollup merge of #125639 - ChrisDenton:run-make-support-doc, r=onur-ozkan
jieyouxu May 29, 2024
4c12282
Rollup merge of #125664 - compiler-errors:trace-tweaks, r=lcnr
jieyouxu May 29, 2024
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
Add Miri smoke pass test for ptr_metadata intrinsic
  • Loading branch information
scottmcm committed May 28, 2024
commit 57948c84ecf654bdbf29adcee095e7e10b1c0640
8 changes: 7 additions & 1 deletion src/tools/miri/tests/pass/intrinsics/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@compile-flags: -Zmiri-permissive-provenance
#![feature(core_intrinsics, layout_for_ptr)]
#![feature(core_intrinsics, layout_for_ptr, ptr_metadata)]
//! Tests for various intrinsics that do not fit anywhere else.

use std::intrinsics;
Expand Down Expand Up @@ -57,4 +57,10 @@ fn main() {
// Make sure that even if the discriminant is stored together with data, the intrinsic returns
// only the discriminant, nothing about the data.
assert_eq!(discriminant(&Some(false)), discriminant(&Some(true)));

let () = intrinsics::ptr_metadata(&[1, 2, 3]);
let len = intrinsics::ptr_metadata(&[1, 2, 3][..]);
assert_eq!(len, 3);
let dyn_meta = intrinsics::ptr_metadata(&[1, 2, 3] as &dyn std::fmt::Debug);
assert_eq!(dyn_meta.size_of(), 12);
}
Loading