Skip to content

Commit 3cdfa94

Browse files
committed
postgresqlPackages.pgvecto-rs: fix build with rust 1.89
The `dangerous_implicit_autorefs` lint now causes a compile error [1], which breaks pgvecto-rs. This commit forces the lint to only throw a warning. [1]: rust-lang/rust#141661
1 parent 9ee9672 commit 3cdfa94

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs
2+
index 18172b9..6fc7e82 100644
3+
--- a/crates/common/src/lib.rs
4+
+++ b/crates/common/src/lib.rs
5+
@@ -1,3 +1,4 @@
6+
+#![warn(dangerous_implicit_autorefs)]
7+
pub mod clean;
8+
pub mod dir_ops;
9+
pub mod file_atomic;
10+
diff --git a/src/lib.rs b/src/lib.rs
11+
index 068c65d..82609e9 100644
12+
--- a/src/lib.rs
13+
+++ b/src/lib.rs
14+
@@ -6,6 +6,7 @@
15+
#![allow(clippy::needless_range_loop)]
16+
#![allow(clippy::single_match)]
17+
#![allow(clippy::too_many_arguments)]
18+
+#![warn(dangerous_implicit_autorefs)]
19+
20+
mod bgworker;
21+
mod datatype;

pkgs/servers/sql/postgresql/ext/pgvecto-rs/package.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ buildPgrxExtension (finalAttrs: {
2727
(replaceVars ./0001-read-clang-flags-from-environment.diff {
2828
clang = lib.getExe clang;
2929
})
30+
# Rust 1.89 denies implicit autorefs by default, making the compilation fail.
31+
# This restores the behaviour of previous rust versions by making the lint throw a warning instead.
32+
./0002-allow-dangerous-implicit-autorefs.diff
3033
];
3134

3235
src = fetchFromGitHub {

0 commit comments

Comments
 (0)