diff options
| author | Michael Goulet <michael@errs.io> | 2022-08-06 00:17:16 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-08-14 20:23:52 +0000 |
| commit | 84ba2289fdd3c41ebbef53de3fdb5035f2e73e60 (patch) | |
| tree | dad04ef206f6cfe16012ddf5a1eba369ff30108e /src | |
| parent | 801821d1560f84e4716fcbd9244ec959320a13d5 (diff) | |
| download | rust-84ba2289fdd3c41ebbef53de3fdb5035f2e73e60.tar.gz rust-84ba2289fdd3c41ebbef53de3fdb5035f2e73e60.zip | |
Suggest as_ref or as_mut
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/suggestions/as-ref-2.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/suggestions/option-content-move.stderr | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr index af26169c806..17546f73836 100644 --- a/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr +++ b/src/test/ui/borrowck/suggest-as-ref-on-mut-closure.stderr @@ -12,7 +12,7 @@ note: this function takes ownership of the receiver `self`, which moves `*cb` | LL | pub const fn map<U, F>(self, f: F) -> Option<U> | ^^^^ -help: consider calling `.as_ref()` to borrow the type's contents +help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | LL | cb.as_ref().map(|cb| cb()); | +++++++++ diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/src/test/ui/suggestions/as-ref-2.stderr index 3c9d0f72abe..08b9fb1abd7 100644 --- a/src/test/ui/suggestions/as-ref-2.stderr +++ b/src/test/ui/suggestions/as-ref-2.stderr @@ -13,7 +13,7 @@ note: this function takes ownership of the receiver `self`, which moves `foo` | LL | pub const fn map<U, F>(self, f: F) -> Option<U> | ^^^^ -help: consider calling `.as_ref()` to borrow the type's contents +help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | LL | let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s)); | +++++++++ diff --git a/src/test/ui/suggestions/option-content-move.stderr b/src/test/ui/suggestions/option-content-move.stderr index fccfbe1d744..d008971e438 100644 --- a/src/test/ui/suggestions/option-content-move.stderr +++ b/src/test/ui/suggestions/option-content-move.stderr @@ -11,7 +11,7 @@ note: this function takes ownership of the receiver `self`, which moves `selecti | LL | pub const fn unwrap(self) -> T { | ^^^^ -help: consider calling `.as_ref()` to borrow the type's contents +help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | LL | if selection.1.as_ref().unwrap().contains(selection.0) { | +++++++++ @@ -29,7 +29,7 @@ note: this function takes ownership of the receiver `self`, which moves `selecti | LL | pub fn unwrap(self) -> T | ^^^^ -help: consider calling `.as_ref()` to borrow the type's contents +help: consider calling `.as_ref()` or `.as_mut()` to borrow the type's contents | LL | if selection.1.as_ref().unwrap().contains(selection.0) { | +++++++++ |
