From 9e92c90149b5d73d3628e943ec08c6f703e9fba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Mon, 31 Oct 2022 12:55:25 +0200 Subject: [PATCH] Drop trybuild --- Cargo.toml | 1 - src/vector/vector_tests/mod.rs | 19 ------------------- .../01-features-aliasing-errors.rs | 12 ------------ .../01-features-aliasing-errors.stderr | 10 ---------- tests/compile-tests/utils.rs | 14 -------------- 5 files changed, 56 deletions(-) delete mode 100644 tests/compile-tests/01-features-aliasing-errors.rs delete mode 100644 tests/compile-tests/01-features-aliasing-errors.stderr delete mode 100644 tests/compile-tests/utils.rs diff --git a/Cargo.toml b/Cargo.toml index 2b31def1..2adbaeb9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,6 @@ semver = "1.0" [dev-dependencies] tempfile = "3.3" -trybuild = "1.0" [workspace] members = ["gdal-sys"] diff --git a/src/vector/vector_tests/mod.rs b/src/vector/vector_tests/mod.rs index 78646008..bfbb8158 100644 --- a/src/vector/vector_tests/mod.rs +++ b/src/vector/vector_tests/mod.rs @@ -801,25 +801,6 @@ mod tests { }); } - #[test] - fn test_features_aliasing_compile_fail() { - let t = trybuild::TestCases::new(); // A compilation test that should fail. - t.compile_fail("tests/compile-tests/01-features-aliasing-errors.rs"); - } - - // It tries to iterate over a layer's features, while - // also trying to read the layer's definition. The - // features iterator borrows layer as a mutable ref as - // it increments the internal state of the layer. - // - // fn test_features_mut_lifetime_enforce() { - // with_layer("roads.geojson", |mut layer| { - // for _ in layer.features() { - // let _ = layer.defn(); - // } - // }); - // } - #[test] fn test_set_attribute_filter() { with_layer("roads.geojson", |mut layer| { diff --git a/tests/compile-tests/01-features-aliasing-errors.rs b/tests/compile-tests/01-features-aliasing-errors.rs deleted file mode 100644 index fc4394d0..00000000 --- a/tests/compile-tests/01-features-aliasing-errors.rs +++ /dev/null @@ -1,12 +0,0 @@ -mod utils; - -use gdal::vector::LayerAccess; -use gdal::Dataset; - -fn main() { - let ds = Dataset::open(fixture!("roads.geojson")).unwrap(); - let mut layer = ds.layer(0).unwrap(); - for _ in layer.features() { - let _ = layer.defn(); - } -} diff --git a/tests/compile-tests/01-features-aliasing-errors.stderr b/tests/compile-tests/01-features-aliasing-errors.stderr deleted file mode 100644 index 3e16db9e..00000000 --- a/tests/compile-tests/01-features-aliasing-errors.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error[E0502]: cannot borrow `layer` as immutable because it is also borrowed as mutable - --> $DIR/01-features-aliasing-errors.rs:10:17 - | -9 | for _ in layer.features() { - | ---------------- - | | - | mutable borrow occurs here - | mutable borrow later used here -10 | let _ = layer.defn(); - | ^^^^^^^^^^^^ immutable borrow occurs here diff --git a/tests/compile-tests/utils.rs b/tests/compile-tests/utils.rs deleted file mode 100644 index 29e6368a..00000000 --- a/tests/compile-tests/utils.rs +++ /dev/null @@ -1,14 +0,0 @@ -#[macro_export] -macro_rules! fixture { - ($name:expr) => { - std::path::Path::new(file!()) - .parent() - .unwrap() - .parent() - .unwrap() - .join("fixtures") - .as_path() - .join($name) - .as_path() - }; -}