Skip to content

Commit 0fbe271

Browse files
authored
Delete obsolete stubs for Vec and related options (rust-lang#2770)
1 parent 23b7abd commit 0fbe271

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+5
-2742
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This file contains notable changes (e.g. breaking changes, major changes, etc.)
44

55
This file was introduced starting Kani 0.23.0, so it only contains changes from version 0.23.0 onwards.
66

7+
## [0.37.0]
8+
9+
### Major Changes
10+
* Delete obsolete stubs for `Vec` and related options ([pull request](https://github.com/model-checking/kani/pull/2770) by @zhassan-aws)
11+
712
## [0.36.0]
813

914
## What's Changed

kani-driver/src/args/mod.rs

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -226,18 +226,6 @@ pub struct VerificationArgs {
226226
#[arg(short, long, hide = true, requires("enable_unstable"))]
227227
pub jobs: Option<Option<usize>>,
228228

229-
// Hide option till https://github.com/model-checking/kani/issues/697 is
230-
// fixed.
231-
/// Use abstractions for the standard library.
232-
/// This is an experimental feature and requires `--enable-unstable` to be used
233-
#[arg(long, hide = true, requires("enable_unstable"))]
234-
pub use_abs: bool,
235-
// Hide option till https://github.com/model-checking/kani/issues/697 is
236-
// fixed.
237-
/// Choose abstraction for modules of standard library if available
238-
#[arg(long, default_value = "std", ignore_case = true, hide = true, value_enum)]
239-
pub abs_type: AbstractionType,
240-
241229
/// Enable extra pointer checks such as invalid pointers in relation operations and pointer
242230
/// arithmetic overflow.
243231
/// This feature is unstable and it may yield false counter examples. It requires
@@ -374,32 +362,6 @@ pub enum OutputFormat {
374362
Old,
375363
}
376364

377-
#[derive(Clone, Debug, PartialEq, Eq, ValueEnum)]
378-
pub enum AbstractionType {
379-
Std,
380-
Kani,
381-
// Clap defaults to `c-ffi`
382-
CFfi,
383-
// Clap defaults to `no-back`
384-
NoBack,
385-
}
386-
impl std::fmt::Display for AbstractionType {
387-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
388-
match self {
389-
Self::Std => f.write_str("std"),
390-
Self::Kani => f.write_str("kani"),
391-
Self::CFfi => f.write_str("c-ffi"),
392-
Self::NoBack => f.write_str("no-back"),
393-
}
394-
}
395-
}
396-
#[cfg(test)]
397-
impl AbstractionType {
398-
pub fn variants() -> Vec<&'static str> {
399-
vec!["std", "kani", "c-ffi", "no-back"]
400-
}
401-
}
402-
403365
#[derive(Debug, clap::Args)]
404366
pub struct CheckArgs {
405367
// Rust argument parsers (/clap) don't have the convenient '--flag' and '--no-flag' boolean pairs, so approximate
@@ -818,18 +780,6 @@ mod tests {
818780
};
819781
}
820782

821-
#[test]
822-
fn check_abs_type() {
823-
// Since we manually implemented this, consistency check it
824-
for t in AbstractionType::variants() {
825-
assert_eq!(t, format!("{}", AbstractionType::from_str(t, false).unwrap()));
826-
}
827-
check_opt!("--abs-type std", false, abs_type, AbstractionType::Std);
828-
check_opt!("--abs-type kani", false, abs_type, AbstractionType::Kani);
829-
check_opt!("--abs-type c-ffi", false, abs_type, AbstractionType::CFfi);
830-
check_opt!("--abs-type no-back", false, abs_type, AbstractionType::NoBack);
831-
}
832-
833783
#[test]
834784
fn check_dry_run_fails() {
835785
// We don't support --dry-run anymore but we print a friendly reminder for now.
@@ -865,11 +815,6 @@ mod tests {
865815
StandaloneArgs::try_parse_from(args.split(' '))
866816
}
867817

868-
#[test]
869-
fn check_abs_unstable() {
870-
check_unstable_flag!("--use-abs", use_abs);
871-
}
872-
873818
#[test]
874819
fn check_restrict_vtable_unstable() {
875820
check_unstable_flag!("--restrict-vtable", restrict_vtable);

kani-driver/src/call_goto_cc.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::ffi::OsString;
66
use std::path::{Path, PathBuf};
77
use std::process::Command;
88

9-
use crate::args::AbstractionType;
109
use crate::session::KaniSession;
1110

1211
impl KaniSession {
@@ -17,15 +16,6 @@ impl KaniSession {
1716
args.extend(inputs.iter().map(|x| x.clone().into_os_string()));
1817
args.extend(self.args.c_lib.iter().map(|x| x.clone().into_os_string()));
1918

20-
// Special case hack for handling the "c-ffi" abs-type
21-
if self.args.use_abs && self.args.abs_type == AbstractionType::CFfi {
22-
let vec = self.kani_c_stubs.join("vec/vec.c");
23-
let hashset = self.kani_c_stubs.join("hashset/hashset.c");
24-
25-
args.push(vec.into_os_string());
26-
args.push(hashset.into_os_string());
27-
}
28-
2919
// TODO think about this: kani_lib_c is just an empty c file. Maybe we could just
3020
// create such an empty file ourselves instead of having to look up this path.
3121
args.push(self.kani_lib_c.clone().into_os_string());

kani-driver/src/call_single_file.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,6 @@ impl KaniSession {
125125
]
126126
.map(OsString::from),
127127
);
128-
if self.args.use_abs {
129-
flags.push("-Z".into());
130-
flags.push("force-unstable-if-unmarked=yes".into()); // ??
131-
flags.push("--cfg=use_abs".into());
132-
flags.push("--cfg".into());
133-
let abs_type = format!("abs_type={}", self.args.abs_type.to_string().to_lowercase());
134-
flags.push(abs_type.into());
135-
}
136128

137129
if let Some(seed_opt) = self.args.randomize_layout {
138130
flags.push("-Z".into());

kani-driver/src/session.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ pub struct KaniSession {
3535
pub kani_compiler: PathBuf,
3636
/// The location we found 'kani_lib.c'
3737
pub kani_lib_c: PathBuf,
38-
/// The location we found the Kani C stub .c files
39-
pub kani_c_stubs: PathBuf,
4038

4139
/// The temporary files we littered that need to be cleaned up at the end of execution
4240
pub temporaries: Mutex<Vec<PathBuf>>,
@@ -62,7 +60,6 @@ impl KaniSession {
6260
codegen_tests: false,
6361
kani_compiler: install.kani_compiler()?,
6462
kani_lib_c: install.kani_lib_c()?,
65-
kani_c_stubs: install.kani_c_stubs()?,
6663
temporaries: Mutex::new(vec![]),
6764
})
6865
}
@@ -339,10 +336,6 @@ impl InstallType {
339336
self.base_path_with("library/kani/kani_lib.c")
340337
}
341338

342-
pub fn kani_c_stubs(&self) -> Result<PathBuf> {
343-
self.base_path_with("library/kani/stubs/C")
344-
}
345-
346339
/// A common case is that our repo and release bundle have the same `subpath`
347340
fn base_path_with(&self, subpath: &str) -> Result<PathBuf> {
348341
let path = match self {

library/kani/stubs/C/hashset/hashset.c

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)