about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAshley Mannix <kodraus@hey.com>2021-01-18 21:53:40 +1000
committerGitHub <noreply@github.com>2021-01-18 21:53:40 +1000
commitd3cc598a026deca592d3d2c99f93ad0406b88543 (patch)
tree0357c2c37484da69950820b05f25fd43b5891423
parent8f1716c1f9d985cdc647a1f64ab6783bba253b22 (diff)
parent34debb640bd96a4c929ba5f81291c880b8a629e3 (diff)
downloadrust-d3cc598a026deca592d3d2c99f93ad0406b88543.tar.gz
rust-d3cc598a026deca592d3d2c99f93ad0406b88543.zip
Rollup merge of #81131 - pierwill:edit-rustc_middle-cast, r=varkor
Edit rustc_middle::ty::cast docs

Link to RFC 401 and add missing punctuation.
-rw-r--r--compiler/rustc_middle/src/ty/cast.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/ty/cast.rs b/compiler/rustc_middle/src/ty/cast.rs
index b47d9c50e1d..d737d1ebf56 100644
--- a/compiler/rustc_middle/src/ty/cast.rs
+++ b/compiler/rustc_middle/src/ty/cast.rs
@@ -22,15 +22,16 @@ pub enum CastTy<'tcx> {
     /// Various types that are represented as ints and handled mostly
     /// in the same way, merged for easier matching.
     Int(IntTy),
-    /// Floating-Point types
+    /// Floating-point types.
     Float,
-    /// Function Pointers
+    /// Function pointers.
     FnPtr,
-    /// Raw pointers
+    /// Raw pointers.
     Ptr(ty::TypeAndMut<'tcx>),
 }
 
-/// Cast Kind. See RFC 401 (or librustc_typeck/check/cast.rs)
+/// Cast Kind. See [RFC 401](https://rust-lang.github.io/rfcs/0401-coercions.html)
+/// (or librustc_typeck/check/cast.rs).
 #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)]
 pub enum CastKind {
     CoercionCast,
@@ -48,7 +49,7 @@ pub enum CastKind {
 
 impl<'tcx> CastTy<'tcx> {
     /// Returns `Some` for integral/pointer casts.
-    /// casts like unsizing casts will return `None`
+    /// Casts like unsizing casts will return `None`.
     pub fn from_ty(t: Ty<'tcx>) -> Option<CastTy<'tcx>> {
         match *t.kind() {
             ty::Bool => Some(CastTy::Int(IntTy::Bool)),