You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Rust does not generally allow calling methods on values which do not have a known type,
5559
+
/// such a result of a never-to-any coercion with no type specified.
5560
+
///
5561
+
/// To aid with transition of code calling methods on `Infallible` after changing `Infallible` to be an alias for `!`, rustc *temporarily* allows such calls.
5562
+
/// This will (once again) become an error in the future.
5563
+
///
5564
+
/// Thanks to never-to-any coercion you can replace method calls on `!` with the use of the `!` variable, or an `as` cast to an explicit type:
5565
+
///
5566
+
/// ```diff
5567
+
/// - x.clone()
5568
+
/// + x
5569
+
/// ```
5570
+
/// ```diff
5571
+
/// - result.map(|x| x.convert_error())?;
5572
+
/// + result.map(|x| x as ErrorType)?;
5573
+
/// ```
5574
+
pubMETHOD_CALL_ON_DIVERGING_INFER_VAR,
5575
+
Warn,
5576
+
"detects method calls on a result of never-to-any coercion",
error[E0277]: a value of type `std::result::Result<Vec<Version>, AnotherError>` cannot be built from an iterator over elements of type `std::result::Result<Version, Error>`
| ------- ^^^^^^^^^^^^^^^^^^^^ value of type `std::result::Result<Vec<Version>, AnotherError>` cannot be built from `std::iter::Iterator<Item=std::result::Result<Version, Error>>`
@@ -47,7 +66,7 @@ help: the trait `FromIterator<Result<_, Error>>` is not implemented for `std::re
47
66
--> $SRC_DIR/core/src/result.rs:LL:COL
48
67
= help: for that trait implementation, expected `AnotherError`, found `Error`
49
68
note: the method call chain might not have had the expected associated types
0 commit comments