Skip to content

Commit

Permalink
Bump compiletest rust version (#282)
Browse files Browse the repository at this point in the history
* Bump compiletest rustc version from 1.65.0 to 1.77
* Regenerate expected outputs from compiletests for new version
  • Loading branch information
GnomedDev committed Apr 2, 2024
1 parent 74a980e commit e0d7bef
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compiletests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.65.0
- uses: dtolnay/rust-toolchain@1.77
- name: main crate
run: |
cargo build --verbose
Expand Down
12 changes: 6 additions & 6 deletions tests/compile-fail/attrs_with_bad_fn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ error[E0308]: mismatched types
11 | #[darling(with = bad_converter)]
| ^^^^^^^^^^^^^
| |
| expected enum `Result`, found struct `Vec`
| arguments to this function are incorrect
| expected `Result<_, Error>`, found `Vec<Attribute>`
| arguments to this method are incorrect
|
= note: expected enum `Result<_, darling::Error>`
found struct `Vec<Attribute>`
note: associated function defined here
note: method defined here
--> core/src/error/mod.rs
|
| pub fn handle<T>(&mut self, result: Result<T>) -> Option<T> {
| ^^^^^^
help: try wrapping the expression in `Ok`
|
11 | #[darling(with = Ok(bad_converter))]
| +++ +
|
11 | #[darling(with = Ok(bad_converter))]
| +++ +
13 changes: 4 additions & 9 deletions tests/compile-fail/default_expr_wrong_type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ error[E0308]: mismatched types
--> tests/compile-fail/default_expr_wrong_type.rs:5:25
|
5 | #[darling(default = "usize::default")]
| ^^^^^^^^^^^^^^^^ expected struct `String`, found `usize`
|
help: try using a conversion method
|
5 | #[darling(default = "usize::default".to_string())]
| ++++++++++++
5 | #[darling(default = "usize::default".to_string())]
| ++++++++++++
| ^^^^^^^^^^^^^^^^- help: try using a conversion method: `.to_string()`
| |
| expected `String`, found `usize`

error[E0308]: mismatched types
--> tests/compile-fail/default_expr_wrong_type.rs:8:35
|
8 | #[darling(multiple, default = "usize::default")]
| ^^^^^^^^^^^^^^^^ expected struct `Vec`, found `usize`
| ^^^^^^^^^^^^^^^^ expected `Vec<String>`, found `usize`
|
= note: expected struct `Vec<String>`
found type `usize`
32 changes: 16 additions & 16 deletions tests/compile-fail/not_impl_from_meta.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ error[E0277]: the trait bound `NotImplFm: FromMeta` is not satisfied
| ^^^^^^^^^ the trait `FromMeta` is not implemented for `NotImplFm`
|
= help: the following other types implement trait `FromMeta`:
()
Arc<T>
AtomicBool
ExprArray
ExprPath
Flag
HashMap<String, V, S>
HashMap<proc_macro2::Ident, V, S>
bool
char
isize
i8
i16
i32
i64
i128
and $N others

error[E0277]: the trait bound `NotImplFm: FromMeta` is not satisfied
Expand All @@ -22,12 +22,12 @@ error[E0277]: the trait bound `NotImplFm: FromMeta` is not satisfied
| ^^^^^^^^^ the trait `FromMeta` is not implemented for `NotImplFm`
|
= help: the following other types implement trait `FromMeta`:
()
Arc<T>
AtomicBool
ExprArray
ExprPath
Flag
HashMap<String, V, S>
HashMap<proc_macro2::Ident, V, S>
bool
char
isize
i8
i16
i32
i64
i128
and $N others
6 changes: 4 additions & 2 deletions tests/compile-fail/skip_field_not_impl_default.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ error[E0277]: the trait bound `NoDefault: std::default::Default` is not satisfie
|
help: consider annotating `NoDefault` with `#[derive(Default)]`
|
4 | #[derive(Default)]
4 + #[derive(Default)]
5 | struct NoDefault(String);
|

error[E0277]: the trait bound `NoDefault: std::default::Default` is not satisfied
Expand All @@ -17,5 +18,6 @@ error[E0277]: the trait bound `NoDefault: std::default::Default` is not satisfie
|
help: consider annotating `NoDefault` with `#[derive(Default)]`
|
4 | #[derive(Default)]
4 + #[derive(Default)]
5 | struct NoDefault(String);
|
4 changes: 2 additions & 2 deletions tests/compiletests.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![cfg(compiletests)]

#[rustversion::stable(1.65)]
#[rustversion::stable(1.77)]
#[test]
fn compile_test() {
let t = trybuild::TestCases::new();
t.compile_fail("tests/compile-fail/*.rs");
}

#[rustversion::not(stable(1.65))]
#[rustversion::not(stable(1.77))]
#[test]
fn wrong_rustc_version() {
panic!(
Expand Down

0 comments on commit e0d7bef

Please sign in to comment.