diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-18 08:16:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-18 08:16:29 +0100 |
| commit | fcc59794a73f3181e196f65e6f7bba536edd09b0 (patch) | |
| tree | 22f16d9263ecedadf0f446e1d175e071f64fc561 /src | |
| parent | 64ce698f7476116892973a38e5c7a0bcecfe472e (diff) | |
| parent | f141bedd90233dad9906034562062f89158fecef (diff) | |
| download | rust-fcc59794a73f3181e196f65e6f7bba536edd09b0.tar.gz rust-fcc59794a73f3181e196f65e6f7bba536edd09b0.zip | |
Rollup merge of #91928 - fee1-dead:constification1, r=oli-obk
Constify (most) `Option` methods r? ``@oli-obk``
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/ui/closures/closure-expected.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/closures/coerce-unsafe-to-closure.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/expr/malformed_closure/ruby_style_closure.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-47706-trait.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-47706.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/suggestions/as-ref-2.stderr | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/src/test/ui/closures/closure-expected.stderr b/src/test/ui/closures/closure-expected.stderr index 8b38d5ff459..7ffe3c1ef95 100644 --- a/src/test/ui/closures/closure-expected.stderr +++ b/src/test/ui/closures/closure-expected.stderr @@ -11,8 +11,8 @@ LL | let y = x.or_else(4); note: required by a bound in `Option::<T>::or_else` --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub fn or_else<F: FnOnce() -> Option<T>>(self, f: F) -> Option<T> { - | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::or_else` +LL | F: ~const FnOnce() -> Option<T>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::or_else` error: aborting due to previous error diff --git a/src/test/ui/closures/coerce-unsafe-to-closure.stderr b/src/test/ui/closures/coerce-unsafe-to-closure.stderr index 24db2725347..883348eb98c 100644 --- a/src/test/ui/closures/coerce-unsafe-to-closure.stderr +++ b/src/test/ui/closures/coerce-unsafe-to-closure.stderr @@ -10,8 +10,8 @@ LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); note: required by a bound in `Option::<T>::map` --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { - | ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` +LL | F: ~const FnOnce(T) -> U, + | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` error: aborting due to previous error diff --git a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr index 53924e24e46..9db9cfc7ff0 100644 --- a/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr +++ b/src/test/ui/expr/malformed_closure/ruby_style_closure.stderr @@ -23,8 +23,8 @@ LL | | }); note: required by a bound in `Option::<T>::and_then` --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub fn and_then<U, F: FnOnce(T) -> Option<U>>(self, f: F) -> Option<U> { - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::and_then` +LL | F: ~const FnOnce(T) -> Option<U>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::and_then` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47706-trait.stderr b/src/test/ui/issues/issue-47706-trait.stderr index eb0c80f8f0d..d596b4a69f3 100644 --- a/src/test/ui/issues/issue-47706-trait.stderr +++ b/src/test/ui/issues/issue-47706-trait.stderr @@ -11,8 +11,8 @@ LL | None::<()>.map(Self::f); note: required by a bound in `Option::<T>::map` --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { - | ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` +LL | F: ~const FnOnce(T) -> U, + | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-47706.stderr b/src/test/ui/issues/issue-47706.stderr index 237b2b9e798..0b4f84a330a 100644 --- a/src/test/ui/issues/issue-47706.stderr +++ b/src/test/ui/issues/issue-47706.stderr @@ -12,8 +12,8 @@ LL | self.foo.map(Foo::new) note: required by a bound in `Option::<T>::map` --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { - | ^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` +LL | F: ~const FnOnce(T) -> U, + | ^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Option::<T>::map` error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/issue-47706.rs:27:9 diff --git a/src/test/ui/suggestions/as-ref-2.stderr b/src/test/ui/suggestions/as-ref-2.stderr index 86a175098c6..3c9d0f72abe 100644 --- a/src/test/ui/suggestions/as-ref-2.stderr +++ b/src/test/ui/suggestions/as-ref-2.stderr @@ -11,8 +11,8 @@ LL | let _y = foo; note: this function takes ownership of the receiver `self`, which moves `foo` --> $SRC_DIR/core/src/option.rs:LL:COL | -LL | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> { - | ^^^^ +LL | pub const fn map<U, F>(self, f: F) -> Option<U> + | ^^^^ help: consider calling `.as_ref()` to borrow the type's contents | LL | let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s)); |
