From 29930b002bebdbdfcfc4928b7bc1afe836129f02 Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Sat, 18 Jul 2020 13:19:50 -1000 Subject: [PATCH] Update compile fail tests for nightly Rust (#710) * Update compile fail tests for latest Rust The messages appear to have changed on nightly * Fix tests depending on fixture data * Fix more integration test paths * Fix doc warnings --- benches/bench.rs | 2 +- .../input-object/derive_incompatible_object.stderr | 12 ++++++------ .../fail/interface/impl_argument_no_object.stderr | 8 ++++---- .../fail/object/impl_argument_no_object.stderr | 4 ++-- .../fail/union/enum_non_object_variant.stderr | 6 +++--- .../fail/union/enum_same_type_ugly.stderr | 2 +- .../fail/union/struct_non_object_variant.stderr | 6 +++--- .../fail/union/struct_same_type_ugly.stderr | 2 +- .../fail/union/trait_fail_infer_context.stderr | 6 +++--- .../fail/union/trait_non_object_variant.stderr | 6 +++--- .../fail/union/trait_same_type_ugly.stderr | 2 +- juniper/src/tests/fixtures/mod.rs | 1 + .../src/tests/fixtures/starwars/schema_language.rs | 2 ++ juniper_rocket/src/lib.rs | 4 ++-- juniper_rocket_async/src/lib.rs | 4 ++-- 15 files changed, 35 insertions(+), 32 deletions(-) diff --git a/benches/bench.rs b/benches/bench.rs index 331a2ccc..417c9ebe 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -5,7 +5,7 @@ extern crate juniper; use bencher::Bencher; use juniper::{execute_sync, RootNode, EmptyMutation, EmptySubscription, Variables}; -use juniper::tests::model::Database; +use juniper::tests::fixtures::starwars::model::Database; fn query_type_name(b: &mut Bencher) { let database = Database::new(); diff --git a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr b/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr index 7871c2f3..69932a98 100644 --- a/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr +++ b/integration_tests/codegen_fail/fail/input-object/derive_incompatible_object.stderr @@ -1,18 +1,18 @@ -error[E0277]: the trait bound `ObjectA: juniper::ast::FromInputValue<__S>` is not satisfied +error[E0277]: the trait bound `ObjectA: juniper::FromInputValue<__S>` is not satisfied --> $DIR/derive_incompatible_object.rs:6:10 | 6 | #[derive(juniper::GraphQLInputObject)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `juniper::ast::FromInputValue<__S>` is not implemented for `ObjectA` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `juniper::FromInputValue<__S>` is not implemented for `ObjectA` | = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `ObjectA: juniper::ast::FromInputValue<__S>` is not satisfied +error[E0277]: the trait bound `ObjectA: juniper::FromInputValue<__S>` is not satisfied --> $DIR/derive_incompatible_object.rs:6:10 | 6 | #[derive(juniper::GraphQLInputObject)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `juniper::ast::FromInputValue<__S>` is not implemented for `ObjectA` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `juniper::FromInputValue<__S>` is not implemented for `ObjectA` | - = note: required by `juniper::ast::FromInputValue::from_input_value` + = note: required by `juniper::FromInputValue::from_input_value` = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: no method named `to_input_value` found for struct `ObjectA` in the current scope @@ -26,5 +26,5 @@ error[E0599]: no method named `to_input_value` found for struct `ObjectA` in the | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `to_input_value`, perhaps you need to implement it: - candidate #1: `juniper::ast::ToInputValue` + candidate #1: `juniper::ToInputValue` = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/interface/impl_argument_no_object.stderr b/integration_tests/codegen_fail/fail/interface/impl_argument_no_object.stderr index a5a45868..47b037c8 100644 --- a/integration_tests/codegen_fail/fail/interface/impl_argument_no_object.stderr +++ b/integration_tests/codegen_fail/fail/interface/impl_argument_no_object.stderr @@ -1,4 +1,4 @@ -error[E0277]: the trait bound `ObjA: juniper::ast::FromInputValue` is not satisfied +error[E0277]: the trait bound `ObjA: juniper::FromInputValue` is not satisfied --> $DIR/impl_argument_no_object.rs:11:1 | 11 | / juniper::graphql_interface!(Character: () where Scalar = juniper::DefaultScalarValue |&self| { @@ -8,11 +8,11 @@ error[E0277]: the trait bound `ObjA: juniper::ast::FromInputValue` is not satisf ... | 20 | | } 21 | | }); - | |___^ the trait `juniper::ast::FromInputValue` is not implemented for `ObjA` + | |___^ the trait `juniper::FromInputValue` is not implemented for `ObjA` | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0277]: the trait bound `ObjA: juniper::ast::FromInputValue` is not satisfied +error[E0277]: the trait bound `ObjA: juniper::FromInputValue` is not satisfied --> $DIR/impl_argument_no_object.rs:11:1 | 11 | / juniper::graphql_interface!(Character: () where Scalar = juniper::DefaultScalarValue |&self| { @@ -22,6 +22,6 @@ error[E0277]: the trait bound `ObjA: juniper::ast::FromInputValue` is not satisf ... | 20 | | } 21 | | }); - | |___^ the trait `juniper::ast::FromInputValue` is not implemented for `ObjA` + | |___^ the trait `juniper::FromInputValue` is not implemented for `ObjA` | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr b/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr index 12da9cda..19ead7c4 100644 --- a/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr +++ b/integration_tests/codegen_fail/fail/object/impl_argument_no_object.stderr @@ -1,7 +1,7 @@ -error[E0277]: the trait bound `Obj: juniper::ast::FromInputValue` is not satisfied +error[E0277]: the trait bound `Obj: juniper::FromInputValue` is not satisfied --> $DIR/impl_argument_no_object.rs:8:1 | 8 | #[juniper::graphql_object] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `juniper::ast::FromInputValue` is not implemented for `Obj` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `juniper::FromInputValue` is not implemented for `Obj` | = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr index add99e41..464900f1 100644 --- a/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_non_object_variant.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `Test: juniper::types::marker::GraphQLObjectType<__S>` is not satisfied +error[E0277]: the trait bound `Test: juniper::marker::GraphQLObjectType<__S>` is not satisfied --> $DIR/enum_non_object_variant.rs:9:10 | 9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `juniper::types::marker::GraphQLObjectType<__S>` is not implemented for `Test` + | ^^^^^^^^^^^^ the trait `juniper::marker::GraphQLObjectType<__S>` is not implemented for `Test` | - = note: required by `juniper::types::marker::GraphQLObjectType::mark` + = note: required by `juniper::marker::GraphQLObjectType::mark` = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr b/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr index 16a967e3..f8c1a9f0 100644 --- a/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr +++ b/integration_tests/codegen_fail/fail/union/enum_same_type_ugly.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `>::mark::_::{{closure}}#0::MutuallyExclusive` for type `std::string::String`: +error[E0119]: conflicting implementations of trait `>::mark::_::{{closure}}#0::MutuallyExclusive` for type `std::string::String`: --> $DIR/enum_same_type_ugly.rs:3:10 | 3 | #[derive(GraphQLUnion)] diff --git a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr index ca336372..3f706a54 100644 --- a/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_non_object_variant.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `Test: juniper::types::marker::GraphQLObjectType<__S>` is not satisfied +error[E0277]: the trait bound `Test: juniper::marker::GraphQLObjectType<__S>` is not satisfied --> $DIR/struct_non_object_variant.rs:9:10 | 9 | #[derive(GraphQLUnion)] - | ^^^^^^^^^^^^ the trait `juniper::types::marker::GraphQLObjectType<__S>` is not implemented for `Test` + | ^^^^^^^^^^^^ the trait `juniper::marker::GraphQLObjectType<__S>` is not implemented for `Test` | - = note: required by `juniper::types::marker::GraphQLObjectType::mark` + = note: required by `juniper::marker::GraphQLObjectType::mark` = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr b/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr index 4babd863..08d35082 100644 --- a/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr +++ b/integration_tests/codegen_fail/fail/union/struct_same_type_ugly.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `>::mark::_::{{closure}}#0::MutuallyExclusive` for type `std::string::String`: +error[E0119]: conflicting implementations of trait `>::mark::_::{{closure}}#0::MutuallyExclusive` for type `std::string::String`: --> $DIR/struct_same_type_ugly.rs:3:10 | 3 | #[derive(GraphQLUnion)] diff --git a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr b/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr index 6ffa46c5..f452af52 100644 --- a/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_fail_infer_context.stderr @@ -1,10 +1,10 @@ -error[E0277]: the trait bound `CustomContext: juniper::executor::FromContext` is not satisfied +error[E0277]: the trait bound `CustomContext: juniper::FromContext` is not satisfied --> $DIR/trait_fail_infer_context.rs:3:1 | 3 | #[graphql_union] - | ^^^^^^^^^^^^^^^^ the trait `juniper::executor::FromContext` is not implemented for `CustomContext` + | ^^^^^^^^^^^^^^^^ the trait `juniper::FromContext` is not implemented for `CustomContext` | - = note: required by `juniper::executor::FromContext::from` + = note: required by `juniper::FromContext::from` = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types diff --git a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr index a0940e82..f6fe2698 100644 --- a/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_non_object_variant.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `Test: juniper::types::marker::GraphQLObjectType<__S>` is not satisfied +error[E0277]: the trait bound `Test: juniper::marker::GraphQLObjectType<__S>` is not satisfied --> $DIR/trait_non_object_variant.rs:9:1 | 9 | #[graphql_union] - | ^^^^^^^^^^^^^^^^ the trait `juniper::types::marker::GraphQLObjectType<__S>` is not implemented for `Test` + | ^^^^^^^^^^^^^^^^ the trait `juniper::marker::GraphQLObjectType<__S>` is not implemented for `Test` | - = note: required by `juniper::types::marker::GraphQLObjectType::mark` + = note: required by `juniper::marker::GraphQLObjectType::mark` = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr b/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr index 1b57de71..f1cb6485 100644 --- a/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr +++ b/integration_tests/codegen_fail/fail/union/trait_same_type_ugly.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `<(dyn Character + std::marker::Send + std::marker::Sync + '__obj) as juniper::types::marker::GraphQLUnion<__S>>::mark::_::{{closure}}#0::MutuallyExclusive` for type `std::string::String`: +error[E0119]: conflicting implementations of trait `<(dyn Character + std::marker::Send + std::marker::Sync + '__obj) as juniper::GraphQLUnion<__S>>::mark::_::{{closure}}#0::MutuallyExclusive` for type `std::string::String`: --> $DIR/trait_same_type_ugly.rs:3:1 | 3 | #[graphql_union] diff --git a/juniper/src/tests/fixtures/mod.rs b/juniper/src/tests/fixtures/mod.rs index 4c97db68..71b5bec8 100644 --- a/juniper/src/tests/fixtures/mod.rs +++ b/juniper/src/tests/fixtures/mod.rs @@ -1,3 +1,4 @@ //! Library fixtures +/// GraphQL schema and data from Star Wars. pub mod starwars; diff --git a/juniper/src/tests/fixtures/starwars/schema_language.rs b/juniper/src/tests/fixtures/starwars/schema_language.rs index bdb0692d..c2f16023 100644 --- a/juniper/src/tests/fixtures/starwars/schema_language.rs +++ b/juniper/src/tests/fixtures/starwars/schema_language.rs @@ -1,3 +1,5 @@ +#![allow(missing_docs)] + /// The schema as a static/hardcoded GraphQL Schema Language. pub const STATIC_GRAPHQL_SCHEMA_DEFINITION: &str = include_str!("starwars.graphql"); diff --git a/juniper_rocket/src/lib.rs b/juniper_rocket/src/lib.rs index 23cc806b..89269543 100644 --- a/juniper_rocket/src/lib.rs +++ b/juniper_rocket/src/lib.rs @@ -141,8 +141,8 @@ impl GraphQLResponse { /// # use rocket::response::content; /// # use rocket::State; /// # - /// # use juniper::tests::schema::Query; - /// # use juniper::tests::model::Database; + /// # use juniper::tests::fixtures::starwars::schema::Query; + /// # use juniper::tests::fixtures::starwars::model::Database; /// # use juniper::{EmptyMutation, EmptySubscription, FieldError, RootNode, Value}; /// # /// # type Schema = RootNode<'static, Query, EmptyMutation, EmptySubscription>; diff --git a/juniper_rocket_async/src/lib.rs b/juniper_rocket_async/src/lib.rs index 995e2a4f..f3c02bb4 100644 --- a/juniper_rocket_async/src/lib.rs +++ b/juniper_rocket_async/src/lib.rs @@ -164,8 +164,8 @@ impl GraphQLResponse { /// # use rocket::response::content; /// # use rocket::State; /// # - /// # use juniper::tests::schema::Query; - /// # use juniper::tests::model::Database; + /// # use juniper::tests::fixtures::starwars::schema::Query; + /// # use juniper::tests::fixtures::starwars::model::Database; /// # use juniper::{EmptyMutation, EmptySubscription, FieldError, RootNode, Value}; /// # /// # type Schema = RootNode<'static, Query, EmptyMutation, EmptySubscription>;