You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the #[salsa::invoke(...)] attribute inside a #[query_group], clippy complains about type repetition inside the function's bounds.
This is the code in question:
#[salsa::query_group(IrDatabaseStorage)]pubtraitIrDatabase: hir::HirDatabase{/// Get the LLVM context that should be used for all generation steps.#[salsa::input]fncontext(&self) -> Arc<Context>;/// Gets the optimization level for generation.#[salsa::input]fnoptimization_lvl(&self) -> OptimizationLevel;/// Returns the target for code generation.#[salsa::input]fntarget(&self) -> Target;/// Given a type, return the corresponding IR type.#[salsa::invoke(crate::ir::ty::ir_query)]fntype_ir(&self,ty: hir::Ty) -> AnyTypeEnum;/// Given a `hir::FileId` generate code for the module.#[salsa::invoke(crate::ir::module::ir_query)]fnmodule_ir(&self,file: hir::FileId) -> Arc<ModuleIR>;/// Given a type, return the runtime `TypeInfo` that can be used to reflect the type.#[salsa::invoke(crate::code_gen::symbols::type_info_query)]fntype_info(&self,ty: hir::Ty) -> TypeInfo;}
and these are the consequent warnings in clippy:
warning: this type has already been used as a bound predicate
--> crates\mun_codegen\src\db.rs:26:8
|
26 | fn type_ir(&self, ty: hir::Ty) -> AnyTypeEnum;
| ^^^^^^^
|
= note: `#[warn(clippy::type_repetition_in_bounds)]` on by default
= help: consider combining the bounds: `type_ir:IrDatabase + salsa::plumbing::HasQueryGroup<IrDatabaseStorage>`
= help:for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
warning: this type has already been usedas a bound predicate
--> crates\mun_codegen\src\db.rs:26:8
|
26 | fn type_ir(&self, ty: hir::Ty) -> AnyTypeEnum;
| ^^^^^^^
|
= help: consider combining the bounds: `type_ir: salsa::plumbing::HasQueryGroup<IrDatabaseStorage> + salsa::Database`
= help:for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
warning: this type has already been usedas a bound predicate
--> crates\mun_codegen\src\db.rs:30:8
|
30 | fn module_ir(&self, file: hir::FileId) -> Arc<ModuleIR>;
| ^^^^^^^^^
|
= help: consider combining the bounds: `module_ir:IrDatabase + salsa::plumbing::HasQueryGroup<IrDatabaseStorage>`
= help:for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
warning: this type has already been usedas a bound predicate
--> crates\mun_codegen\src\db.rs:30:8
|
30 | fn module_ir(&self, file: hir::FileId) -> Arc<ModuleIR>;
| ^^^^^^^^^
|
= help: consider combining the bounds: `module_ir: salsa::plumbing::HasQueryGroup<IrDatabaseStorage> + salsa::Database`
= help:for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
warning: this type has already been usedas a bound predicate
--> crates\mun_codegen\src\db.rs:34:8
|
34 | fn type_info(&self, ty: hir::Ty) -> TypeInfo;
| ^^^^^^^^^
|
= help: consider combining the bounds: `type_info:IrDatabase + salsa::plumbing::HasQueryGroup<IrDatabaseStorage>`
= help:for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
warning: this type has already been usedas a bound predicate
--> crates\mun_codegen\src\db.rs:34:8
|
34 | fn type_info(&self, ty: hir::Ty) -> TypeInfo;
| ^^^^^^^^^
|
= help: consider combining the bounds: `type_info: salsa::plumbing::HasQueryGroup<IrDatabaseStorage> + salsa::Database`
= help:for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds
Used version:
salsa="0.12"
The text was updated successfully, but these errors were encountered:
When using the
#[salsa::invoke(...)]
attribute inside a#[query_group]
, clippy complains about type repetition inside the function's bounds.This is the code in question:
and these are the consequent warnings in clippy:
Used version:
The text was updated successfully, but these errors were encountered: