about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBen Lewis <benlewisj@gmail.com>2020-01-11 20:57:38 +1300
committerBen Lewis <benlewisj@gmail.com>2020-01-14 07:47:45 +1300
commit02fffc1556e01c64d84d07d0a3ab059a9c7505f8 (patch)
tree06b7e43f4b24b98b9a0c69e257b8603ede63bd56
parenta6c4025fac3c3a60581af72998230d46aa6f5ade (diff)
downloadrust-02fffc1556e01c64d84d07d0a3ab059a9c7505f8.tar.gz
rust-02fffc1556e01c64d84d07d0a3ab059a9c7505f8.zip
Code review changes and fix rustdoc test.
-rw-r--r--src/librustc/mir/interpret/mod.rs10
-rw-r--r--src/librustc_mir_build/hair/pattern/mod.rs5
-rw-r--r--src/librustc_typeck/astconv.rs4
-rw-r--r--src/libsyntax/ast.rs39
-rw-r--r--src/test/rustdoc/const-generics/add-impl.rs2
5 files changed, 16 insertions, 44 deletions
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs
index 21cc54a6e6b..47f067590b9 100644
--- a/src/librustc/mir/interpret/mod.rs
+++ b/src/librustc/mir/interpret/mod.rs
@@ -148,18 +148,18 @@ pub struct GlobalId<'tcx> {
     pub promoted: Option<mir::Promoted>,
 }
 
-/// Input argument for `tcx.lit_to_const`
+/// Input argument for `tcx.lit_to_const`.
 #[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, HashStable)]
 pub struct LitToConstInput<'tcx> {
-    /// The absolute value of the resultant constant
+    /// The absolute value of the resultant constant.
     pub lit: &'tcx LitKind,
-    /// The type of the constant
+    /// The type of the constant.
     pub ty: Ty<'tcx>,
-    /// If the constant is negative
+    /// If the constant is negative.
     pub neg: bool,
 }
 
-/// Error type for `tcx.lit_to_const`
+/// Error type for `tcx.lit_to_const`.
 #[derive(Copy, Clone, Debug, Eq, PartialEq, HashStable)]
 pub enum LitToConstError {
     UnparseableFloat,
diff --git a/src/librustc_mir_build/hair/pattern/mod.rs b/src/librustc_mir_build/hair/pattern/mod.rs
index 8645abe5c1a..205e25f7f8f 100644
--- a/src/librustc_mir_build/hair/pattern/mod.rs
+++ b/src/librustc_mir_build/hair/pattern/mod.rs
@@ -8,9 +8,8 @@ pub(crate) use self::check_match::check_match;
 
 use crate::hair::util::UserAnnotatedTyHelpers;
 
-use rustc::mir::interpret::{
-    get_slice_bytes, sign_extend, ConstValue, ErrorHandled, LitToConstError, LitToConstInput,
-};
+use rustc::mir::interpret::{get_slice_bytes, sign_extend, ConstValue, ErrorHandled};
+use rustc::mir::interpret::{LitToConstError, LitToConstInput};
 use rustc::mir::UserTypeProjection;
 use rustc::mir::{BorrowKind, Field, Mutability};
 use rustc::ty::layout::VariantIdx;
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs
index 920ffaa4c3a..a3be264ddc1 100644
--- a/src/librustc_typeck/astconv.rs
+++ b/src/librustc_typeck/astconv.rs
@@ -1,4 +1,4 @@
-// ignore-tidy-filelength FIXME(#67418) Split up this file
+// ignore-tidy-filelength FIXME(#67418) Split up this file.
 //! Conversion from AST representation of types to the `ty.rs` representation.
 //! The main routine here is `ast_ty_to_ty()`; each use is parameterized by an
 //! instance of `AstConv`.
@@ -2716,7 +2716,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
 
         if let Some(lit_input) = lit_input {
             // If an error occurred, ignore that it's a literal and leave reporting the error up to
-            // mir
+            // mir.
             if let Ok(c) = tcx.at(expr.span).lit_to_const(lit_input) {
                 return c;
             }
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index ace12a7ffd2..331eb109ec0 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -1441,17 +1441,8 @@ pub struct MacroDef {
     pub legacy: bool,
 }
 
-#[derive(
-    Clone,
-    RustcEncodable,
-    RustcDecodable,
-    Debug,
-    Copy,
-    Hash,
-    Eq,
-    PartialEq,
-    HashStable_Generic
-)]
+#[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, Hash, Eq, PartialEq)]
+#[derive(HashStable_Generic)]
 pub enum StrStyle {
     /// A regular string, like `"foo"`.
     Cooked,
@@ -1501,17 +1492,8 @@ impl StrLit {
 }
 
 /// Type of the integer literal based on provided suffix.
-#[derive(
-    Clone,
-    Copy,
-    RustcEncodable,
-    RustcDecodable,
-    Debug,
-    Hash,
-    Eq,
-    PartialEq,
-    HashStable_Generic
-)]
+#[derive(Clone, Copy, RustcEncodable, RustcDecodable, Debug, Hash, Eq, PartialEq)]
+#[derive(HashStable_Generic)]
 pub enum LitIntType {
     /// e.g. `42_i32`.
     Signed(IntTy),
@@ -1522,17 +1504,8 @@ pub enum LitIntType {
 }
 
 /// Type of the float literal based on provided suffix.
-#[derive(
-    Clone,
-    Copy,
-    RustcEncodable,
-    RustcDecodable,
-    Debug,
-    Hash,
-    Eq,
-    PartialEq,
-    HashStable_Generic
-)]
+#[derive(Clone, Copy, RustcEncodable, RustcDecodable, Debug, Hash, Eq, PartialEq)]
+#[derive(HashStable_Generic)]
 pub enum LitFloatType {
     /// A float literal with a suffix (`1f32` or `1E10f32`).
     Suffixed(FloatTy),
diff --git a/src/test/rustdoc/const-generics/add-impl.rs b/src/test/rustdoc/const-generics/add-impl.rs
index ed45d339728..54bdd768f8a 100644
--- a/src/test/rustdoc/const-generics/add-impl.rs
+++ b/src/test/rustdoc/const-generics/add-impl.rs
@@ -11,7 +11,7 @@ pub struct Simd<T, const WIDTH: usize> {
     inner: T,
 }
 
-// @has foo/struct.Simd.html '//div[@id="implementations-list"]/h3/code' 'impl Add<Simd<u8, 16>> for Simd<u8, 16>'
+// @has foo/struct.Simd.html '//div[@id="implementations-list"]/h3/code' 'impl Add<Simd<u8, 16usize>> for Simd<u8, 16>'
 impl Add for Simd<u8, 16> {
     type Output = Self;