Skip to content

Commit 87e3b15

Browse files
authored
Remove experimental unsound features (rust-lang#2372)
Remove stale option that's no longer being used.
1 parent a85f77c commit 87e3b15

File tree

23 files changed

+1
-249
lines changed

23 files changed

+1
-249
lines changed

.github/workflows/kani.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,6 @@ jobs:
5252
KANI_ENABLE_WRITE_JSON_SYMTAB: 1
5353
run: ./scripts/kani-regression.sh
5454

55-
experimental-features-regression:
56-
runs-on: ubuntu-20.04
57-
env:
58-
KANI_ENABLE_UNSOUND_EXPERIMENTS: 1
59-
steps:
60-
- name: Checkout Kani
61-
uses: actions/checkout@v3
62-
63-
- name: Setup Kani Dependencies
64-
uses: ./.github/actions/setup
65-
with:
66-
os: ubuntu-20.04
67-
68-
- name: Build Kani
69-
run: cargo build-dev
70-
71-
- name: Execute Kani regression
72-
run: ./scripts/kani-regression.sh
73-
7455
perf:
7556
runs-on: ubuntu-20.04
7657
steps:

kani-compiler/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ tracing-tree = "0.2.2"
3737
default = ['cprover']
3838
cprover = ['ar', 'cbmc', 'libc', 'num', 'object', 'rustc-demangle', 'serde',
3939
'serde_json', "strum", "strum_macros"]
40-
unsound_experiments = ["kani_queries/unsound_experiments"]
4140
write_json_symtab = []
4241

4342
[package.metadata.rust-analyzer]

kani-compiler/kani_queries/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ edition = "2021"
88
license = "MIT OR Apache-2.0"
99
publish = false
1010

11-
[features]
12-
unsound_experiments = []
13-
1411
[dependencies]
1512
tracing = {version = "0.1"}
1613
strum = {version = "0.24.0"}

kani-compiler/kani_queries/src/lib.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
use std::sync::{Arc, Mutex};
55
use strum_macros::{AsRefStr, EnumString, EnumVariantNames};
66

7-
#[cfg(feature = "unsound_experiments")]
8-
mod unsound_experiments;
9-
10-
#[cfg(feature = "unsound_experiments")]
11-
use crate::unsound_experiments::UnsoundExperiments;
12-
137
#[derive(Debug, Default, Clone, Copy, AsRefStr, EnumString, EnumVariantNames, PartialEq, Eq)]
148
#[strum(serialize_all = "snake_case")]
159
pub enum ReachabilityType {
@@ -47,11 +41,6 @@ pub trait UserInput {
4741

4842
fn set_stubbing_enabled(&mut self, stubbing_enabled: bool);
4943
fn get_stubbing_enabled(&self) -> bool;
50-
51-
#[cfg(feature = "unsound_experiments")]
52-
fn get_unsound_experiments(&self) -> UnsoundExperiments;
53-
#[cfg(feature = "unsound_experiments")]
54-
fn set_unsound_experiments(&mut self, experiments: UnsoundExperiments);
5544
}
5645

5746
/// This structure should only be used behind a synchronized reference or a snapshot.
@@ -65,8 +54,6 @@ pub struct QueryDb {
6554
write_json_symtab: bool,
6655
reachability_analysis: ReachabilityType,
6756
stubbing_enabled: bool,
68-
#[cfg(feature = "unsound_experiments")]
69-
unsound_experiments: UnsoundExperiments,
7057
}
7158

7259
impl QueryDb {
@@ -79,8 +66,6 @@ impl QueryDb {
7966
write_json_symtab: false,
8067
reachability_analysis: ReachabilityType::None,
8168
stubbing_enabled: false,
82-
#[cfg(feature = "unsound_experiments")]
83-
unsound_experiments: unsound_experiments::UnsoundExperiments { zero_init_vars: false },
8469
}))
8570
}
8671
}
@@ -141,14 +126,4 @@ impl UserInput for QueryDb {
141126
fn get_write_json_symtab(&self) -> bool {
142127
self.write_json_symtab
143128
}
144-
145-
#[cfg(feature = "unsound_experiments")]
146-
fn get_unsound_experiments(&self) -> UnsoundExperiments {
147-
self.unsound_experiments
148-
}
149-
150-
#[cfg(feature = "unsound_experiments")]
151-
fn set_unsound_experiments(&mut self, experiments: UnsoundExperiments) {
152-
self.unsound_experiments = experiments
153-
}
154129
}

kani-compiler/kani_queries/src/unsound_experiments.rs

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

