about summary refs log tree commit diff
path: root/src/test/ui/const-generics/generic_const_exprs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-11-24 17:20:52 -0600
committerAaron Hill <aa1ronham@gmail.com>2021-11-25 15:33:37 -0600
commita7cc6bc4d0eba9e9c59cd74faa03955f35fbde35 (patch)
treedaa87ed35555a4c8858b0e036917623cb034472f /src/test/ui/const-generics/generic_const_exprs
parent982c552c908d179eaa38b6ef152ad3fa30268778 (diff)
downloadrust-a7cc6bc4d0eba9e9c59cd74faa03955f35fbde35.tar.gz
rust-a7cc6bc4d0eba9e9c59cd74faa03955f35fbde35.zip
Visit `param_env` field in Obligation's `TypeFoldable` impl
This oversight appears to have gone unnoticed for a long time
without causing issues, but it should still be fixed.
Diffstat (limited to 'src/test/ui/const-generics/generic_const_exprs')
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr22
-rw-r--r--src/test/ui/const-generics/generic_const_exprs/issue-72787.rs1
2 files changed, 16 insertions, 7 deletions
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
index 02dce4f7a97..3a709578933 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.min.stderr
@@ -1,5 +1,5 @@
 error: generic parameters may not be used in const operations
-  --> $DIR/issue-72787.rs:11:17
+  --> $DIR/issue-72787.rs:12:17
    |
 LL |     Condition<{ LHS <= RHS }>: True
    |                 ^^^ cannot perform const operation using `LHS`
@@ -8,7 +8,7 @@ LL |     Condition<{ LHS <= RHS }>: True
    = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
-  --> $DIR/issue-72787.rs:11:24
+  --> $DIR/issue-72787.rs:12:24
    |
 LL |     Condition<{ LHS <= RHS }>: True
    |                        ^^^ cannot perform const operation using `RHS`
@@ -17,7 +17,7 @@ LL |     Condition<{ LHS <= RHS }>: True
    = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
-  --> $DIR/issue-72787.rs:25:25
+  --> $DIR/issue-72787.rs:26:25
    |
 LL |     IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
    |                         ^ cannot perform const operation using `I`
@@ -26,7 +26,7 @@ LL |     IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
    = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error: generic parameters may not be used in const operations
-  --> $DIR/issue-72787.rs:25:36
+  --> $DIR/issue-72787.rs:26:36
    |
 LL |     IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
    |                                    ^ cannot perform const operation using `J`
@@ -35,7 +35,15 @@ LL |     IsLessOrEqual<{ 8 - I }, { 8 - J }>: True,
    = help: use `#![feature(generic_const_exprs)]` to allow generic const expressions
 
 error[E0283]: type annotations needed
-  --> $DIR/issue-72787.rs:21:26
+  --> $DIR/issue-72787.rs:10:38
+   |
+LL | impl<const LHS: u32, const RHS: u32> True for IsLessOrEqual<LHS, RHS> where
+   |                                      ^^^^ cannot infer type for struct `IsLessOrEqual<LHS, RHS>`
+   |
+   = note: cannot satisfy `IsLessOrEqual<LHS, RHS>: True`
+
+error[E0283]: type annotations needed
+  --> $DIR/issue-72787.rs:22:26
    |
 LL |     IsLessOrEqual<I, 8>: True,
    |                          ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
@@ -43,13 +51,13 @@ LL |     IsLessOrEqual<I, 8>: True,
    = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
 
 error[E0283]: type annotations needed
-  --> $DIR/issue-72787.rs:21:26
+  --> $DIR/issue-72787.rs:22:26
    |
 LL |     IsLessOrEqual<I, 8>: True,
    |                          ^^^^ cannot infer type for struct `IsLessOrEqual<I, 8_u32>`
    |
    = note: cannot satisfy `IsLessOrEqual<I, 8_u32>: True`
 
-error: aborting due to 6 previous errors
+error: aborting due to 7 previous errors
 
 For more information about this error, try `rustc --explain E0283`.
diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs
index 77ad57f0640..2ea5d634f6e 100644
--- a/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs
+++ b/src/test/ui/const-generics/generic_const_exprs/issue-72787.rs
@@ -8,6 +8,7 @@ pub struct Condition<const CONDITION: bool>;
 pub trait True {}
 
 impl<const LHS: u32, const RHS: u32> True for IsLessOrEqual<LHS, RHS> where
+//[min]~^ ERROR type annotations needed
     Condition<{ LHS <= RHS }>: True
 //[min]~^ Error generic parameters may not be used in const operations
 //[min]~| Error generic parameters may not be used in const operations