]> git.lizzy.rs Git - rust.git/commitdiff
merge lazy_normalization_consts into const_generics
authorBastian Kauschke <bastian_kauschke@hotmail.de>
Fri, 15 May 2020 14:14:37 +0000 (16:14 +0200)
committerBastian Kauschke <bastian_kauschke@hotmail.de>
Sun, 17 May 2020 09:06:35 +0000 (11:06 +0200)
33 files changed:
src/librustc_feature/active.rs
src/librustc_infer/infer/combine.rs
src/librustc_infer/infer/nll_relate/mod.rs
src/librustc_middle/ty/relate.rs
src/librustc_span/symbol.rs
src/librustc_trait_selection/traits/project.rs
src/librustc_typeck/collect.rs
src/test/ui/const-generics/array-size-in-generic-struct-param.rs
src/test/ui/const-generics/array-size-in-generic-struct-param.stderr
src/test/ui/const-generics/different_byref.stderr
src/test/ui/const-generics/fn-const-param-infer.stderr
src/test/ui/const-generics/issues/issue-61336-1.rs
src/test/ui/const-generics/issues/issue-61336-1.stderr [new file with mode: 0644]
src/test/ui/const-generics/issues/issue-61336-2.rs
src/test/ui/const-generics/issues/issue-61336-2.stderr
src/test/ui/const-generics/issues/issue-61336.stderr
src/test/ui/const-generics/issues/issue-61747.stderr
src/test/ui/const-generics/issues/issue-61935.rs
src/test/ui/const-generics/issues/issue-61935.stderr
src/test/ui/const-generics/issues/issue-62504.rs
src/test/ui/const-generics/issues/issue-62504.stderr
src/test/ui/const-generics/issues/issue-67185-1.rs
src/test/ui/const-generics/issues/issue-67185-1.stderr
src/test/ui/const-generics/issues/issue-67185-2.rs
src/test/ui/const-generics/issues/issue-67185-2.stderr
src/test/ui/const-generics/issues/issue-69654.rs
src/test/ui/const-generics/lazy-normalization/issue-71922.rs
src/test/ui/const-generics/lazy-normalization/issue-71986.rs
src/test/ui/const-generics/lazy-normalization/lazy-normalization-feature-gate.rs [deleted file]
src/test/ui/const-generics/lazy-normalization/lazy-normalization-feature-gate.stderr [deleted file]
src/test/ui/const-generics/raw-ptr-const-param.stderr
src/test/ui/const-generics/types-mismatch-const-args.stderr
src/test/ui/type-alias-impl-trait/generic_nondefining_use.stderr

index 894b392f1c036a8e2d741eb99225bb050c9edce3..a1dd7a5ca5225ea471b66082c22ba6eebb5e9e32 100644 (file)
@@ -559,9 +559,6 @@ pub fn set(&self, features: &mut Features, span: Span) {
     /// Allow negative trait implementations.
     (active, negative_impls, "1.44.0", Some(68318), None),
 
-    /// Lazily evaluate constants. Which allows constants to depend on type parameters.
-    (active, lazy_normalization_consts, "1.44.0", Some(60471), None),
-
     /// Allows the use of `#[target_feature]` on safe functions.
     (active, target_feature_11, "1.45.0", Some(69098), None),
 
@@ -584,5 +581,4 @@ pub fn set(&self, features: &mut Features, span: Span) {
     sym::raw_dylib,
     sym::const_trait_impl,
     sym::const_trait_bound_opt_out,
-    sym::lazy_normalization_consts,
 ];
index 415e3262c50932852e0452ddf4a06164699c2b50..1d3ddd7e2deff8d04c391c7237e394d012ed8095 100644 (file)
@@ -164,15 +164,11 @@ pub fn super_combine_consts<R>(
             (_, ty::ConstKind::Infer(InferConst::Var(vid))) => {
                 return self.unify_const_variable(!a_is_expected, vid, a);
             }
-            (ty::ConstKind::Unevaluated(..), _)
-                if self.tcx.features().lazy_normalization_consts =>
-            {
+            (ty::ConstKind::Unevaluated(..), _) if self.tcx.features().const_generics => {
                 relation.const_equate_obligation(a, b);
                 return Ok(b);
             }
-            (_, ty::ConstKind::Unevaluated(..))
-                if self.tcx.features().lazy_normalization_consts =>
-            {
+            (_, ty::ConstKind::Unevaluated(..)) if self.tcx.features().const_generics => {
                 relation.const_equate_obligation(a, b);
                 return Ok(a);
             }
@@ -662,9 +658,7 @@ fn consts(
                     }
                 }
             }
-            ty::ConstKind::Unevaluated(..) if self.tcx().features().lazy_normalization_consts => {
-                Ok(c)
-            }
+            ty::ConstKind::Unevaluated(..) if self.tcx().features().const_generics => Ok(c),
             _ => relate::super_relate_consts(self, c, c),
         }
     }
