Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move compile-fail tests to rustc 1.59
This version works locally on M1 processors.
- Loading branch information
Showing
9 changed files
with
47 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 10 additions & 5 deletions
15
derive_builder/tests/compile-fail/custom_error_generic_missing_bound.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
error[E0277]: the trait bound `N: Popular` is not satisfied | ||
--> $DIR/custom_error_generic_missing_bound.rs:17:31 | ||
--> tests/compile-fail/custom_error_generic_missing_bound.rs:17:31 | ||
| | ||
17 | #[builder(build_fn(validate = "check_person", error = "Error<N>"))] | ||
| ^^^^^^^^^^^^^^ the trait `Popular` is not implemented for `N` | ||
18 | struct Person<N> { | ||
| - consider adding a `where N: Popular` bound | ||
... | ||
| | ||
note: required by a bound in `check_person` | ||
--> tests/compile-fail/custom_error_generic_missing_bound.rs:34:20 | ||
| | ||
34 | fn check_person<N: Popular + Clone>(builder: &PersonBuilder<N>) -> Result<(), Error<N>> { | ||
| ------------ ------- required by this bound in `check_person` | ||
| ^^^^^^^ required by this bound in `check_person` | ||
help: consider restricting type parameter `N` | ||
| | ||
18 | struct Person<N: Popular> { | ||
| +++++++++ |
9 changes: 4 additions & 5 deletions
9
derive_builder/tests/compile-fail/custom_error_no_from.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
error[E0277]: the trait bound `Error: std::convert::From<derive_builder::UninitializedFieldError>` is not satisfied | ||
--> $DIR/custom_error_no_from.rs:21:55 | ||
error[E0277]: the trait bound `Error: From<UninitializedFieldError>` is not satisfied | ||
--> tests/compile-fail/custom_error_no_from.rs:21:55 | ||
| | ||
21 | #[builder(build_fn(validate = "check_person", error = "Error"))] | ||
| ^^^^^^^ the trait `std::convert::From<derive_builder::UninitializedFieldError>` is not implemented for `Error` | ||
| ^^^^^^^ the trait `From<UninitializedFieldError>` is not implemented for `Error` | ||
| | ||
= note: required because of the requirements on the impl of `std::convert::Into<Error>` for `derive_builder::UninitializedFieldError` | ||
= note: required by `std::convert::Into::into` | ||
= note: required because of the requirements on the impl of `Into<Error>` for `UninitializedFieldError` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
warning: unused import: `Lorem` | ||
--> $DIR/private_build_fn.rs:23:21 | ||
--> tests/compile-fail/private_build_fn.rs:23:21 | ||
| | ||
23 | use container::{Lorem, LoremBuilder}; | ||
| ^^^^^ | ||
| | ||
= note: `#[warn(unused_imports)]` on by default | ||
|
||
error[E0624]: method `build` is private | ||
--> $DIR/private_build_fn.rs:27:42 | ||
error[E0624]: associated function `build` is private | ||
--> tests/compile-fail/private_build_fn.rs:27:42 | ||
| | ||
7 | #[derive(Debug, Default, Builder)] | ||
| ------- private associated function defined here | ||
... | ||
27 | let lorem2 = LoremBuilder::default().build().unwrap(); | ||
| ^^^^^ | ||
| ^^^^^ private associated function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
error[E0603]: struct `LoremBuilder` is private | ||
--> $DIR/private_builder.rs:17:18 | ||
--> tests/compile-fail/private_builder.rs:17:18 | ||
| | ||
17 | let x = foo::LoremBuilder::default() | ||
| ^^^^^^^^^^^^ | ||
| ^^^^^^^^^^^^ private struct | ||
| | ||
note: the struct `LoremBuilder` is defined here | ||
--> tests/compile-fail/private_builder.rs:7:41 | ||
| | ||
7 | #[derive(Debug, PartialEq, Default, Builder, Clone)] | ||
| ^^^^^^^ | ||
= note: this error originates in the derive macro `Builder` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0624]: method `build` is private | ||
--> $DIR/private_builder.rs:19:10 | ||
error[E0624]: associated function `build` is private | ||
--> tests/compile-fail/private_builder.rs:19:10 | ||
| | ||
7 | #[derive(Debug, PartialEq, Default, Builder, Clone)] | ||
| ------- private associated function defined here | ||
... | ||
19 | .build() | ||
| ^^^^^ | ||
| ^^^^^ private associated function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
error[E0616]: field `dolor` of struct `inner::LoremBuilder` is private | ||
--> $DIR/private_fields.rs:25:5 | ||
error[E0616]: field `dolor` of struct `LoremBuilder` is private | ||
--> tests/compile-fail/private_fields.rs:25:11 | ||
| | ||
25 | lorem.dolor = Some(0); // <-- private | ||
| ^^^^^^^^^^^ | ||
| ^^^^^ private field |
8 changes: 4 additions & 4 deletions
8
derive_builder/tests/compile-fail/rename_setter_struct_level.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
error: Unknown field: `name` | ||
--> $DIR/rename_setter_struct_level.rs:7:18 | ||
--> tests/compile-fail/rename_setter_struct_level.rs:7:18 | ||
| | ||
7 | #[builder(setter(name = "foo"))] | ||
| ^^^^ | ||
|
||
error[E0433]: failed to resolve: use of undeclared type or module `LoremBuilder` | ||
--> $DIR/rename_setter_struct_level.rs:14:13 | ||
error[E0433]: failed to resolve: use of undeclared type `LoremBuilder` | ||
--> tests/compile-fail/rename_setter_struct_level.rs:14:13 | ||
| | ||
14 | let x = LoremBuilder::default() | ||
| ^^^^^^^^^^^^ use of undeclared type or module `LoremBuilder` | ||
| ^^^^^^^^^^^^ use of undeclared type `LoremBuilder` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters