about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGabriel Smith <gsmith@d3engineering.com>2019-11-18 14:57:23 -0500
committerGabriel Smith <gsmith@d3engineering.com>2019-11-18 17:23:22 -0500
commiteaf8fd056942cd8da2d5d5c844bba145b95f6d1a (patch)
tree6105989dbc14bf39472bbbd687691560c0212ee9 /src
parentfb6cfde5bad603193d1ae42786a725bd5dc01a40 (diff)
downloadrust-eaf8fd056942cd8da2d5d5c844bba145b95f6d1a.tar.gz
rust-eaf8fd056942cd8da2d5d5c844bba145b95f6d1a.zip
test: const-generics: Update tests removing unrequired braces
Braces were left in cases where generic args were in the generic const
paths.
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/const-generics/const-generic-array-wrapper.rs6
-rw-r--r--src/test/ui/const-generics/fn-const-param-call.rs4
-rw-r--r--src/test/ui/const-generics/fn-const-param-infer.rs10
-rw-r--r--src/test/ui/const-generics/fn-const-param-infer.stderr12
-rw-r--r--src/test/ui/const-generics/impl-const-generic-struct.rs2
-rw-r--r--src/test/ui/const-generics/raw-ptr-const-param-deref.rs2
-rw-r--r--src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs2
7 files changed, 19 insertions, 19 deletions
diff --git a/src/test/ui/const-generics/const-generic-array-wrapper.rs b/src/test/ui/const-generics/const-generic-array-wrapper.rs
index adffe32d67a..56a58c582f6 100644
--- a/src/test/ui/const-generics/const-generic-array-wrapper.rs
+++ b/src/test/ui/const-generics/const-generic-array-wrapper.rs
@@ -3,11 +3,11 @@
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
 
-struct Foo<T, const N: usize>([T; {N}]);
+struct Foo<T, const N: usize>([T; N]);
 
-impl<T, const N: usize> Foo<T, {N}> {
+impl<T, const N: usize> Foo<T, N> {
     fn foo(&self) -> usize {
-        {N}
+        N
     }
 }
 
diff --git a/src/test/ui/const-generics/fn-const-param-call.rs b/src/test/ui/const-generics/fn-const-param-call.rs
index 84615386d29..cd4b19db353 100644
--- a/src/test/ui/const-generics/fn-const-param-call.rs
+++ b/src/test/ui/const-generics/fn-const-param-call.rs
@@ -9,12 +9,12 @@ fn function() -> u32 {
 
 struct Wrapper<const F: fn() -> u32>;
 
-impl<const F: fn() -> u32> Wrapper<{F}> {
+impl<const F: fn() -> u32> Wrapper<F> {
     fn call() -> u32 {
         F()
     }
 }
 
 fn main() {
-    assert_eq!(Wrapper::<{function}>::call(), 17);
+    assert_eq!(Wrapper::<function>::call(), 17);
 }
diff --git a/src/test/ui/const-generics/fn-const-param-infer.rs b/src/test/ui/const-generics/fn-const-param-infer.rs
index 78fb10e8cb9..dc69fa9eea5 100644
--- a/src/test/ui/const-generics/fn-const-param-infer.rs
+++ b/src/test/ui/const-generics/fn-const-param-infer.rs
@@ -11,15 +11,15 @@ fn generic_arg<T>(val: T) -> bool { true }
 fn generic<T>(val: usize) -> bool { val != 1 }
 
 fn main() {
-    let _: Option<Checked<{not_one}>> = None;
-    let _: Checked<{not_one}> = Checked::<{not_one}>;
-    let _: Checked<{not_one}> = Checked::<{not_two}>; //~ mismatched types
+    let _: Option<Checked<not_one>> = None;
+    let _: Checked<not_one> = Checked::<not_one>;
+    let _: Checked<not_one> = Checked::<not_two>; //~ mismatched types
 
-    let _ = Checked::<{generic_arg}>;
+    let _ = Checked::<generic_arg>;
     let _ = Checked::<{generic_arg::<usize>}>;
     let _ = Checked::<{generic_arg::<u32>}>;  //~ mismatched types
 
-    let _ = Checked::<{generic}>; //~ type annotations needed
+    let _ = Checked::<generic>; //~ type annotations needed
     let _ = Checked::<{generic::<u16>}>;
     let _: Checked<{generic::<u16>}> = Checked::<{generic::<u16>}>;
     let _: Checked<{generic::<u32>}> = Checked::<{generic::<u16>}>; //~ mismatched types
diff --git a/src/test/ui/const-generics/fn-const-param-infer.stderr b/src/test/ui/const-generics/fn-const-param-infer.stderr
index de0916b26bf..e36bb824151 100644
--- a/src/test/ui/const-generics/fn-const-param-infer.stderr
+++ b/src/test/ui/const-generics/fn-const-param-infer.stderr
@@ -7,10 +7,10 @@ LL | #![feature(const_generics, const_compare_raw_pointers)]
    = note: `#[warn(incomplete_features)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/fn-const-param-infer.rs:16:33
+  --> $DIR/fn-const-param-infer.rs:16:31
    |
-LL |     let _: Checked<{not_one}> = Checked::<{not_two}>;
-   |                                 ^^^^^^^^^^^^^^^^^^^^ expected `not_one`, found `not_two`
+LL |     let _: Checked<not_one> = Checked::<not_two>;
+   |                               ^^^^^^^^^^^^^^^^^^ expected `not_one`, found `not_two`
    |
    = note: expected type `Checked<not_one>`
               found type `Checked<not_two>`
@@ -25,10 +25,10 @@ LL |     let _ = Checked::<{generic_arg::<u32>}>;
               found type `fn(u32) -> bool {generic_arg::<u32>}`
 
 error[E0282]: type annotations needed
-  --> $DIR/fn-const-param-infer.rs:22:24
+  --> $DIR/fn-const-param-infer.rs:22:23
    |
-LL |     let _ = Checked::<{generic}>;
-   |                        ^^^^^^^ cannot infer type for `T`
+LL |     let _ = Checked::<generic>;
+   |                       ^^^^^^^ cannot infer type for `T`
 
 error[E0308]: mismatched types
   --> $DIR/fn-const-param-infer.rs:25:40
diff --git a/src/test/ui/const-generics/impl-const-generic-struct.rs b/src/test/ui/const-generics/impl-const-generic-struct.rs
index 7a0c0f2be5d..87572e51e81 100644
--- a/src/test/ui/const-generics/impl-const-generic-struct.rs
+++ b/src/test/ui/const-generics/impl-const-generic-struct.rs
@@ -5,7 +5,7 @@
 
 struct S<const X: u32>;
 
-impl<const X: u32> S<{X}> {
+impl<const X: u32> S<X> {
     fn x() -> u32 {
         X
     }
diff --git a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs b/src/test/ui/const-generics/raw-ptr-const-param-deref.rs
index d26ab8be4c3..745dde3c287 100644
--- a/src/test/ui/const-generics/raw-ptr-const-param-deref.rs
+++ b/src/test/ui/const-generics/raw-ptr-const-param-deref.rs
@@ -6,7 +6,7 @@ const A: u32 = 3;
 
 struct Const<const P: *const u32>;
 
-impl<const P: *const u32> Const<{P}> {
+impl<const P: *const u32> Const<P> {
     fn get() -> u32 {
         unsafe {
             *P
diff --git a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
index 1e064fbd970..7942631bb70 100644
--- a/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
+++ b/src/test/ui/const-generics/uninferred-consts-during-codegen-1.rs
@@ -7,7 +7,7 @@ use std::fmt;
 
 struct Array<T, const N: usize>([T; N]);
 
-impl<T: fmt::Debug, const N: usize> fmt::Debug for Array<T, {N}> {
+impl<T: fmt::Debug, const N: usize> fmt::Debug for Array<T, N> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         f.debug_list().entries(self.0.iter()).finish()
     }