diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cc49c603..61608bf2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,10 +54,7 @@ jobs: if: github.event_name == 'push' || github.event_name == 'schedule' || github.event.pull_request.head.repo.full_name != github.repository strategy: matrix: - # nightly was pinned because of a compiler bug: - # https://github.com/rust-lang/rust/issues/145288 - # TODO: remove the pinning once the bug is fixed - rust: [stable, nightly-2025-08-11, "1.85"] # 1.85 is the MSRV + rust: [stable, nightly, "1.85"] # 1.85 is the MSRV os: [ubuntu-latest, macos-latest, windows-latest] name: Build & test @@ -144,7 +141,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: # cot_macros ui tests require nightly - toolchain: nightly-2025-08-11 + toolchain: nightly - name: Cache Cargo registry uses: Swatinem/rust-cache@v2 @@ -190,7 +187,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: # branch coverage is currently optional and requires nightly - toolchain: nightly-2025-08-11 + toolchain: nightly components: llvm-tools-preview - name: Reclaim disk space @@ -243,7 +240,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: # nightly-only rustfmt settings - toolchain: nightly-2025-08-11 + toolchain: nightly components: rustfmt - name: Cache Cargo registry @@ -294,7 +291,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: # the `-Z` flag is only accepted on the nightly channel of Cargo - toolchain: nightly-2025-08-11 + toolchain: nightly - name: Cache Cargo registry uses: Swatinem/rust-cache@v2 @@ -363,7 +360,7 @@ jobs: uses: dtolnay/rust-toolchain@master with: # miri requires nightly - toolchain: nightly-2025-08-11 + toolchain: nightly components: miri - name: Cache Cargo registry diff --git a/cot-macros/tests/ui/derive_api_operation_response_missing_trait_impl.stderr b/cot-macros/tests/ui/derive_api_operation_response_missing_trait_impl.stderr index 56fb3f5e..6380b025 100644 --- a/cot-macros/tests/ui/derive_api_operation_response_missing_trait_impl.stderr +++ b/cot-macros/tests/ui/derive_api_operation_response_missing_trait_impl.stderr @@ -2,8 +2,13 @@ error[E0277]: the trait bound `Dummy: ApiOperationResponse` is not satisfied --> tests/ui/derive_api_operation_response_missing_trait_impl.rs:5:7 | 5 | A(Dummy), - | ^^^^^ the trait `ApiOperationResponse` is not implemented for `Dummy` + | ^^^^^ unsatisfied trait bound | +help: the trait `ApiOperationResponse` is not implemented for `Dummy` + --> tests/ui/derive_api_operation_response_missing_trait_impl.rs:8:1 + | +8 | struct Dummy; + | ^^^^^^^^^^^^ = help: the following other types implement trait `ApiOperationResponse`: Json MyResponse diff --git a/cot/tests/ui/unimplemented_admin_model.stderr b/cot/tests/ui/unimplemented_admin_model.stderr index 92aaa833..f0e7ac02 100644 --- a/cot/tests/ui/unimplemented_admin_model.stderr +++ b/cot/tests/ui/unimplemented_admin_model.stderr @@ -4,8 +4,17 @@ error[E0277]: `Model` does not implement the `AdminModel` trait 6 | let _: Box = Box::new(DefaultAdminModelManager::::new()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Model` is not an admin model | - = help: the trait `AdminModel` is not implemented for `Model` +help: the trait `AdminModel` is not implemented for `Model` + --> tests/ui/unimplemented_admin_model.rs:3:1 + | +3 | struct Model {} + | ^^^^^^^^^^^^ = note: add #[derive(cot::admin::AdminModel)] to the struct to automatically derive the trait - = help: the trait `AdminModel` is implemented for `DatabaseUser` +help: the trait `AdminModel` is implemented for `DatabaseUser` + --> src/auth/db.rs + | + | #[derive(Debug, Clone, Form, AdminModel)] + | ^^^^^^^^^^ = note: required for `DefaultAdminModelManager` to implement `AdminModelManager` = note: required for the cast from `Box>` to `Box` + = note: this error originates in the derive macro `AdminModel` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/cot/tests/ui/unimplemented_db_model.stderr b/cot/tests/ui/unimplemented_db_model.stderr index 4a48a0f0..8f9dc064 100644 --- a/cot/tests/ui/unimplemented_db_model.stderr +++ b/cot/tests/ui/unimplemented_db_model.stderr @@ -4,8 +4,20 @@ error[E0277]: `TodoItem` is not marked as a database model 6 | let _ = ::objects(); | ^^^^^^^^ `TodoItem` is not annotated with `#[cot::db::model]` | - = help: the trait `cot::db::Model` is not implemented for `TodoItem` +help: the trait `cot::db::Model` is not implemented for `TodoItem` + --> tests/ui/unimplemented_db_model.rs:3:1 + | +3 | struct TodoItem {} + | ^^^^^^^^^^^^^^^ = note: annotate `TodoItem` with the `#[cot::db::model]` attribute - = help: the following other types implement trait `cot::db::Model`: - DatabaseUser - cot::session::db::Session +help: the following other types implement trait `cot::db::Model` + --> src/session/db.rs + | + | #[model] + | ^^^^^^^^ `cot::session::db::Session` + | + ::: src/auth/db.rs + | + | #[model] + | ^^^^^^^^ `DatabaseUser` + = note: this error originates in the attribute macro `model` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/cot/tests/ui/unimplemented_form.stderr b/cot/tests/ui/unimplemented_form.stderr index 16f1b24c..833a1924 100644 --- a/cot/tests/ui/unimplemented_form.stderr +++ b/cot/tests/ui/unimplemented_form.stderr @@ -4,6 +4,15 @@ error[E0277]: `MyForm` does not implement the `Form` trait 6 | let _ = <::Context as FormContext>::new(); | ^^^^^^ `MyForm` is not a form | - = help: the trait `cot::form::Form` is not implemented for `MyForm` +help: the trait `cot::form::Form` is not implemented for `MyForm` + --> tests/ui/unimplemented_form.rs:3:1 + | +3 | struct MyForm {} + | ^^^^^^^^^^^^^ = note: add #[derive(cot::form::Form)] to the struct to automatically derive the trait - = help: the trait `cot::form::Form` is implemented for `DatabaseUser` +help: the trait `cot::form::Form` is implemented for `DatabaseUser` + --> src/auth/db.rs + | + | #[derive(Debug, Clone, Form, AdminModel)] + | ^^^^ + = note: this error originates in the derive macro `Form` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/cot/tests/ui/unimplemented_request_handler.stderr b/cot/tests/ui/unimplemented_request_handler.stderr index ad56801b..25e0755c 100644 --- a/cot/tests/ui/unimplemented_request_handler.stderr +++ b/cot/tests/ui/unimplemented_request_handler.stderr @@ -12,10 +12,23 @@ error[E0277]: `fn(()) -> impl Future, = note: make sure there is at most one parameter implementing `FromRequest` = note: make sure the function takes no more than 10 parameters = note: make sure the function returns a type that implements `IntoResponse` - = help: the following other types implement trait `RequestHandler`: - `ApiMethodRouter` implements `RequestHandler` - `MethodRouter` implements `RequestHandler` - `cot::openapi::NoApi` implements `RequestHandler` +help: the following other types implement trait `RequestHandler` + | + ::: src/router/method/openapi.rs + | + | impl RequestHandler for ApiMethodRouter { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ApiMethodRouter` implements `RequestHandler` + --> src/router/method.rs + | + | impl RequestHandler for MethodRouter { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MethodRouter` implements `RequestHandler` + | + ::: src/openapi.rs + | + | / impl RequestHandler for NoApi + | | where + | | H: RequestHandler, + | |_____________________________________^ `cot::openapi::NoApi` implements `RequestHandler` note: required by a bound in `Route::with_handler` --> src/router.rs |