Skip to content

Commit

Permalink
Corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Apr 19, 2024
1 parent b5ec057 commit c2b682d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ required-features = ["try_unwrap"]
[[test]]
name = "compile_fail"
path = "tests/compile_fail/mod.rs"
required-features = ["as_ref", "debug", "display", "from", "into", "try_from", "is_variant"]
required-features = ["as_ref", "debug", "display", "from", "into", "is_variant", "try_from"]

[[test]]
name = "no_std"
Expand Down
4 changes: 2 additions & 2 deletions impl/doc/is_variant.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ assert!(!Maybe::<()>::Nothing.is_just());

### What is generated?

The derive in the above example code generates the following code:
The derive in the above example generates code like this:
```rust
# enum Maybe<T> {
# Just(T),
# Nothing
# }
impl <T> Maybe<T>{
impl<T> Maybe<T>{
#[must_use]
pub const fn is_just(&self) -> bool {
matches!(self, Self::Just(..))
Expand Down
3 changes: 0 additions & 3 deletions tests/compile_fail/as_mut/renamed_generic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ error[E0599]: the method `as_mut` exists for struct `Baz<i32>`, but its trait bo
= note: trait bound `Foo<i32>: AsMut<Foo<i32>>` was not satisfied
note: the trait `AsMut` must be implemented
--> $RUST/core/src/convert/mod.rs
|
| pub trait AsMut<T: ?Sized> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `as_mut`, perhaps you need to implement it:
candidate #1: `AsMut`
3 changes: 0 additions & 3 deletions tests/compile_fail/as_ref/renamed_generic.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ error[E0599]: the method `as_ref` exists for struct `Baz<i32>`, but its trait bo
= note: trait bound `Foo<i32>: AsRef<Foo<i32>>` was not satisfied
note: the trait `AsRef` must be implemented
--> $RUST/core/src/convert/mod.rs
|
| pub trait AsRef<T: ?Sized> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `as_ref`, perhaps you need to implement it:
candidate #1: `AsRef`

0 comments on commit c2b682d

Please sign in to comment.