diff --git a/Cargo.toml b/Cargo.toml index 5eb671b5..3b935296 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,6 @@ semver = "1.0" [dev-dependencies] tempfile = "3.2" -trybuild = "1.0.42" [workspace] members = ["gdal-sys"] diff --git a/src/vector/vector_tests/mod.rs b/src/vector/vector_tests/mod.rs index 669bbaa2..f0e63109 100644 --- a/src/vector/vector_tests/mod.rs +++ b/src/vector/vector_tests/mod.rs @@ -675,25 +675,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 eb531f12..00000000 --- a/tests/compile-tests/01-features-aliasing-errors.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod utils; - -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 016a7356..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:9:17 - | -8 | for _ in layer.features() { - | ---------------- - | | - | mutable borrow occurs here - | mutable borrow later used here -9 | 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() - }; -}