Skip to content

Commit

Permalink
Update some UI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 29, 2022
1 parent 7d76dc9 commit 9e7f02b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/test/ui/impl-trait/trait_type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fm
LL | fn fmt(&self) -> () { }
| ^^^^^ expected 2 parameters, found 1
|
= note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
= note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> std::fmt::Result`

error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
--> $DIR/trait_type.rs:17:4
|
LL | fn fmt() -> () { }
| ^^^^^^^^^^^^^^ expected `&self` in impl
|
= note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> Result<(), std::fmt::Error>`
= note: `fmt` from trait: `fn(&Self, &mut Formatter<'_>) -> std::fmt::Result`

error[E0046]: not all trait items implemented, missing: `fmt`
--> $DIR/trait_type.rs:21:1
|
LL | impl std::fmt::Display for MyType4 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
|
= help: implement the missing item: `fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { todo!() }`
= help: implement the missing item: `fn fmt(&self, _: &mut Formatter<'_>) -> std::fmt::Result { todo!() }`

error: aborting due to 4 previous errors

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/nll/type-alias-free-regions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error: lifetime may not live long enough
LL | impl<'a> FromBox<'a> for C<'a> {
| -- lifetime `'a` defined here
LL | fn from_box(b: Box<B>) -> Self {
| - has type `Box<Box<&'1 isize>>`
| - has type `Box<B<'1>>`
LL | C { f: b }
| ^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`

Expand All @@ -14,7 +14,7 @@ error: lifetime may not live long enough
LL | impl<'a> FromTuple<'a> for C<'a> {
| -- lifetime `'a` defined here
LL | fn from_tuple(b: (B,)) -> Self {
| - has type `(Box<&'1 isize>,)`
| - has type `(B<'1>,)`
LL | C { f: Box::new(b.0) }
| ^^^^^^^^^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/privacy/private-in-public-warn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ mod aliases_priv {
//~^ ERROR private trait `PrivTr1` in public interface
//~| WARNING hard error
pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
//~^ ERROR private trait `PrivTr1<Priv2>` in public interface
//~^ ERROR private trait `PrivTr1<aliases_priv::PrivAlias>` in public interface
//~| WARNING hard error
//~| ERROR private type `Priv2` in public interface
//~| WARNING hard error
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/privacy/private-in-public-warn.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ LL | pub trait Tr1: PrivUseAliasTr {}
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537>

error: private trait `PrivTr1<Priv2>` in public interface (error E0445)
error: private trait `PrivTr1<aliases_priv::PrivAlias>` in public interface (error E0445)
--> $DIR/private-in-public-warn.rs:249:5
|
LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {}
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/regions/regions-infer-paramd-indirect.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ LL | impl<'a> SetF<'a> for C<'a> {
| -- lifetime `'a` defined here
...
LL | fn set_f_bad(&mut self, b: Box<B>) {
| - has type `Box<Box<&'1 isize>>`
| - has type `Box<B<'1>>`
LL | self.f = b;
| ^^^^^^ assignment requires that `'1` must outlive `'a`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ error: lifetime may not live long enough
--> $DIR/arbitrary_self_types_pin_lifetime_mismatch.rs:15:58
|
LL | fn bar<'a>(self: Alias<&Self>, arg: &'a ()) -> &() { arg }
| -- ---- has type `Pin<&'1 Foo>` ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| -- ---- has type `Alias<&'1 Foo>` ^^^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
| |
| lifetime `'a` defined here

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/span/impl-wrong-item-for-trait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ error[E0046]: not all trait items implemented, missing: `fmt`
LL | impl Debug for FooTypeForMethod {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
|
= help: implement the missing item: `fn fmt(&self, _: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { todo!() }`
= help: implement the missing item: `fn fmt(&self, _: &mut Formatter<'_>) -> std::fmt::Result { todo!() }`

error: aborting due to 7 previous errors

Expand Down

0 comments on commit 9e7f02b

Please sign in to comment.