rust-analyzer: Problem differentiating between built-in PartialEq trait and Diesel ExpressionMethods trait
extern crate diesel;
use diesel::prelude::*;
use crate::{database, schema::recurring_log::dsl::*};
use database::models::*;
pub fn get_post() {
let connection = database::connect_to_db();
let results = recurring_log.filter(finished.eq(true))
.limit(5)
.load::<RecurringLog>(&connection)
.expect("Error loading posts");
}
rust-analyzer says that eq() is not found but rustc does not show the same error.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 21 (21 by maintainers)
Can reproduce at
92a6dcc36and 0ac4a8f35497718a5d17f74e0dd3ef36227222cc.I spotted a couple of problems:
table!correctlyeqSomewhat minimized test case
@edwin0cheng I’ve haven’t tried to reproduce that by my self yet, we only got that report in our gitter channel, so I’ve forwarded it to the in my opinion right place to report it.
That’s a great idea. In fact using
extern crate self as diesel;works and removes the issue. I’ve filled https://github.com/diesel-rs/diesel/pull/3564 in diesel to resolve that. Thanks for the pointer 🙏Note that this has nothing to do with PartialEq, it happens with all/most of diesel’s ExpressionMethods.
The minimized example can’t find the
Eqtype at all. That’s probably because it’s defined inside a macro.