index e67ea56cf891167e73af6967d44d9d61103cb986..e5687db4ff13fceae950b00e3c6b79f8e3f6ba09 100644 (file)
@@ -988,9 +988,7 @@ fn consts(
                     }
                 }
             }
-            ty::ConstKind::Unevaluated(..) if self.tcx().features().lazy_normalization_consts => {
-                Ok(a)
-            }
+            ty::ConstKind::Unevaluated(..) if self.tcx().features().const_generics => Ok(a),
             _ => relate::super_relate_consts(self, a, a),
         }
     }
index 914b6d1d29e9c907d5975d0b3d14f27c3686adfe..621a4efc6ccc805477d680b27afe3dc2dc23a837 100644 (file)
@@ -432,8 +432,8 @@ pub fn super_relate_tys<R: TypeRelation<'tcx>>(
             match relation.relate(&sz_a, &sz_b) {
                 Ok(sz) => Ok(tcx.mk_ty(ty::Array(t, sz))),
                 // FIXME(lazy_normalization_consts) Implement improved diagnostics for mismatched array
-                //  length?
-                Err(err) if relation.tcx().features().lazy_normalization_consts => Err(err),
+                // length?
+                Err(err) if relation.tcx().features().const_generics => Err(err),
                 Err(err) => {
                     // Check whether the lengths are both concrete/known values,
                     // but are unequal, for better diagnostics.
index e4318c65050a17aab5c82d22b495f361a225bb15..a61647bfd655f781ce5882fbec29868931386a2d 100644 (file)
         label_break_value,
         lang,
         lang_items,
-        lazy_normalization_consts,
         let_chains,
         lhs,
         lib,
index 676cb68f60e2d510f295355b12c54f2d6fd62e69..983e11622f9d56322b4d08487561a1c610efc6e6 100644 (file)
@@ -388,7 +388,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
     }
 
     fn fold_const(&mut self, constant: &'tcx ty::Const<'tcx>) -> &'tcx ty::Const<'tcx> {
-        if self.selcx.tcx().features().lazy_normalization_consts {
+        if self.selcx.tcx().features().const_generics {
             constant
         } else {
             let constant = constant.super_fold_with(self);
index d16990cb44c4929a628b18fdd793af01ba51c9c5..80740651230defc254c8689ab3ffcd9fc3209a30 100644 (file)
@@ -1173,7 +1173,7 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
             // HACK(eddyb) this provides the correct generics when
             // `feature(const_generics)` is enabled, so that const expressions
             // used with const generics, e.g. `Foo<{N+1}>`, can work at all.
-            if tcx.features().const_generics || tcx.features().lazy_normalization_consts {
+            if tcx.features().const_generics {
                 Some(parent_def_id.to_def_id())
             } else {
                 let parent_node = tcx.hir().get(tcx.hir().get_parent_node(hir_id));
index 9e32687787ba6714836fb12bce0a98685156afe6..c28875f1752b08bac4d263cc20b58c06d3fb6213 100644 (file)
@@ -1,6 +1,11 @@
+<<<<<<< HEAD
 //~^ WARN the feature `const_generics` is incomplete
 #![feature(lazy_normalization_consts)]
 //~^ WARN the feature `lazy_normalization_consts` is incomplete
+=======
+#![feature(const_generics)]
+//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
+>>>>>>> merge lazy_normalization_consts into const_generics
 
 #[allow(dead_code)]
 struct ArithArrayLen<const N: usize>([u32; 0 + N]);
index 2ebd063af18aca4a44b40530a4e76ca4c8191381..14cf64eeb7ac69841461972e8e033910824b6869 100644 (file)
@@ -7,14 +7,8 @@ LL | #![feature(const_generics)]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/array-size-in-generic-struct-param.rs:3:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error: constant expression depends on a generic parameter
-  --> $DIR/array-size-in-generic-struct-param.rs:7:38
+  --> $DIR/array-size-in-generic-struct-param.rs:5:38
    |
 LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
    |                                      ^^^^^^^^^^^^
@@ -22,12 +16,12 @@ LL | struct ArithArrayLen<const N: usize>([u32; 0 + N]);
    = note: this may fail depending on what value the parameter takes
 
 error: constant expression depends on a generic parameter
-  --> $DIR/array-size-in-generic-struct-param.rs:16:5
+  --> $DIR/array-size-in-generic-struct-param.rs:14:5
    |
 LL |     arr: [u8; CFG.arr_size],
    |     ^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: this may fail depending on what value the parameter takes
 
-error: aborting due to 2 previous errors; 2 warnings emitted
+error: aborting due to 2 previous errors; 1 warning emitted
 
index 001d9852a69f8516714b1f097cebb9fcf5300cb2..7eb826b8a36b119a0fc6d4ca7ef261d279be62f9 100644 (file)
@@ -13,8 +13,8 @@ error[E0308]: mismatched types
 LL |     x = Const::<{ [4] }> {};
    |         ^^^^^^^^^^^^^^^^^^^ expected `3usize`, found `4usize`
    |
-   = note: expected struct `Const<[3usize]>`
-              found struct `Const<[4usize]>`
+   = note: expected type `[3usize]`
+              found type `[4usize]`
 
 error: aborting due to previous error; 1 warning emitted
 
index 3e07393b9aa8967587ae7cd557000d9689b90d39..de41d2984a655e5f505157a14ca0e0c109ce567a 100644 (file)
@@ -11,12 +11,10 @@ error[E0308]: mismatched types
   --> $DIR/fn-const-param-infer.rs:16:31
    |
 LL |     let _: Checked<not_one> = Checked::<not_two>;
-   |            ----------------   ^^^^^^^^^^^^^^^^^^ expected `{not_one as fn(usize) -> bool}`, found `{not_two as fn(usize) -> bool}`
-   |            |
-   |            expected due to this
+   |                               ^^^^^^^^^^^^^^^^^^ expected `{not_one as fn(usize) -> bool}`, found `{not_two as fn(usize) -> bool}`
    |
-   = note: expected struct `Checked<{not_one as fn(usize) -> bool}>`
-              found struct `Checked<{not_two as fn(usize) -> bool}>`
+   = note: expected type `{not_one as fn(usize) -> bool}`
+              found type `{not_two as fn(usize) -> bool}`
 
 error[E0308]: mismatched types
   --> $DIR/fn-const-param-infer.rs:20:24
@@ -37,12 +35,10 @@ error[E0308]: mismatched types
   --> $DIR/fn-const-param-infer.rs:25:40
    |
 LL |     let _: Checked<{generic::<u32>}> = Checked::<{generic::<u16>}>;
-   |            -------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{generic::<u32> as fn(usize) -> bool}`, found `{generic::<u16> as fn(usize) -> bool}`
-   |            |
-   |            expected due to this
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{generic::<u32> as fn(usize) -> bool}`, found `{generic::<u16> as fn(usize) -> bool}`
    |
-   = note: expected struct `Checked<{generic::<u32> as fn(usize) -> bool}>`
-              found struct `Checked<{generic::<u16> as fn(usize) -> bool}>`
+   = note: expected type `{generic::<u32> as fn(usize) -> bool}`
+              found type `{generic::<u16> as fn(usize) -> bool}`
 
 error: aborting due to 4 previous errors; 1 warning emitted
 
index 915781bc0fc40ce26879a9712760575983a56c18..ee92e1019dd9fb181cbc4e32eb2db0e87e2ca54b 100644 (file)
@@ -1,6 +1,7 @@
-//~^ WARN the feature `const_generics` is incomplete
 #![feature(lazy_normalization_consts)]
 //~^ WARN the feature `lazy_normalization_consts` is incomplete
+#![feature(const_generics)]
+//~^ WARN the feature `const_generics` is incomplete
 
 // build-pass
 
diff --git a/src/test/ui/const-generics/issues/issue-61336-1.stderr b/src/test/ui/const-generics/issues/issue-61336-1.stderr
new file mode 100644 (file)
index 0000000..34920d8
--- /dev/null
@@ -0,0 +1,10 @@
+warning: the feature `const_generics` is incomplete and may cause the compiler to crash
+  --> $DIR/issue-61336-1.rs:1:12
+   |
+LL | #![feature(const_generics)]
+   |            ^^^^^^^^^^^^^^
+   |
+   = note: `#[warn(incomplete_features)]` on by default
+
+warning: 1 warning emitted
+
index 934831f91ad9bebc104be10535a5df7196539eb0..76ba795b51c7811fadd4a369b9905a84aff08137 100644 (file)
@@ -1,6 +1,7 @@
-//~^ WARN the feature `const_generics` is incomplete
 #![feature(lazy_normalization_consts)]
 //~^ WARN the feature `lazy_normalization_consts` is incomplete
+#![feature(const_generics)]
+//~^ WARN the feature `const_generics` is incomplete
 
 fn f<T: Copy, const N: usize>(x: T) -> [T; N] {
     [x; { N }]
index c779ac10671a6bd6a59a87e6c8e77cfe08fe6783..5f3395223f95ddc7a3c137cbc890daa2992e1b70 100644 (file)
@@ -7,14 +7,8 @@ LL | #![feature(const_generics)]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/issue-61336-2.rs:3:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
-  --> $DIR/issue-61336-2.rs:11:5
+  --> $DIR/issue-61336-2.rs:9:5
    |
 LL |     [x; { N }]
    |     ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
@@ -25,6 +19,6 @@ help: consider restricting type parameter `T`
 LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
    |       ^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to previous error; 2 warnings emitted
+error: aborting due to previous error; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0277`.
index 7d7cec2c179117b995cf1ae7730127a6d9845590..0eee37df3dd52c1858e6aa3ceb11be62738f2eac 100644 (file)
@@ -7,14 +7,8 @@ LL | #![feature(const_generics)]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/issue-61336.rs:3:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied
-  --> $DIR/issue-61336.rs:11:5
+  --> $DIR/issue-61336.rs:9:5
    |
 LL |     [x; N]
    |     ^^^^^^ the trait `std::marker::Copy` is not implemented for `T`
@@ -25,6 +19,6 @@ help: consider restricting type parameter `T`
 LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
    |       ^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to previous error; 2 warnings emitted
+error: aborting due to previous error; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0277`.
index 5eb468cc27263d038255652b786b126f9e2bbd78..2e405370dc0df9a527ec572a3c9decc270ab2f36 100644 (file)
@@ -7,11 +7,5 @@ LL | #![feature(const_generics)]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/issue-61747.rs:5:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: 2 warnings emitted
+warning: 1 warning emitted
 
index 445862cccdd897d84d82ab60ce1d8df3111f6677..35fb435b812a40c9d0a56a5425e6d13c294828ba 100644 (file)
@@ -2,8 +2,6 @@
 
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
-#![feature(lazy_normalization_consts)]
-//~^ WARN the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
 
 trait Foo {}
 
index ec0db0401b41c048e7e7e77c9a610bb2e036a274..a8d9bf6a4562f5c7e803d2cbe21c9538831292f4 100644 (file)
@@ -6,11 +6,5 @@ LL | #![feature(const_generics)]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/issue-61935.rs:5:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: 2 warnings emitted
+warning: 1 warning emitted
 
index 264e693a008281140dd5e95c708d98a10b9450ba..4e05aadd3930f4f81c7b4fa7b7472c0345b07dd9 100644 (file)
@@ -16,8 +16,7 @@ impl<const X: usize> HasSize for ArrayHolder<X> {
 impl<const X: usize> ArrayHolder<X> {
     pub const fn new() -> Self {
         ArrayHolder([0; Self::SIZE])
-        //~^ ERROR: mismatched types
-        //~| ERROR constant expression depends on a generic parameter
+        //~^ ERROR constant expression depends on a generic parameter
     }
 }
 
index 5d45e302888d424895cb88f12ac906c75de013ea..f09af76325e96c9f98906e2acc435667099a00b3 100644 (file)
@@ -1,12 +1,3 @@
-error[E0308]: mismatched types
-  --> $DIR/issue-62504.rs:18:21
-   |
-LL |         ArrayHolder([0; Self::SIZE])
-   |                     ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
-   |
-   = note: expected array `[u32; X]`
-              found array `[u32; _]`
-
 error: constant expression depends on a generic parameter
   --> $DIR/issue-62504.rs:18:25
    |
@@ -15,6 +6,5 @@ LL |         ArrayHolder([0; Self::SIZE])
    |
    = note: this may fail depending on what value the parameter takes
 
-error: aborting due to 2 previous errors
+error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0308`.
index 664dbaeb0679121cdad711a08227e7447a6152b4..89e0b7f62da5d41dee4d5a6a9d8ea06f6e68efe6 100644 (file)
@@ -2,8 +2,6 @@
 
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
-#![feature(lazy_normalization_consts)]
-//~^ WARN the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
 
 trait Baz {
     type Quaks;
index 2472693afcbaf1ead199790276e755ae6e31967c..ba211caf267e2b68764b1f7f8a12d58e151ae145 100644 (file)
@@ -6,11 +6,5 @@ LL | #![feature(const_generics)]
    |
    = note: `#[warn(incomplete_features)]` on by default
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/issue-67185-1.rs:5:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-warning: 2 warnings emitted
+warning: 1 warning emitted
 
index 52c8a5c9de809aa3d0eba59fad597ce213b44b39..2732137f59d721bed0742a55e0757a9df2440d75 100644 (file)
@@ -1,7 +1,5 @@
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
-#![feature(lazy_normalization_consts)]
-//~^ WARN the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
 
 trait Baz {
     type Quaks;
index 76d2622e9af0ff833e7dfba456cb4eac05aea33f..2f6b1f1cd47e5a4914d51e9ead4affe733a6cb8f 100644 (file)
@@ -6,14 +6,8 @@ LL | #![feature(const_generics)]
    |
    = note: `#[warn(incomplete_features)]` on by default
 
-warning: the feature `lazy_normalization_consts` is incomplete and may cause the compiler to crash
-  --> $DIR/issue-67185-2.rs:3:12
-   |
-LL | #![feature(lazy_normalization_consts)]
-   |            ^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
-  --> $DIR/issue-67185-2.rs:17:1
+  --> $DIR/issue-67185-2.rs:15:1
    |
 LL | / trait Foo
 LL | |
@@ -31,7 +25,7 @@ LL | | }
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
 
 error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
-  --> $DIR/issue-67185-2.rs:17:1
+  --> $DIR/issue-67185-2.rs:15:1
    |
 LL | / trait Foo
 LL | |
@@ -49,7 +43,7 @@ LL | | }
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
 
 error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
-  --> $DIR/issue-67185-2.rs:27:6
+  --> $DIR/issue-67185-2.rs:25:6
    |
 LL | trait Foo
    |       --- required by a bound in this
@@ -65,7 +59,7 @@ LL | impl Foo for FooImpl {}
              <[u16; 4] as Bar>
 
 error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
-  --> $DIR/issue-67185-2.rs:27:6
+  --> $DIR/issue-67185-2.rs:25:6
    |
 LL | trait Foo
    |       --- required by a bound in this
@@ -81,7 +75,7 @@ LL | impl Foo for FooImpl {}
              <[u16; 4] as Bar>
 
 error[E0277]: the trait bound `[[u16; 3]; 2]: Bar` is not satisfied
-  --> $DIR/issue-67185-2.rs:31:14
+  --> $DIR/issue-67185-2.rs:29:14
    |
 LL | trait Foo
    |       --- required by a bound in this
@@ -97,7 +91,7 @@ LL | fn f(_: impl Foo) {}
              <[u16; 4] as Bar>
 
 error[E0277]: the trait bound `[u16; 3]: Bar` is not satisfied
-  --> $DIR/issue-67185-2.rs:31:14
+  --> $DIR/issue-67185-2.rs:29:14
    |
 LL | trait Foo
    |       --- required by a bound in this
@@ -112,6 +106,6 @@ LL | fn f(_: impl Foo) {}
              <[[u16; 3]; 3] as Bar>
              <[u16; 4] as Bar>
 
-error: aborting due to 6 previous errors; 2 warnings emitted
+error: aborting due to 6 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0277`.
index 2befbe56d85c7c5d42a6ba2249e3211b7598a575..0afc1a2617eaeda0816a73407ef2fd419546b604 100644 (file)
@@ -1,14 +1,14 @@
 #![feature(const_generics)]
 #![allow(incomplete_features)]
 
-trait Bar<O> {}
-impl<O> Bar<O> for [u8; O] {}
-//~^ ERROR expected value, found type parameter `O`
+trait Bar<T> {}
+impl<T> Bar<T> for [u8; T] {}
+//~^ ERROR expected value, found type parameter `T`
 
-struct Foo<const O: usize> {}
-impl<const O: usize> Foo<O>
+struct Foo<const T: usize> {}
+impl<const T: usize> Foo<T>
 where
-    [u8; O]: Bar<[(); O]>,
+    [u8; T]: Bar<[(); T]>,
 {
     fn foo() {}
 }
index 60597b8be620dd16210716158eb2c6155cc27d6c..36513f94a9e97562431adca9dc10b06c0fa67139 100644 (file)
@@ -1,6 +1,5 @@
 // run-pass
 #![feature(const_generics)]
-#![feature(lazy_normalization_consts)]
 #![allow(incomplete_features)]
 trait Foo {}
 
index a07bf2a1a54989af7bf8f6a57593a389866cbeba..048ed18c927bfa25e9a03b76cef939ac5c80f99d 100644 (file)
@@ -1,6 +1,6 @@
 // check-pass
 #![allow(incomplete_features)]
-#![feature(const_generics, lazy_normalization_consts)]
+#![feature(const_generics)]
 
 pub trait Foo<const B: bool> {}
 pub fn bar<T: Foo<{ true }>>() {}
diff --git a/src/test/ui/const-generics/lazy-normalization/lazy-normalization-feature-gate.rs b/src/test/ui/const-generics/lazy-normalization/lazy-normalization-feature-gate.rs
deleted file mode 100644 (file)
index 2c6fbfe..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// gate-test-lazy_normalization_consts
-#![feature(const_generics)]
-//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
-trait Foo {}
-
-impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-//~^ ERROR cycle detected
-
-trait FooImpl<const IS_ZERO: bool> {}
-
-impl FooImpl<{ 0u8 == 0u8 }> for [(); 0] {}
-
-impl<const N: usize> FooImpl<{ 0u8 != 0u8 }> for [(); N] {}
-
-fn foo<T: Foo>(_: T) {}
-
-fn main() {
-    foo([]);
-    foo([()]);
-}
diff --git a/src/test/ui/const-generics/lazy-normalization/lazy-normalization-feature-gate.stderr b/src/test/ui/const-generics/lazy-normalization/lazy-normalization-feature-gate.stderr
deleted file mode 100644 (file)
index 9a7844f..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-warning: the feature `const_generics` is incomplete and may cause the compiler to crash
-  --> $DIR/lazy-normalization-feature-gate.rs:2:12
-   |
-LL | #![feature(const_generics)]
-   |            ^^^^^^^^^^^^^^
-   |
-   = note: `#[warn(incomplete_features)]` on by default
-
-error[E0391]: cycle detected when const-evaluating + checking `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>::{{constant}}#0`
-  --> $DIR/lazy-normalization-feature-gate.rs:6:58
-   |
-LL | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-   |                                                          ^^^^^^^^^^
-   |
-note: ...which requires const-evaluating + checking `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>::{{constant}}#0`...
-  --> $DIR/lazy-normalization-feature-gate.rs:6:58
-   |
-LL | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-   |                                                          ^^^^^^^^^^
-note: ...which requires const-evaluating `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>::{{constant}}#0`...
-  --> $DIR/lazy-normalization-feature-gate.rs:6:58
-   |
-LL | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-   |                                                          ^^^^^^^^^^
-note: ...which requires type-checking `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>::{{constant}}#0`...
-  --> $DIR/lazy-normalization-feature-gate.rs:6:58
-   |
-LL | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-   |                                                          ^^^^^^^^^^
-note: ...which requires processing `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>::{{constant}}#0`...
-  --> $DIR/lazy-normalization-feature-gate.rs:6:58
-   |
-LL | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-   |                                                          ^^^^^^^^^^
-   = note: ...which again requires const-evaluating + checking `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>::{{constant}}#0`, completing the cycle
-note: cycle used when processing `<impl at $DIR/lazy-normalization-feature-gate.rs:6:1: 6:72>`
-  --> $DIR/lazy-normalization-feature-gate.rs:6:1
-   |
-LL | impl<const N: usize> Foo for [(); N] where Self: FooImpl<{ N == 0 }> {}
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0391`.
index 6644c72236b8627b16b341c74c940bd84271cfb4..7a665397c1207fd90c753fc5a21581f9f074f3ca 100644 (file)
@@ -11,12 +11,10 @@ error[E0308]: mismatched types
   --> $DIR/raw-ptr-const-param.rs:7:40
    |
 LL |     let _: Const<{ 15 as *const _ }> = Const::<{ 10 as *const _ }>;
-   |            -------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{0xf as *const u32}`, found `{0xa as *const u32}`
-   |            |
-   |            expected due to this
+   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `{0xf as *const u32}`, found `{0xa as *const u32}`
    |
-   = note: expected struct `Const<{0xf as *const u32}>`
-              found struct `Const<{0xa as *const u32}>`
+   = note: expected type `{0xf as *const u32}`
+              found type `{0xa as *const u32}`
 
 error: aborting due to previous error; 1 warning emitted
 
index 2131738554f87c960256b02b45598f0b4343999a..53328c2e89bf4ea2c58e6ca737e2fd4bc36ab2c1 100644 (file)
@@ -11,12 +11,10 @@ error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:13:41
    |
 LL |     let _: A<'a, u32, {2u32}, {3u32}> = A::<'a, u32, {4u32}, {3u32}> { data: PhantomData };
-   |            --------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2u32`, found `4u32`
-   |            |
-   |            expected due to this
+   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `2u32`, found `4u32`
    |
-   = note: expected struct `A<'_, _, 2u32, _>`
-              found struct `A<'_, _, 4u32, _>`
+   = note: expected type `2u32`
+              found type `4u32`
 
 error[E0308]: mismatched types
   --> $DIR/types-mismatch-const-args.rs:15:41
@@ -26,8 +24,8 @@ LL |     let _: A<'a, u16, {2u32}, {3u32}> = A::<'b, u32, {2u32}, {3u32}> { data
    |            |
    |            expected due to this
    |
-   = note: expected struct `A<'a, u16, _, _>`
-              found struct `A<'b, u32, _, _>`
+   = note: expected struct `A<'a, u16, {2u32}, {3u32}>`
+              found struct `A<'b, u32, {2u32}, {3u32}>`
 
 error: aborting due to 2 previous errors; 1 warning emitted
 
index b0ffc4a5ef61dc1a3025bbad04c348592f722b47..88f8dbe1a7d72cbbdd7827bb71d128c576d5c581 100644 (file)
@@ -25,7 +25,7 @@ error: non-defining opaque type use in defining scope
 LL | fn concrete_const() -> OneConst<{123}> {
    |                        ^^^^^^^^^^^^^^^
    |
-note: used non-generic constant `123usize` for generic parameter
+note: used non-generic constant `{123}` for generic parameter
   --> $DIR/generic_nondefining_use.rs:10:21
    |
 LL | type OneConst<const X: usize> = impl Debug;