首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法使用postgres功能编译生锈SQLx

无法使用postgres功能编译生锈SQLx
EN

Stack Overflow用户
提问于 2020-04-18 06:44:01
回答 1查看 772关注 0票数 1

如果我尝试使用SQLx Rust postgres特性,如下所示,

代码语言:javascript
复制
[dependencies]
sqlx = { version = "0.3.3", default-features=false , features=["runtime-async-std", "macros", "postgres", "all-type"] }

然后我得到一个编译错误,如下所示

代码语言:javascript
复制
   Compiling sqlx-core v0.3.4
error[E0658]: use of unstable library feature 'matches_macro'
  --> /Users/asnimpansari/.cargo/registry/src/github.com-1ecc6299db9ec823/sqlx-core-0.3.4/src/postgres/value.rs:78:12
   |
78 |         if matches!(self.data, Some(PgData::Binary(_))) {
   |            ^^^^^^^
   |
   = note: for more information, see https://github.com/rust-lang/rust/issues/65721

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
error: could not compile `sqlx-core`.

相反,如果我使用mysql而不是postgres,构建就会成功。

代码语言:javascript
复制
➜  ~ rustc  -V
rustc 1.41.1 (f3e1a954d 2020-02-24)
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-04-18 14:59:00

SQLx仅支持最新版本的Rust。截至2020年4月14日,版本为1.42.0,该版本于3月9日发布。

此特定错误是因为matches!宏为stabilized in 1.42

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61281893

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档