diff options
Diffstat (limited to 'crates/hir_ty/src/infer/coerce.rs')
-rw-r--r-- | crates/hir_ty/src/infer/coerce.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/coerce.rs b/crates/hir_ty/src/infer/coerce.rs index 03b97e7db..4b7f31521 100644 --- a/crates/hir_ty/src/infer/coerce.rs +++ b/crates/hir_ty/src/infer/coerce.rs | |||
@@ -2,8 +2,8 @@ | |||
2 | //! happen in certain places, e.g. weakening `&mut` to `&` or deref coercions | 2 | //! happen in certain places, e.g. weakening `&mut` to `&` or deref coercions |
3 | //! like going from `&Vec<T>` to `&[T]`. | 3 | //! like going from `&Vec<T>` to `&[T]`. |
4 | //! | 4 | //! |
5 | //! See https://doc.rust-lang.org/nomicon/coercions.html and | 5 | //! See <https://doc.rust-lang.org/nomicon/coercions.html> and |
6 | //! librustc_typeck/check/coercion.rs. | 6 | //! `librustc_typeck/check/coercion.rs`. |
7 | 7 | ||
8 | use chalk_ir::{cast::Cast, Mutability, TyVariableKind}; | 8 | use chalk_ir::{cast::Cast, Mutability, TyVariableKind}; |
9 | use hir_def::{expr::ExprId, lang_item::LangItemTarget}; | 9 | use hir_def::{expr::ExprId, lang_item::LangItemTarget}; |
@@ -109,7 +109,7 @@ impl<'a> InferenceContext<'a> { | |||
109 | } | 109 | } |
110 | 110 | ||
111 | // Consider coercing the subtype to a DST | 111 | // Consider coercing the subtype to a DST |
112 | if let Ok(ret) = self.try_coerce_unsized(&from_ty, &to_ty) { | 112 | if let Ok(ret) = self.try_coerce_unsized(&from_ty, to_ty) { |
113 | return Ok(ret); | 113 | return Ok(ret); |
114 | } | 114 | } |
115 | 115 | ||
@@ -331,7 +331,7 @@ impl<'a> InferenceContext<'a> { | |||
331 | 331 | ||
332 | /// Coerce a type using `from_ty: CoerceUnsized<ty_ty>` | 332 | /// Coerce a type using `from_ty: CoerceUnsized<ty_ty>` |
333 | /// | 333 | /// |
334 | /// See: https://doc.rust-lang.org/nightly/std/marker/trait.CoerceUnsized.html | 334 | /// See: <https://doc.rust-lang.org/nightly/std/marker/trait.CoerceUnsized.html> |
335 | fn try_coerce_unsized(&mut self, from_ty: &Ty, to_ty: &Ty) -> InferResult { | 335 | fn try_coerce_unsized(&mut self, from_ty: &Ty, to_ty: &Ty) -> InferResult { |
336 | // These 'if' statements require some explanation. | 336 | // These 'if' statements require some explanation. |
337 | // The `CoerceUnsized` trait is special - it is only | 337 | // The `CoerceUnsized` trait is special - it is only |