Make Clippy happy for 1.78 Rust
This commit is contained in:
parent
6ffbb66719
commit
2682ee1418
22 changed files with 191 additions and 125 deletions
|
@ -40,9 +40,9 @@ impl<'a, T> SchemaTranslator<'a, graphql_parser::schema::Document<'a, T>>
|
||||||
where
|
where
|
||||||
T: Text<'a> + Default,
|
T: Text<'a> + Default,
|
||||||
{
|
{
|
||||||
fn translate_schema<S: 'a>(input: &'a SchemaType<S>) -> graphql_parser::schema::Document<'a, T>
|
fn translate_schema<S>(input: &'a SchemaType<S>) -> graphql_parser::schema::Document<'a, T>
|
||||||
where
|
where
|
||||||
S: ScalarValue,
|
S: ScalarValue + 'a,
|
||||||
{
|
{
|
||||||
let mut doc = Document::default();
|
let mut doc = Document::default();
|
||||||
|
|
||||||
|
@ -94,9 +94,9 @@ impl GraphQLParserTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn translate_value<'a, S: 'a, T>(input: &'a InputValue<S>) -> ExternalValue<'a, T>
|
fn translate_value<'a, S, T>(input: &'a InputValue<S>) -> ExternalValue<'a, T>
|
||||||
where
|
where
|
||||||
S: ScalarValue,
|
S: ScalarValue + 'a,
|
||||||
T: Text<'a>,
|
T: Text<'a>,
|
||||||
{
|
{
|
||||||
match input {
|
match input {
|
||||||
|
@ -250,9 +250,9 @@ impl GraphQLParserTranslator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn translate_field<'a, S: 'a, T>(input: &'a Field<S>) -> ExternalField<'a, T>
|
fn translate_field<'a, S, T>(input: &'a Field<S>) -> ExternalField<'a, T>
|
||||||
where
|
where
|
||||||
S: ScalarValue,
|
S: ScalarValue + 'a,
|
||||||
T: Text<'a>,
|
T: Text<'a>,
|
||||||
{
|
{
|
||||||
let arguments = input
|
let arguments = input
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::{ScalarValue, SchemaType};
|
use crate::{ScalarValue, SchemaType};
|
||||||
|
|
||||||
|
#[cfg_attr(not(feature = "schema-language"), allow(dead_code))]
|
||||||
pub trait SchemaTranslator<'a, T> {
|
pub trait SchemaTranslator<'a, T> {
|
||||||
fn translate_schema<S: 'a + ScalarValue>(s: &'a SchemaType<S>) -> T;
|
fn translate_schema<S: 'a + ScalarValue>(s: &'a SchemaType<S>) -> T;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,9 +35,9 @@ use crate::{
|
||||||
};
|
};
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn visit_all_rules<'a, S: Debug>(ctx: &mut ValidatorContext<'a, S>, doc: &'a Document<S>)
|
pub fn visit_all_rules<'a, S>(ctx: &mut ValidatorContext<'a, S>, doc: &'a Document<S>)
|
||||||
where
|
where
|
||||||
S: ScalarValue,
|
S: Debug + ScalarValue,
|
||||||
{
|
{
|
||||||
// Some validators are depending on the results of other ones.
|
// Some validators are depending on the results of other ones.
|
||||||
// For example, validators checking fragments usually rely on the fact that
|
// For example, validators checking fragments usually rely on the fact that
|
||||||
|
|
|
@ -59,26 +59,26 @@ impl<K: Eq + Hash + Clone, V> OrderedMap<K, V> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get<Q: ?Sized>(&self, k: &Q) -> Option<&V>
|
fn get<Q>(&self, k: &Q) -> Option<&V>
|
||||||
where
|
where
|
||||||
K: Borrow<Q>,
|
K: Borrow<Q>,
|
||||||
Q: Hash + Eq,
|
Q: Hash + Eq + ?Sized,
|
||||||
{
|
{
|
||||||
self.data.get(k)
|
self.data.get(k)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_mut<Q: ?Sized>(&mut self, k: &Q) -> Option<&mut V>
|
fn get_mut<Q>(&mut self, k: &Q) -> Option<&mut V>
|
||||||
where
|
where
|
||||||
K: Borrow<Q>,
|
K: Borrow<Q>,
|
||||||
Q: Hash + Eq,
|
Q: Hash + Eq + ?Sized,
|
||||||
{
|
{
|
||||||
self.data.get_mut(k)
|
self.data.get_mut(k)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn contains_key<Q: ?Sized>(&self, k: &Q) -> bool
|
fn contains_key<Q>(&self, k: &Q) -> bool
|
||||||
where
|
where
|
||||||
K: Borrow<Q>,
|
K: Borrow<Q>,
|
||||||
Q: Hash + Eq,
|
Q: Hash + Eq + ?Sized,
|
||||||
{
|
{
|
||||||
self.data.contains_key(k)
|
self.data.contains_key(k)
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,12 +342,6 @@ mod polyfill {
|
||||||
/// Behaves like [`Result::unwrap()`]: if `self` is [`Ok`] yield the contained value,
|
/// Behaves like [`Result::unwrap()`]: if `self` is [`Ok`] yield the contained value,
|
||||||
/// otherwise abort macro execution.
|
/// otherwise abort macro execution.
|
||||||
fn unwrap_or_abort(self) -> Self::Ok;
|
fn unwrap_or_abort(self) -> Self::Ok;
|
||||||
|
|
||||||
/// Behaves like [`Result::expect()`]: if `self` is [`Ok`] yield the contained value,
|
|
||||||
/// otherwise abort macro execution.
|
|
||||||
///
|
|
||||||
/// If it aborts then resulting error message will be preceded with the provided `message`.
|
|
||||||
fn expect_or_abort(self, message: &str) -> Self::Ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T, E: Into<Diagnostic>> ResultExt for Result<T, E> {
|
impl<T, E: Into<Diagnostic>> ResultExt for Result<T, E> {
|
||||||
|
@ -356,13 +350,5 @@ mod polyfill {
|
||||||
fn unwrap_or_abort(self) -> T {
|
fn unwrap_or_abort(self) -> T {
|
||||||
self.unwrap_or_else(|e| e.into().abort())
|
self.unwrap_or_else(|e| e.into().abort())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn expect_or_abort(self, message: &str) -> T {
|
|
||||||
self.unwrap_or_else(|e| {
|
|
||||||
let mut d = e.into();
|
|
||||||
d.msg = format!("{message}: {}", d.msg);
|
|
||||||
d.abort()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,10 +252,6 @@ impl TypeExt for syn::Type {
|
||||||
|
|
||||||
/// Extension of [`syn::Generics`] providing common function widely used by this crate for parsing.
|
/// Extension of [`syn::Generics`] providing common function widely used by this crate for parsing.
|
||||||
pub(crate) trait GenericsExt {
|
pub(crate) trait GenericsExt {
|
||||||
/// Removes all default types out of type parameters and const parameters in these
|
|
||||||
/// [`syn::Generics`].
|
|
||||||
fn remove_defaults(&mut self);
|
|
||||||
|
|
||||||
/// Moves all trait and lifetime bounds of these [`syn::Generics`] to its [`syn::WhereClause`].
|
/// Moves all trait and lifetime bounds of these [`syn::Generics`] to its [`syn::WhereClause`].
|
||||||
fn move_bounds_to_where_clause(&mut self);
|
fn move_bounds_to_where_clause(&mut self);
|
||||||
|
|
||||||
|
@ -269,24 +265,6 @@ pub(crate) trait GenericsExt {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GenericsExt for syn::Generics {
|
impl GenericsExt for syn::Generics {
|
||||||
fn remove_defaults(&mut self) {
|
|
||||||
use syn::GenericParam as P;
|
|
||||||
|
|
||||||
for p in &mut self.params {
|
|
||||||
match p {
|
|
||||||
P::Type(p) => {
|
|
||||||
p.eq_token = None;
|
|
||||||
p.default = None;
|
|
||||||
}
|
|
||||||
P::Lifetime(_) => {}
|
|
||||||
P::Const(p) => {
|
|
||||||
p.eq_token = None;
|
|
||||||
p.default = None;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn move_bounds_to_where_clause(&mut self) {
|
fn move_bounds_to_where_clause(&mut self) {
|
||||||
use syn::GenericParam as P;
|
use syn::GenericParam as P;
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,7 @@ impl Definition {
|
||||||
|
|
||||||
let enum_gens = {
|
let enum_gens = {
|
||||||
let mut enum_gens = interface_gens.clone();
|
let mut enum_gens = interface_gens.clone();
|
||||||
enum_gens.params = interface_gens_lifetimes.clone();
|
enum_gens.params.clone_from(&interface_gens_lifetimes);
|
||||||
enum_gens.params.extend(variant_gens_pars.clone());
|
enum_gens.params.extend(variant_gens_pars.clone());
|
||||||
enum_gens.params.extend(interface_gens_tys.clone());
|
enum_gens.params.extend(interface_gens_tys.clone());
|
||||||
enum_gens
|
enum_gens
|
||||||
|
|
|
@ -12,7 +12,7 @@ error[E0277]: the trait bound `ObjectA: IsInputType<__S>` is not satisfied
|
||||||
<Box<T> as IsInputType<S>>
|
<Box<T> as IsInputType<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
||||||
<Arc<T> as IsInputType<S>>
|
<Arc<T> as IsInputType<S>>
|
||||||
<Vec<T> as IsInputType<S>>
|
<TypeKind as IsInputType<__S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
||||||
error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
|
error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
|
||||||
|
@ -32,7 +32,7 @@ error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
and $N others
|
and $N others
|
||||||
note: required by a bound in `Registry::<'r, S>::arg`
|
note: required by a bound in `Registry::<'r, S>::arg`
|
||||||
--> $WORKSPACE/juniper/src/executor/mod.rs
|
--> $WORKSPACE/juniper/src/executor/mod.rs
|
||||||
|
@ -57,7 +57,7 @@ error[E0277]: the trait bound `ObjectA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
and $N others
|
and $N others
|
||||||
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
@ -75,6 +75,6 @@ error[E0277]: the trait bound `ObjectA: ToInputValue<_>` is not satisfied
|
||||||
<Box<T> as ToInputValue<S>>
|
<Box<T> as ToInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as ToInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as ToInputValue<__S>>
|
||||||
<Arc<T> as ToInputValue<S>>
|
<Arc<T> as ToInputValue<S>>
|
||||||
<Vec<T> as ToInputValue<S>>
|
<TypeKind as ToInputValue<__S>>
|
||||||
and $N others
|
and $N others
|
||||||
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the derive macro `GraphQLInputObject` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
|
@ -13,15 +13,10 @@ note: ...which requires expanding type alias `Node2Value`...
|
||||||
= note: type aliases cannot be recursive
|
= note: type aliases cannot be recursive
|
||||||
= help: consider using a struct, enum, or union instead to break the cycle
|
= help: consider using a struct, enum, or union instead to break the cycle
|
||||||
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
|
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
|
||||||
note: cycle used when collecting item types in top-level module
|
note: cycle used when computing type of `<impl at $DIR/fail/interface/struct/attr_cyclic_impl.rs:3:1: 3:58>`
|
||||||
--> fail/interface/struct/attr_cyclic_impl.rs:1:1
|
--> fail/interface/struct/attr_cyclic_impl.rs:3:1
|
||||||
|
|
|
|
||||||
1 | / use juniper::graphql_interface;
|
3 | #[graphql_interface(impl = Node2Value, for = Node2Value)]
|
||||||
2 | |
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
3 | | #[graphql_interface(impl = Node2Value, for = Node2Value)]
|
|
||||||
4 | | struct Node1 {
|
|
||||||
... |
|
|
||||||
12 | |
|
|
||||||
13 | | fn main() {}
|
|
||||||
| |____________^
|
|
||||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||||
|
= note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
|
@ -13,15 +13,10 @@ note: ...which requires expanding type alias `Node2Value`...
|
||||||
= note: type aliases cannot be recursive
|
= note: type aliases cannot be recursive
|
||||||
= help: consider using a struct, enum, or union instead to break the cycle
|
= help: consider using a struct, enum, or union instead to break the cycle
|
||||||
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
|
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
|
||||||
note: cycle used when collecting item types in top-level module
|
note: cycle used when computing type of `<impl at $DIR/fail/interface/struct/derive_cyclic_impl.rs:3:10: 3:26>`
|
||||||
--> fail/interface/struct/derive_cyclic_impl.rs:1:1
|
--> fail/interface/struct/derive_cyclic_impl.rs:3:10
|
||||||
|
|
|
|
||||||
1 | / use juniper::GraphQLInterface;
|
3 | #[derive(GraphQLInterface)]
|
||||||
2 | |
|
| ^^^^^^^^^^^^^^^^
|
||||||
3 | | #[derive(GraphQLInterface)]
|
|
||||||
4 | | #[graphql(impl = Node2Value, for = Node2Value)]
|
|
||||||
... |
|
|
||||||
14 | |
|
|
||||||
15 | | fn main() {}
|
|
||||||
| |____________^
|
|
||||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||||
|
= note: this error originates in the derive macro `GraphQLInterface` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
|
@ -11,8 +11,8 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
|
||||||
<Box<T> as IsInputType<S>>
|
<Box<T> as IsInputType<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
||||||
<Arc<T> as IsInputType<S>>
|
<Arc<T> as IsInputType<S>>
|
||||||
<Vec<T> as IsInputType<S>>
|
|
||||||
<TypeKind as IsInputType<__S>>
|
<TypeKind as IsInputType<__S>>
|
||||||
|
<Vec<T> as IsInputType<S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
||||||
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
|
@ -31,8 +31,8 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
note: required by a bound in `Registry::<'r, S>::arg`
|
note: required by a bound in `Registry::<'r, S>::arg`
|
||||||
--> $WORKSPACE/juniper/src/executor/mod.rs
|
--> $WORKSPACE/juniper/src/executor/mod.rs
|
||||||
|
|
|
@ -13,15 +13,10 @@ note: ...which requires expanding type alias `Node2Value`...
|
||||||
= note: type aliases cannot be recursive
|
= note: type aliases cannot be recursive
|
||||||
= help: consider using a struct, enum, or union instead to break the cycle
|
= help: consider using a struct, enum, or union instead to break the cycle
|
||||||
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
|
= help: see <https://doc.rust-lang.org/reference/types.html#recursive-types> for more information
|
||||||
note: cycle used when collecting item types in top-level module
|
note: cycle used when computing type of `<impl at $DIR/fail/interface/trait/cyclic_impl.rs:3:1: 3:58>`
|
||||||
--> fail/interface/trait/cyclic_impl.rs:1:1
|
--> fail/interface/trait/cyclic_impl.rs:3:1
|
||||||
|
|
|
|
||||||
1 | / use juniper::graphql_interface;
|
3 | #[graphql_interface(impl = Node2Value, for = Node2Value)]
|
||||||
2 | |
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
3 | | #[graphql_interface(impl = Node2Value, for = Node2Value)]
|
|
||||||
4 | | trait Node1 {
|
|
||||||
... |
|
|
||||||
12 | |
|
|
||||||
13 | | fn main() {}
|
|
||||||
| |____________^
|
|
||||||
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
||||||
|
= note: this error originates in the attribute macro `graphql_interface` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
|
@ -11,8 +11,8 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
|
||||||
<Box<T> as IsInputType<S>>
|
<Box<T> as IsInputType<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
||||||
<Arc<T> as IsInputType<S>>
|
<Arc<T> as IsInputType<S>>
|
||||||
<Vec<T> as IsInputType<S>>
|
|
||||||
<TypeKind as IsInputType<__S>>
|
<TypeKind as IsInputType<__S>>
|
||||||
|
<Vec<T> as IsInputType<S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
||||||
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
|
@ -31,8 +31,8 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
note: required by a bound in `Registry::<'r, S>::arg`
|
note: required by a bound in `Registry::<'r, S>::arg`
|
||||||
--> $WORKSPACE/juniper/src/executor/mod.rs
|
--> $WORKSPACE/juniper/src/executor/mod.rs
|
||||||
|
@ -56,8 +56,8 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
= note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `graphql_object` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
@ -74,6 +74,14 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
||||||
|
warning: unused variable: `obj`
|
||||||
|
--> fail/object/argument_non_input_type.rs:12:18
|
||||||
|
|
|
||||||
|
12 | fn id(&self, obj: ObjA) -> &str {
|
||||||
|
| ^^^ help: if this is intentional, prefix it with an underscore: `_obj`
|
||||||
|
|
|
||||||
|
= note: `#[warn(unused_variables)]` on by default
|
||||||
|
|
|
@ -19,8 +19,8 @@ error[E0277]: the trait bound `ObjA: IsInputType<__S>` is not satisfied
|
||||||
<Box<T> as IsInputType<S>>
|
<Box<T> as IsInputType<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
<juniper::schema::model::DirectiveLocation as IsInputType<__S>>
|
||||||
<Arc<T> as IsInputType<S>>
|
<Arc<T> as IsInputType<S>>
|
||||||
<Vec<T> as IsInputType<S>>
|
|
||||||
<TypeKind as IsInputType<__S>>
|
<TypeKind as IsInputType<__S>>
|
||||||
|
<Vec<T> as IsInputType<S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
||||||
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
|
@ -39,8 +39,8 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
note: required by a bound in `Registry::<'r, S>::arg`
|
note: required by a bound in `Registry::<'r, S>::arg`
|
||||||
--> $WORKSPACE/juniper/src/executor/mod.rs
|
--> $WORKSPACE/juniper/src/executor/mod.rs
|
||||||
|
@ -64,8 +64,8 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
= note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `graphql_subscription` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
@ -82,6 +82,6 @@ error[E0277]: the trait bound `ObjA: FromInputValue<__S>` is not satisfied
|
||||||
<Box<T> as FromInputValue<S>>
|
<Box<T> as FromInputValue<S>>
|
||||||
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
<juniper::schema::model::DirectiveLocation as FromInputValue<__S>>
|
||||||
<Arc<T> as FromInputValue<S>>
|
<Arc<T> as FromInputValue<S>>
|
||||||
<Vec<T> as FromInputValue<S>>
|
|
||||||
<TypeKind as FromInputValue<__S>>
|
<TypeKind as FromInputValue<__S>>
|
||||||
|
<Vec<T> as FromInputValue<S>>
|
||||||
and $N others
|
and $N others
|
||||||
|
|
|
@ -8,3 +8,37 @@ error[E0119]: conflicting implementations of trait `MutuallyExclusive` for type
|
||||||
| conflicting implementation for `std::string::String`
|
| conflicting implementation for `std::string::String`
|
||||||
|
|
|
|
||||||
= note: this error originates in the macro `::juniper::sa::assert_type_ne_all` which comes from the expansion of the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the macro `::juniper::sa::assert_type_ne_all` which comes from the expansion of the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::string::String: GraphQLObject<__S>` is not satisfied
|
||||||
|
--> fail/union/enum_same_type_ugly.rs:5:7
|
||||||
|
|
|
||||||
|
5 | A(std::string::String),
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `std::string::String`
|
||||||
|
|
|
||||||
|
= help: the following other types implement trait `GraphQLObject<S>`:
|
||||||
|
<Box<T> as GraphQLObject<S>>
|
||||||
|
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
|
||||||
|
<Argument<'a, S> as GraphQLObject<S>>
|
||||||
|
<EnumValue as GraphQLObject<__S>>
|
||||||
|
<SchemaType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
|
||||||
|
<Arc<T> as GraphQLObject<S>>
|
||||||
|
<&T as GraphQLObject<S>>
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::string::String: GraphQLObject<__S>` is not satisfied
|
||||||
|
--> fail/union/enum_same_type_ugly.rs:6:7
|
||||||
|
|
|
||||||
|
6 | B(String),
|
||||||
|
| ^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `std::string::String`
|
||||||
|
|
|
||||||
|
= help: the following other types implement trait `GraphQLObject<S>`:
|
||||||
|
<Box<T> as GraphQLObject<S>>
|
||||||
|
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
|
||||||
|
<Argument<'a, S> as GraphQLObject<S>>
|
||||||
|
<EnumValue as GraphQLObject<__S>>
|
||||||
|
<SchemaType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
|
||||||
|
<Arc<T> as GraphQLObject<S>>
|
||||||
|
<&T as GraphQLObject<S>>
|
||||||
|
|
|
@ -8,3 +8,37 @@ error[E0119]: conflicting implementations of trait `MutuallyExclusive` for type
|
||||||
| conflicting implementation for `std::string::String`
|
| conflicting implementation for `std::string::String`
|
||||||
|
|
|
|
||||||
= note: this error originates in the macro `::juniper::sa::assert_type_ne_all` which comes from the expansion of the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the macro `::juniper::sa::assert_type_ne_all` which comes from the expansion of the derive macro `GraphQLUnion` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::string::String: GraphQLObject<__S>` is not satisfied
|
||||||
|
--> fail/union/struct_same_type_ugly.rs:5:14
|
||||||
|
|
|
||||||
|
5 | #[graphql(on std::string::String = Character::b)]
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `std::string::String`
|
||||||
|
|
|
||||||
|
= help: the following other types implement trait `GraphQLObject<S>`:
|
||||||
|
<Box<T> as GraphQLObject<S>>
|
||||||
|
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
|
||||||
|
<Argument<'a, S> as GraphQLObject<S>>
|
||||||
|
<EnumValue as GraphQLObject<__S>>
|
||||||
|
<SchemaType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
|
||||||
|
<Arc<T> as GraphQLObject<S>>
|
||||||
|
<&T as GraphQLObject<S>>
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::string::String: GraphQLObject<__S>` is not satisfied
|
||||||
|
--> fail/union/struct_same_type_ugly.rs:4:14
|
||||||
|
|
|
||||||
|
4 | #[graphql(on String = Character::a)]
|
||||||
|
| ^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `std::string::String`
|
||||||
|
|
|
||||||
|
= help: the following other types implement trait `GraphQLObject<S>`:
|
||||||
|
<Box<T> as GraphQLObject<S>>
|
||||||
|
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
|
||||||
|
<Argument<'a, S> as GraphQLObject<S>>
|
||||||
|
<EnumValue as GraphQLObject<__S>>
|
||||||
|
<SchemaType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
|
||||||
|
<Arc<T> as GraphQLObject<S>>
|
||||||
|
<&T as GraphQLObject<S>>
|
||||||
|
|
|
@ -8,3 +8,37 @@ error[E0119]: conflicting implementations of trait `MutuallyExclusive` for type
|
||||||
| conflicting implementation for `std::string::String`
|
| conflicting implementation for `std::string::String`
|
||||||
|
|
|
|
||||||
= note: this error originates in the macro `::juniper::sa::assert_type_ne_all` which comes from the expansion of the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the macro `::juniper::sa::assert_type_ne_all` which comes from the expansion of the attribute macro `graphql_union` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::string::String: GraphQLObject<__S>` is not satisfied
|
||||||
|
--> fail/union/trait_same_type_ugly.rs:5:28
|
||||||
|
|
|
||||||
|
5 | fn a(&self) -> Option<&String>;
|
||||||
|
| ^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `std::string::String`
|
||||||
|
|
|
||||||
|
= help: the following other types implement trait `GraphQLObject<S>`:
|
||||||
|
<Box<T> as GraphQLObject<S>>
|
||||||
|
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
|
||||||
|
<Argument<'a, S> as GraphQLObject<S>>
|
||||||
|
<EnumValue as GraphQLObject<__S>>
|
||||||
|
<SchemaType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
|
||||||
|
<Arc<T> as GraphQLObject<S>>
|
||||||
|
<&T as GraphQLObject<S>>
|
||||||
|
|
||||||
|
error[E0277]: the trait bound `std::string::String: GraphQLObject<__S>` is not satisfied
|
||||||
|
--> fail/union/trait_same_type_ugly.rs:6:28
|
||||||
|
|
|
||||||
|
6 | fn b(&self) -> Option<&std::string::String>;
|
||||||
|
| ^^^^^^^^^^^^^^^^^^^ the trait `GraphQLObject<__S>` is not implemented for `std::string::String`
|
||||||
|
|
|
||||||
|
= help: the following other types implement trait `GraphQLObject<S>`:
|
||||||
|
<Box<T> as GraphQLObject<S>>
|
||||||
|
<juniper::meta::Field<'a, S> as GraphQLObject<S>>
|
||||||
|
<Argument<'a, S> as GraphQLObject<S>>
|
||||||
|
<EnumValue as GraphQLObject<__S>>
|
||||||
|
<SchemaType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::TypeType<'a, S> as GraphQLObject<S>>
|
||||||
|
<juniper::schema::model::DirectiveType<'a, S> as GraphQLObject<S>>
|
||||||
|
<Arc<T> as GraphQLObject<S>>
|
||||||
|
<&T as GraphQLObject<S>>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
//! Tests for `#[graphql_interface]` macro placed on a trait.
|
//! Tests for `#[graphql_interface]` macro placed on a trait.
|
||||||
|
|
||||||
|
#![allow(dead_code)]
|
||||||
// Assert that `#[graphql_interface]` macro placed on a trait stops Clippy from enforcing `# Errors`
|
// Assert that `#[graphql_interface]` macro placed on a trait stops Clippy from enforcing `# Errors`
|
||||||
// and `# Panics` sections in GraphQL descriptions.
|
// and `# Panics` sections in GraphQL descriptions.
|
||||||
#![deny(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
#![deny(clippy::missing_errors_doc, clippy::missing_panics_doc)]
|
||||||
|
|
|
@ -998,6 +998,7 @@ mod inferred_custom_context {
|
||||||
mod ignored_method {
|
mod ignored_method {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[graphql_union]
|
#[graphql_union]
|
||||||
trait Character {
|
trait Character {
|
||||||
fn as_human(&self) -> prelude::Option<&Human> {
|
fn as_human(&self) -> prelude::Option<&Human> {
|
||||||
|
@ -1180,6 +1181,7 @@ mod full_featured {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
/// Rust doc.
|
/// Rust doc.
|
||||||
|
#[allow(dead_code)]
|
||||||
#[graphql_union(name = "MyChar")]
|
#[graphql_union(name = "MyChar")]
|
||||||
#[graphql_union(description = "My character.")]
|
#[graphql_union(description = "My character.")]
|
||||||
#[graphql_union(context = CustomContext, scalar = DefaultScalarValue)]
|
#[graphql_union(context = CustomContext, scalar = DefaultScalarValue)]
|
||||||
|
|
|
@ -8,6 +8,7 @@ use juniper::{
|
||||||
|
|
||||||
struct Query;
|
struct Query;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[graphql_interface(for = [Human, Droid])]
|
#[graphql_interface(for = [Human, Droid])]
|
||||||
trait Character {
|
trait Character {
|
||||||
fn id(&self) -> &str;
|
fn id(&self) -> &str;
|
||||||
|
|
|
@ -6,6 +6,7 @@ use juniper::{
|
||||||
EmptySubscription, GraphQLObject, GraphQLUnion, RootNode,
|
EmptySubscription, GraphQLObject, GraphQLUnion, RootNode,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[graphql_interface(for = [Human, Droid])]
|
#[graphql_interface(for = [Human, Droid])]
|
||||||
trait Character {
|
trait Character {
|
||||||
fn id(&self) -> &str;
|
fn id(&self) -> &str;
|
||||||
|
|
|
@ -24,6 +24,7 @@ impl Query {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
#[graphql_interface(for = [Human, Droid])]
|
#[graphql_interface(for = [Human, Droid])]
|
||||||
trait Character {
|
trait Character {
|
||||||
fn id(&self) -> i32;
|
fn id(&self) -> i32;
|
||||||
|
|
Loading…
Reference in a new issue