-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Release BlockerThis issue needs to be solved before we can release a new version, it can't be punted to the nextThis issue needs to be solved before we can release a new version, it can't be punted to the nextbug
Description
Setup
Versions
- Rust: rustc --version = rustc 1.70.0 (90c541806 2023-05-31)
- Diesel: master
- Database: _
- Operating System Archlinux
Feature Flags
- diesel: "postgres", "r2d2", "serde_json", "chrono",
Problem Description
FYI @Ten0 knows and says it's a blocker for the release of auto_type so he'll try to fix.
When deriving on a struct Selectable with one field having a select_expression containing dsl::max compilation breaks with error:
error[E0573]: expected type, found function `diesel::dsl::max`
--> mod.rs:463:6
|
463 | diesel::dsl::max<table::column>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a type
|
help: consider importing this type alias instead
|
8 + use diesel::helper_types::max;
|
help: if you import `max`, refer to it directly
|
463 - diesel::dsl::max<table::column>,
463 + max<table::column>,
|
What are you trying to accomplish?
Use Selectable derive
What is the expected output?
Code compiles
What is the actual output?
Compilation fails
Are you seeing any additional errors?
No
Steps to reproduce
mod schema {
diesel::table! {
table (id) {
id -> Int4,
other_id -> Int4,,
column -> Int4,
}
}
diesel::table! {
other_table (id) {
id -> Int4,
column -> Int4,
}
}
}
#[derive(Queryable, Serialize, Selectable)]
#[diesel(table_name = table)]
pub(crate) struct Struct {
#[diesel(
select_expression = schema::table::table
.filter(schema::table::other_id.eq(schema::other_table::id))
.select(dsl::max(table::column))
.single_value(),
)]
pub(crate) max_val: Option<i32>,
}Checklist
- I have already looked over the issue tracker and the discussion forum for similar possible closed issues.
- This issue can be reproduced on Rust's stable channel. (Your issue will be
closed if this is not the case) - This issue can be reproduced without requiring a third party crate
Metadata
Metadata
Assignees
Labels
Release BlockerThis issue needs to be solved before we can release a new version, it can't be punted to the nextThis issue needs to be solved before we can release a new version, it can't be punted to the nextbug