diff --git a/crates/test-ui/src/hack.rs b/crates/test-ui/src/hack.rs
new file mode 100644
index 000000000..f328e4d9d
--- /dev/null
+++ b/crates/test-ui/src/hack.rs
@@ -0,0 +1 @@
+fn main() {}
diff --git a/crates/test-ui/src/main.rs b/crates/test-ui/src/main.rs
index dcce08f5b..48a310999 100644
--- a/crates/test-ui/src/main.rs
+++ b/crates/test-ui/src/main.rs
@@ -17,4 +17,12 @@ fn main() {
.join("ui")
.join("*.rs");
t.compile_fail(path);
+ // Make trybuild use `cargo build` instead of `cargo check`
+ //
+ // Workaround for https://github.com/dtolnay/trybuild/issues/241
+ t.pass(
+ std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
+ .join("src")
+ .join("hack.rs"),
+ );
}
diff --git a/crates/test-ui/ui/invalid_option_encode_impl.rs b/crates/test-ui/ui/invalid_option_encode_impl.rs
index 8e5bbaf68..060512998 100644
--- a/crates/test-ui/ui/invalid_option_encode_impl.rs
+++ b/crates/test-ui/ui/invalid_option_encode_impl.rs
@@ -1,5 +1,5 @@
//! Ensure that implementing `OptionEncode` wrongly results in an error
-use objc2::encode::{Encode, Encoding, OptionEncode, RefEncode};
+use objc2::encode::{Encode, Encoding, OptionEncode};
#[repr(transparent)]
struct MyType(usize);
@@ -8,19 +8,8 @@ unsafe impl Encode for MyType {
const ENCODING: Encoding = usize::ENCODING;
}
-unsafe impl RefEncode for MyType {
- const ENCODING_REF: Encoding = usize::ENCODING_REF;
-}
-
unsafe impl OptionEncode for MyType {}
fn main() {
assert_eq!(