From c4426472cc9c1f82af01ac2be1b7690629fbfa70 Mon Sep 17 00:00:00 2001 From: Herman Venter Date: Wed, 15 Mar 2023 09:17:40 -0700 Subject: [PATCH] 2023-03-14 (#1201) --- Cargo.lock | 68 ++++++++++----------- binaries/summary_store.tar | Bin 1909760 -> 1909760 bytes checker/Cargo.toml | 2 +- checker/src/block_visitor.rs | 2 +- checker/src/lib.rs | 1 - checker/src/main.rs | 1 - checker/src/options.rs | 2 +- checker/tests/call_graph/fnptr_fold.rs | 4 +- checker/tests/call_graph/static_fold.rs | 4 +- checker/tests/integration_tests.rs | 1 - checker/tests/run-pass/binary_overflow.rs | 4 +- checker/tests/run-pass/box_fail.rs | 4 +- checker/tests/run-pass/box_struct.rs | 4 +- checker/tests/run-pass/path_refinement.rs | 4 +- checker/tests/run-pass/size_of_val.rs | 1 - checker/tests/run-pass/weak_update_heap.rs | 5 +- rust-toolchain.toml | 5 +- validate.sh | 2 +- 18 files changed, 51 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 457c676f..fb23152d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "archery" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a8da9bc4c4053ee067669762bcaeea6e241841295a2b6c948312dad6ef4cc02" +checksum = "b6cd774058b1b415c4855d8b86436c04bf050c003156fe24bc326fb3fe75c343" dependencies = [ "static_assertions", ] @@ -79,9 +79,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "camino" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6031a462f977dd38968b6f23378356512feeace69cef817e1a4475108093cec3" +checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" dependencies = [ "serde", ] @@ -493,9 +493,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libloading" @@ -682,18 +682,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -778,9 +778,9 @@ checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "rpds" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66262ea963eff99163e6b741fbc3417a52cc13074728c1047e9911789df9b000" +checksum = "9bd6ce569b15c331b1e5fd8cf6adb0bf240678b5f0cdc4d0f41e11683f6feba9" dependencies = [ "archery", "serde", @@ -835,27 +835,27 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.153" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a382c72b4ba118526e187430bb4963cd6d55051ebf13d9b25574d379cc98d20" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.153" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ef476a5790f0f6decbc66726b6e5d63680ed518283e64c7df415989d880954f" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", @@ -1130,9 +1130,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1145,45 +1145,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "xattr" diff --git a/binaries/summary_store.tar b/binaries/summary_store.tar index 266cd5de7b28e8230aebad705531d5fcec8110d4..215ceae616252075204758803925050d8e7439cd 100644 GIT binary patch delta 309 zcmZoTQPOatWI~UiiIJ(HnTdgdfuWh1u?d5M>EuM_l+BEc-Hb?5=H|wxa4BY(l&LXL zm${+25rcvONLMo>Yda$=BM>tIF*6Xe05M364T#yNGqQ60=kL&47W)7H_y0gp|B&Hl zJ3ku-5OV@C7Z7s;F%J;)0x{oqem4G(|M_m7T$uI$|9h~GW2NnUYyvy2xwR?cEDReh6*PJt=aBv0d}A m7!ZpCu>=rH0}yj4bEwz0Gs?>TX9ED7!(;aV delta 309 zcmZoTQPOatWI~Uik)f%%k-3?IfuWh1i3x*(>EuM_l+BEc-Hb?5=H@1*a4BY}l(C^9 zP?x!(8Bmu2NLMo>Yda$=BM>tIF*6Xe05M364T#yNGqQ60=Wo~|e)a$V@Be|I{=>Z= z?fh&UK+FlmTtLhX#5_RE3&ece`PukC{^!edpUnUN|9h|wC#!ZoHUS_O1Y#i|7T(Us zCc-vxd)5iD*R0z`ri=72Zx1~u_Csj|Q3M7R4s6uZON-nBslh()(|Z4i4P-mdvr l42VIr1Q1ICu@n$XZ`XV*lWd9XYg0pWsMoeL%F6y{0|0zKV^IJA diff --git a/checker/Cargo.toml b/checker/Cargo.toml index 37faf44c..bb9d7e7f 100644 --- a/checker/Cargo.toml +++ b/checker/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "mirai" -version = "1.1.5" +version = "1.1.6" authors = ["Herman Venter "] description = "A static analysis tool for Rust, based on Abstract Interpretation of MIR" repository = "https://github.com/facebookexperimental/MIRAI" diff --git a/checker/src/block_visitor.rs b/checker/src/block_visitor.rs index 612613f6..41c0cbbf 100644 --- a/checker/src/block_visitor.rs +++ b/checker/src/block_visitor.rs @@ -133,6 +133,7 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com self.visit_non_diverging_intrinsic(non_diverging_intrinsic); } mir::StatementKind::Nop => (), + mir::StatementKind::PlaceMention(_) => (), } } @@ -293,7 +294,6 @@ impl<'block, 'analysis, 'compilation, 'tcx> BlockVisitor<'block, 'analysis, 'com target, unwind, } => self.visit_drop(place, *target, *unwind), - mir::TerminatorKind::DropAndReplace { .. } => assume_unreachable!(), mir::TerminatorKind::Call { func, args, diff --git a/checker/src/lib.rs b/checker/src/lib.rs index 46aee821..ab07ac25 100644 --- a/checker/src/lib.rs +++ b/checker/src/lib.rs @@ -15,7 +15,6 @@ #![feature(rustc_private)] #![feature(array_chunks)] #![feature(box_patterns)] -#![feature(box_syntax)] #![feature(core_intrinsics)] #![allow(clippy::mutable_key_type)] diff --git a/checker/src/main.rs b/checker/src/main.rs index 0dc60ccd..2a240a25 100644 --- a/checker/src/main.rs +++ b/checker/src/main.rs @@ -13,7 +13,6 @@ // private and not very stable set of APIs from whatever compiler is in the path when we run Mirai. // While pretty bad, it is a lot less bad than having to write our own compiler, so here goes. #![feature(rustc_private)] -#![feature(box_syntax)] extern crate env_logger; extern crate mirai; diff --git a/checker/src/options.rs b/checker/src/options.rs index 13242d7e..47862416 100644 --- a/checker/src/options.rs +++ b/checker/src/options.rs @@ -16,7 +16,7 @@ fn make_options_parser<'help>(running_test_harness: bool) -> Command<'help> { // to construct this more then once per regular program run. let mut parser = Command::new("MIRAI") .no_binary_name(true) - .version("v1.1.0") + .version("v1.1.6") .arg(Arg::new("single_func") .long("single_func") .takes_value(true) diff --git a/checker/tests/call_graph/fnptr_fold.rs b/checker/tests/call_graph/fnptr_fold.rs index 7d13f8e0..0e336be1 100644 --- a/checker/tests/call_graph/fnptr_fold.rs +++ b/checker/tests/call_graph/fnptr_fold.rs @@ -68,8 +68,8 @@ commit; /* EXPECTED:CALL_SITES{ "files": [ "tests/call_graph/fnptr_fold.rs", - "/rustc/e3dfeeaa45f117281b19773d67f3f253de65cee1/library/std/src/io/stdio.rs", - "/rustc/e3dfeeaa45f117281b19773d67f3f253de65cee1/library/core/src/fmt/mod.rs" + "/rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/io/stdio.rs", + "/rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/fmt/mod.rs" ], "callables": [ { diff --git a/checker/tests/call_graph/static_fold.rs b/checker/tests/call_graph/static_fold.rs index d2811754..747875e7 100644 --- a/checker/tests/call_graph/static_fold.rs +++ b/checker/tests/call_graph/static_fold.rs @@ -64,8 +64,8 @@ commit; /* EXPECTED:CALL_SITES{ "files": [ "tests/call_graph/static_fold.rs", - "/rustc/e3dfeeaa45f117281b19773d67f3f253de65cee1/library/std/src/io/stdio.rs", - "/rustc/e3dfeeaa45f117281b19773d67f3f253de65cee1/library/core/src/fmt/mod.rs" + "/rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/std/src/io/stdio.rs", + "/rustc/22f247c6f3ed388cb702d01c2ff27da658a8b353/library/core/src/fmt/mod.rs" ], "callables": [ { diff --git a/checker/tests/integration_tests.rs b/checker/tests/integration_tests.rs index dc86b264..a0571375 100644 --- a/checker/tests/integration_tests.rs +++ b/checker/tests/integration_tests.rs @@ -13,7 +13,6 @@ // private and not very stable set of APIs from whatever compiler is in the path when we run Mirai. // While pretty bad, it is a lot less bad than having to write our own compiler, so here goes. #![feature(rustc_private)] -#![feature(box_syntax)] extern crate mirai; extern crate rayon; diff --git a/checker/tests/run-pass/binary_overflow.rs b/checker/tests/run-pass/binary_overflow.rs index fead8e54..3b36f727 100644 --- a/checker/tests/run-pass/binary_overflow.rs +++ b/checker/tests/run-pass/binary_overflow.rs @@ -33,13 +33,13 @@ pub fn tu128_overflowing_mul() { pub fn ti8_div_m1() -> i8 { let a: i8 = -128; let b: i8 = -1; - a / b //~ attempt to divide with overflow + a / b // ~ attempt to divide with overflow } pub fn ti8_rem_m1() -> i8 { let a: i8 = -128; let b: i8 = -1; - a % b //~ attempt to calculate the remainder with overflow + a % b // ~ attempt to calculate the remainder with overflow } pub fn main() {} diff --git a/checker/tests/run-pass/box_fail.rs b/checker/tests/run-pass/box_fail.rs index 93320e08..eedbb728 100644 --- a/checker/tests/run-pass/box_fail.rs +++ b/checker/tests/run-pass/box_fail.rs @@ -6,10 +6,8 @@ // A test that creates a box with a failure path that calls box_free -#![feature(box_syntax)] - pub fn test13(i: i64) { - let _x = box -i; //~ possible attempt to negate with overflow + let _x = Box::new(-i); //~ possible attempt to negate with overflow } pub fn main() {} diff --git a/checker/tests/run-pass/box_struct.rs b/checker/tests/run-pass/box_struct.rs index 5ce4ea94..e6fba0a9 100644 --- a/checker/tests/run-pass/box_struct.rs +++ b/checker/tests/run-pass/box_struct.rs @@ -6,8 +6,6 @@ // A test that uses paths containing base addresses. -#![feature(box_syntax)] - use mirai_annotations::*; pub struct Foo { @@ -21,7 +19,7 @@ pub fn f() -> Box { }; verify!(foo.x == 1); verify!(foo.y == 1111111111111111111); - box foo + Box::new(foo) } pub fn main() {} diff --git a/checker/tests/run-pass/path_refinement.rs b/checker/tests/run-pass/path_refinement.rs index 5991581a..04b52529 100644 --- a/checker/tests/run-pass/path_refinement.rs +++ b/checker/tests/run-pass/path_refinement.rs @@ -6,8 +6,6 @@ // A test that use enum discriminants -#![feature(box_syntax)] - use mirai_annotations::*; pub enum Path { @@ -29,7 +27,7 @@ impl Path { checked_assume!(qualifier.path_length() <= 10); Path::QualifiedPath { length: qualifier.path_length() + 1, - qualifier: box Path::Root, + qualifier: Box::new(Path::Root), } } _ => new_root, diff --git a/checker/tests/run-pass/size_of_val.rs b/checker/tests/run-pass/size_of_val.rs index 1ebc5e10..520b62ac 100644 --- a/checker/tests/run-pass/size_of_val.rs +++ b/checker/tests/run-pass/size_of_val.rs @@ -10,7 +10,6 @@ use mirai_annotations::*; pub fn test1() { verify!(mem::size_of_val(&5i32) == 4); - verify!(mem::size_of_val(Box::new(5i32).as_ref()) == 4); let x: [u8; 13] = [0; 13]; let y: &[u8] = &x; diff --git a/checker/tests/run-pass/weak_update_heap.rs b/checker/tests/run-pass/weak_update_heap.rs index fee10915..dc9a638d 100644 --- a/checker/tests/run-pass/weak_update_heap.rs +++ b/checker/tests/run-pass/weak_update_heap.rs @@ -5,7 +5,6 @@ // // A test that assigns to a location that is unknown at compile time. -#![feature(box_syntax)] // use mirai_annotations::*; @@ -18,8 +17,8 @@ struct Foo { } fn do_join(cond: bool) { - let mut a = box Foo { f: 1 }; - let mut b = box Foo { f: 2 }; + let mut a = Box::new(Foo { f: 1 }); + let mut b = Box::new(Foo { f: 2 }); { let c = if cond { &mut a } else { &mut b }; c.f = 3; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 44962ef4..21401693 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,3 @@ [toolchain] -channel = "nightly-2023-03-08" -components = [ "clippy", "rustfmt", "rustc-dev", "rust-std", "llvm-tools-preview" ] -profile = "minimal" +channel = "nightly-2023-03-14" +components = [ "clippy", "rustfmt", "rustc-dev", "rust-src", "rust-std", "llvm-tools-preview" ] diff --git a/validate.sh b/validate.sh index d2ea3d4b..fd5dfb32 100755 --- a/validate.sh +++ b/validate.sh @@ -37,6 +37,6 @@ time cargo test cargo uninstall mirai || true cargo install --path ./checker -# Run mirai on itself (using the optimized build in cargo as the bootstrap). +# Run mirai on itself, using the optimized build in cargo as the bootstrap. cargo clean cargo mirai