diff options
| author | Veera <sveera.2001@gmail.com> | 2024-07-13 12:05:16 -0400 |
|---|---|---|
| committer | Veera <sveera.2001@gmail.com> | 2024-08-19 15:19:43 -0400 |
| commit | 12de141df2d247177e9ca0498ba99bd433cfa500 (patch) | |
| tree | beafd5a9df9e77acbdca7fd67e5ab8ca980db46c /tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs | |
| parent | 102997a9391cb4c4eac6cddf5e8fdf1aa369ea69 (diff) | |
| download | rust-12de141df2d247177e9ca0498ba99bd433cfa500.tar.gz rust-12de141df2d247177e9ca0498ba99bd433cfa500.zip | |
Suggest `impl Trait` for References to Bare Trait in Function Header
Diffstat (limited to 'tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs')
| -rw-r--r-- | tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs b/tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs index dceb6e0fe71..dabaa309c16 100644 --- a/tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs +++ b/tests/ui/object-safety/reference-to-bare-trait-in-fn-inputs-and-outputs-issue-125139.rs @@ -43,7 +43,7 @@ impl IceCream { fn parrot() -> &mut Trait { //~^ ERROR: missing lifetime specifier - //~| ERROR: cannot return a mutable reference to a bare trait + //~| ERROR: trait objects must include the `dyn` keyword &mut Type //~^ ERROR: cannot return reference to temporary value } @@ -86,12 +86,12 @@ trait Sing { fn parrot() -> &mut Trait { //~^ ERROR: missing lifetime specifier - //~| ERROR: cannot return a mutable reference to a bare trait + //~| ERROR: trait objects must include the `dyn` keyword &mut Type //~^ ERROR: cannot return reference to temporary value } } - + fn foo(_: &Trait) {} //~^ ERROR: trait objects must include the `dyn` keyword @@ -134,7 +134,7 @@ fn puppy<'a>() -> &'a Trait { fn parrot() -> &mut Trait { //~^ ERROR: missing lifetime specifier - //~| ERROR: cannot return a mutable reference to a bare trait + //~| ERROR: trait objects must include the `dyn` keyword &mut Type //~^ ERROR: cannot return reference to temporary value } |