kani-compiler/src/codegen_cprover_gotoc/codegen/statement.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ impl<'tcx> GotocCtx<'tcx> {
263263
/// Our model of GotoC has a similar statement, which is later lowered
264264
/// to assigning a Nondet in CBMC, with a comment specifying that it
265265
/// corresponds to a Deinit.
266-
#[cfg(not(feature = "unsound_experiments"))]
267266
fn codegen_deinit(&mut self, place: &Place<'tcx>, loc: Location) -> Stmt {
268267
let dst_mir_ty = self.place_ty(place);
269268
let dst_type = self.codegen_ty(dst_mir_ty);

kani-compiler/src/codegen_cprover_gotoc/codegen/typ.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@ impl<'tcx> GotocCtx<'tcx> {
708708
/// By default, returns `None` which leaves the variable uninitilized.
709709
/// In CBMC, this translates to a NONDET value.
710710
/// In the future, we might want to replace this with `Poison`.
711-
#[cfg(not(feature = "unsound_experiments"))]
712711
pub fn codegen_default_initializer(&self, _e: &Expr) -> Option<Expr> {
713712
None
714713
}

kani-compiler/src/kani_compiler.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,6 @@ impl Callbacks for KaniCompiler {
146146
);
147147
queries.set_reachability_analysis(matches.reachability_type());
148148

149-
#[cfg(feature = "unsound_experiments")]
150-
crate::unsound_experiments::arg_parser::add_unsound_experiment_args_to_queries(
151-
queries, &matches,
152-
);
153-
154149
// If appropriate, collect and set the stub mapping.
155150
if matches.get_flag(parser::ENABLE_STUBBING)
156151
&& queries.get_reachability_analysis() == ReachabilityType::Harnesses

kani-compiler/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ mod kani_compiler;
3636
mod kani_middle;
3737
mod parser;
3838
mod session;
39-
mod unsound_experiments;
4039

4140
use rustc_driver::{RunCompiler, TimePassesCallbacks};
4241
use std::env;

kani-compiler/src/parser.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,6 @@ pub fn parser() -> Command {
147147
.action(ArgAction::Set)
148148
.help("Pass the kani version to the compiler to ensure cache coherence."),
149149
);
150-
#[cfg(feature = "unsound_experiments")]
151-
let app = crate::unsound_experiments::arg_parser::add_unsound_experiments_to_parser(app);
152-
153150
app
154151
}
155152

kani-compiler/src/unsound_experiments/arg_parser.rs

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

kani-compiler/src/unsound_experiments/mod.rs

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

kani-compiler/src/unsound_experiments/zero_init.rs

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

kani-driver/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ homepage = "https://github.com/model-checking/kani"
1111
repository = "https://github.com/model-checking/kani"
1212
publish = false
1313

14-
[features]
15-
unsound_experiments = []
16-
17-
1814
[dependencies]
1915
kani_metadata = { path = "../kani_metadata" }
2016
cargo_metadata = "0.15.0"

kani-driver/src/args.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright Kani Contributors
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
#[cfg(feature = "unsound_experiments")]
5-
use crate::unsound_experiments::UnsoundExperimentArgs;
64
use crate::util::warning;
75
use kani_metadata::CbmcSolver;
86

@@ -124,10 +122,6 @@ pub struct KaniArgs {
124122
#[command(flatten)]
125123
pub checks: CheckArgs,
126124

127-
#[cfg(feature = "unsound_experiments")]
128-
#[command(flatten)]
129-
pub unsound_experiments: UnsoundExperimentArgs,
130-
131125
/// Entry point for verification (symbol name).
132126
/// This is an unstable feature. Consider using --harness instead
133127
#[arg(long, hide = true, requires("enable_unstable"))]

kani-driver/src/call_single_file.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ impl KaniSession {
103103
// rustc driver is invoked.
104104
flags.push("--goto-c".into());
105105

106-
#[cfg(feature = "unsound_experiments")]
107-
flags.extend(self.args.unsound_experiments.process_args());
108-
109106
flags
110107
}
111108

kani-driver/src/harness_runner.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,6 @@ impl KaniSession {
204204

205205
self.stubbing_statuses(results);
206206

207-
#[cfg(feature = "unsound_experiments")]
208-
self.args.unsound_experiments.print_warnings();
209-
210207
if failing > 0 {
211208
// Failure exit code without additional error message
212209
drop(self);

kani-driver/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ mod project;
3434
mod session;
3535
mod util;
3636

37-
#[cfg(feature = "unsound_experiments")]
38-
mod unsound_experiments;
39-
4037
/// The main function for the `kani-driver`.
4138
/// The driver can be invoked via `cargo kani` and `kani` commands, which determines what kind of
4239
/// project should be verified.

kani-driver/src/unsound_experiments.rs

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

scripts/kani-regression.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# Copyright Kani Contributors
33
# SPDX-License-Identifier: Apache-2.0 OR MIT
44

5-
# To enable "unsound_experimental features, run as follows:
6-
# `KANI_ENABLE_UNSOUND_EXPERIMENTS=1 scripts/kani-regression.sh`
7-
85
if [[ -z $KANI_REGRESSION_KEEP_GOING ]]; then
96
set -o errexit
107
fi
@@ -30,9 +27,7 @@ check_kissat_version.sh
3027
${SCRIPT_DIR}/kani-fmt.sh --check
3128

3229
# Build all packages in the workspace
33-
if [[ "" != "${KANI_ENABLE_UNSOUND_EXPERIMENTS-}" ]]; then
34-
cargo build-dev -- --features unsound_experiments
35-
elif [[ "" != "${KANI_ENABLE_WRITE_JSON_SYMTAB-}" ]]; then
30+
if [[ "" != "${KANI_ENABLE_WRITE_JSON_SYMTAB-}" ]]; then
3631
cargo build-dev -- --features write_json_symtab
3732
else
3833
cargo build-dev
@@ -59,12 +54,6 @@ TESTS=(
5954
"kani-fixme kani-fixme"
6055
)
6156

62-
if [[ "" != "${KANI_ENABLE_UNSOUND_EXPERIMENTS-}" ]]; then
63-
TESTS+=("unsound_experiments kani")
64-
else
65-
TESTS+=("no_unsound_experiments expected")
66-
fi
67-
6857
# Build compiletest and print configuration. We pick suite / mode combo so there's no test.
6958
echo "--- Compiletest configuration"
7059
cargo run -p compiletest --quiet -- --suite kani --mode cargo-kani --dry-run --verbose

tests/no_unsound_experiments/ZeroInit/expected

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

tests/no_unsound_experiments/ZeroInit/uninit_eq.rs

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

0 commit comments

Comments
 (0)