about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-11 03:52:12 +0000
committerbors <bors@rust-lang.org>2021-12-11 03:52:12 +0000
commitc185610ebc19a0fc22e68472483dc69ea10b92fd (patch)
tree6efde3cd2f3283600d3bd97a54a5b87ce3b21f37 /src
parent82575a1d6f02a3932fcfa36562368f5e095d93ba (diff)
parent637859b26ef431b2533d257184bd7a74ae278f8c (diff)
downloadrust-c185610ebc19a0fc22e68472483dc69ea10b92fd.tar.gz
rust-c185610ebc19a0fc22e68472483dc69ea10b92fd.zip
Auto merge of #91761 - matthiaskrgr:rollup-bjowmvz, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #91668 (Remove the match on `ErrorKind::Other`)
 - #91678 (Add tests fixed by #90023)
 - #91679 (Move core/stream/stream/mod.rs to core/stream/stream.rs)
 - #91681 (fix typo in `intrinsics::raw_eq` docs)
 - #91686 (Fix `Vec::reserve_exact` documentation)
 - #91697 (Delete Utf8Lossy::from_str)
 - #91706 (Add unstable book entries for parts of asm that are not being stabilized)
 - #91709 (Replace iterator-based set construction by *Set::From<[T; N]>)
 - #91716 (Improve x.py logging and defaults a bit more)
 - #91747 (Add pierwill to .mailmap)
 - #91755 (Fix since attribute for const_linked_list_new feature)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/bootstrap.py13
-rw-r--r--src/bootstrap/builder.rs6
-rw-r--r--src/bootstrap/clean.rs6
-rw-r--r--src/bootstrap/defaults/config.tools.toml4
-rw-r--r--src/doc/unstable-book/src/language-features/asm-const.md11
-rw-r--r--src/doc/unstable-book/src/language-features/asm-experimental-arch.md117
-rw-r--r--src/doc/unstable-book/src/language-features/asm-sym.md13
-rw-r--r--src/doc/unstable-book/src/language-features/asm-unwind.md9
-rw-r--r--src/test/ui/const-generics/issues/issue-79674.rs28
-rw-r--r--src/test/ui/const-generics/issues/issue-79674.stderr12
-rw-r--r--src/test/ui/const-generics/issues/issue-83765.rs115
-rw-r--r--src/test/ui/const-generics/issues/issue-83765.stderr130
-rw-r--r--src/test/ui/const-generics/issues/issue-86033.rs20
-rw-r--r--src/test/ui/const-generics/issues/issue-88468.rs13
-rw-r--r--src/test/ui/const-generics/issues/issue-90318.rs32
-rw-r--r--src/test/ui/const-generics/issues/issue-90318.stderr37
16 files changed, 555 insertions, 11 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index ca7ad532030..5df3d0bde6d 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -189,11 +189,11 @@ def default_build_triple(verbose):
         host = next(x for x in version.split('\n') if x.startswith("host: "))
         triple = host.split("host: ")[1]
         if verbose:
-            print("detected default triple {}".format(triple))
+            print("detected default triple {} from pre-installed rustc".format(triple))
         return triple
     except Exception as e:
         if verbose:
-            print("rustup not detected: {}".format(e))
+            print("pre-installed rustc not detected: {}".format(e))
             print("falling back to auto-detect")
 
     required = sys.platform != 'win32'
@@ -726,12 +726,15 @@ class RustBuild(object):
         status = subprocess.call(["git", "diff-index", "--quiet", commit, "--", compiler, library])
         if status != 0:
             if download_rustc == "if-unchanged":
+                if self.verbose:
+                    print("warning: saw changes to compiler/ or library/ since {}; " \
+                          "ignoring `download-rustc`".format(commit))
                 return None
-            print("warning: `download-rustc` is enabled, but there are changes to \
-                   compiler/ or library/")
+            print("warning: `download-rustc` is enabled, but there are changes to " \
+                  "compiler/ or library/")
 
         if self.verbose:
-            print("using downloaded stage1 artifacts from CI (commit {})".format(commit))
+            print("using downloaded stage2 artifacts from CI (commit {})".format(commit))
         self.rustc_commit = commit
         # FIXME: support downloading artifacts from the beta channel
         self.download_toolchain(False, "nightly")
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 6ba1b1b6036..952a65a4286 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -1578,11 +1578,11 @@ impl<'a> Builder<'a> {
                 panic!("{}", out);
             }
             if let Some(out) = self.cache.get(&step) {
-                self.verbose(&format!("{}c {:?}", "  ".repeat(stack.len()), step));
+                self.verbose_than(1, &format!("{}c {:?}", "  ".repeat(stack.len()), step));
 
                 return out;
             }
-            self.verbose(&format!("{}> {:?}", "  ".repeat(stack.len()), step));
+            self.verbose_than(1, &format!("{}> {:?}", "  ".repeat(stack.len()), step));
             stack.push(Box::new(step.clone()));
         }
 
@@ -1605,7 +1605,7 @@ impl<'a> Builder<'a> {
             let cur_step = stack.pop().expect("step stack empty");
             assert_eq!(cur_step.downcast_ref(), Some(&step));
         }
-        self.verbose(&format!("{}< {:?}", "  ".repeat(self.stack.borrow().len()), step));
+        self.verbose_than(1, &format!("{}< {:?}", "  ".repeat(self.stack.borrow().len()), step));
         self.cache.put(step, out.clone());
         out
     }
diff --git a/src/bootstrap/clean.rs b/src/bootstrap/clean.rs
index 3216c1af267..3b73dc1c7df 100644
--- a/src/bootstrap/clean.rs
+++ b/src/bootstrap/clean.rs
@@ -75,10 +75,10 @@ fn rm_rf(path: &Path) {
             do_op(path, "remove dir", |p| {
                 fs::remove_dir(p).or_else(|e| {
                     // Check for dir not empty on Windows
+                    // FIXME: Once `ErrorKind::DirectoryNotEmpty` is stabilized,
+                    // match on `e.kind()` instead.
                     #[cfg(windows)]
-                    if matches!(e.kind(), std::io::ErrorKind::Other)
-                        && e.raw_os_error() == Some(145)
-                    {
+                    if e.raw_os_error() == Some(145) {
                         return Ok(());
                     }
 
diff --git a/src/bootstrap/defaults/config.tools.toml b/src/bootstrap/defaults/config.tools.toml
index 182fb0fb067..88359fff191 100644
--- a/src/bootstrap/defaults/config.tools.toml
+++ b/src/bootstrap/defaults/config.tools.toml
@@ -11,6 +11,10 @@ incremental = true
 # This cuts compile times by almost 60x, but means you can't modify the compiler.
 download-rustc = "if-unchanged"
 
+[build]
+# Document with the in-tree rustdoc by default, since `download-rustc` makes it quick to compile.
+doc-stage = 2
+
 [llvm]
 # Will download LLVM from CI if available on your platform.
 download-ci-llvm = "if-available"
diff --git a/src/doc/unstable-book/src/language-features/asm-const.md b/src/doc/unstable-book/src/language-features/asm-const.md
new file mode 100644
index 00000000000..1063c23b6df
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/asm-const.md
@@ -0,0 +1,11 @@
+# `asm_const`
+
+The tracking issue for this feature is: [#72016]
+
+[#72016]: https://github.com/rust-lang/rust/issues/72016
+
+------------------------
+
+This feature adds a `const <expr>` operand type to `asm!` and `global_asm!`.
+- `<expr>` must be an integer constant expression.
+- The value of the expression is formatted as a string and substituted directly into the asm template string.
diff --git a/src/doc/unstable-book/src/language-features/asm-experimental-arch.md b/src/doc/unstable-book/src/language-features/asm-experimental-arch.md
new file mode 100644
index 00000000000..ec97eaa8b2b
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/asm-experimental-arch.md
@@ -0,0 +1,117 @@
+# `asm_experimental_arch`
+
+The tracking issue for this feature is: [#72016]
+
+[#72016]: https://github.com/rust-lang/rust/issues/72016
+
+------------------------
+
+This feature tracks `asm!` and `global_asm!` support for the following architectures:
+- NVPTX
+- PowerPC
+- Hexagon
+- MIPS32r2 and MIPS64r2
+- wasm32
+- BPF
+- SPIR-V
+- AVR
+
+## Register classes
+
+| Architecture | Register class | Registers                          | LLVM constraint code |
+| ------------ | -------------- | ---------------------------------- | -------------------- |
+| MIPS         | `reg`          | `$[2-25]`                          | `r`                  |
+| MIPS         | `freg`         | `$f[0-31]`                         | `f`                  |
+| NVPTX        | `reg16`        | None\*                             | `h`                  |
+| NVPTX        | `reg32`        | None\*                             | `r`                  |
+| NVPTX        | `reg64`        | None\*                             | `l`                  |
+| Hexagon      | `reg`          | `r[0-28]`                          | `r`                  |
+| PowerPC      | `reg`          | `r[0-31]`                          | `r`                  |
+| PowerPC      | `reg_nonzero`  | `r[1-31]`                          | `b`                  |
+| PowerPC      | `freg`         | `f[0-31]`                          | `f`                  |
+| PowerPC      | `cr`           | `cr[0-7]`, `cr`                    | Only clobbers        |
+| PowerPC      | `xer`          | `xer`                              | Only clobbers        |
+| wasm32       | `local`        | None\*                             | `r`                  |
+| BPF          | `reg`          | `r[0-10]`                          | `r`                  |
+| BPF          | `wreg`         | `w[0-10]`                          | `w`                  |
+| AVR          | `reg`          | `r[2-25]`, `XH`, `XL`, `ZH`, `ZL`  | `r`                  |
+| AVR          | `reg_upper`    | `r[16-25]`, `XH`, `XL`, `ZH`, `ZL` | `d`                  |
+| AVR          | `reg_pair`     | `r3r2` .. `r25r24`, `X`, `Z`       | `r`                  |
+| AVR          | `reg_iw`       | `r25r24`, `X`, `Z`                 | `w`                  |
+| AVR          | `reg_ptr`      | `X`, `Z`                           | `e`                  |
+
+> **Notes**:
+> - NVPTX doesn't have a fixed register set, so named registers are not supported.
+>
+> - WebAssembly doesn't have registers, so named registers are not supported.
+
+# Register class supported types
+
+| Architecture | Register class                  | Target feature | Allowed types                           |
+| ------------ | ------------------------------- | -------------- | --------------------------------------- |
+| MIPS32       | `reg`                           | None           | `i8`, `i16`, `i32`, `f32`               |
+| MIPS32       | `freg`                          | None           | `f32`, `f64`                            |
+| MIPS64       | `reg`                           | None           | `i8`, `i16`, `i32`, `i64`, `f32`, `f64` |
+| MIPS64       | `freg`                          | None           | `f32`, `f64`                            |
+| NVPTX        | `reg16`                         | None           | `i8`, `i16`                             |
+| NVPTX        | `reg32`                         | None           | `i8`, `i16`, `i32`, `f32`               |
+| NVPTX        | `reg64`                         | None           | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
+| Hexagon      | `reg`                           | None           | `i8`, `i16`, `i32`, `f32`               |
+| PowerPC      | `reg`                           | None           | `i8`, `i16`, `i32`                      |
+| PowerPC      | `reg_nonzero`                   | None           | `i8`, `i16`, `i32`                      |
+| PowerPC      | `freg`                          | None           | `f32`, `f64`                            |
+| PowerPC      | `cr`                            | N/A            | Only clobbers                           |
+| PowerPC      | `xer`                           | N/A            | Only clobbers                           |
+| wasm32       | `local`                         | None           | `i8` `i16` `i32` `i64` `f32` `f64`      |
+| BPF          | `reg`                           | None           | `i8` `i16` `i32` `i64`                  |
+| BPF          | `wreg`                          | `alu32`        | `i8` `i16` `i32`                        |
+| AVR          | `reg`, `reg_upper`              | None           | `i8`                                    |
+| AVR          | `reg_pair`, `reg_iw`, `reg_ptr` | None           | `i16`                                   |
+
+## Register aliases
+
+| Architecture | Base register | Aliases   |
+| ------------ | ------------- | --------- |
+| Hexagon      | `r29`         | `sp`      |
+| Hexagon      | `r30`         | `fr`      |
+| Hexagon      | `r31`         | `lr`      |
+| BPF          | `r[0-10]`     | `w[0-10]` |
+| AVR          | `XH`          | `r27`     |
+| AVR          | `XL`          | `r26`     |
+| AVR          | `ZH`          | `r31`     |
+| AVR          | `ZL`          | `r30`     |
+
+## Unsupported registers
+
+| Architecture | Unsupported register                    | Reason                                                                                                                                                                              |
+| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| All          | `sp`                                    | The stack pointer must be restored to its original value at the end of an asm code block.                                                                                           |
+| All          | `fr` (Hexagon), `$fp` (MIPS), `Y` (AVR) | The frame pointer cannot be used as an input or output.                                                                                                                             |
+| All          | `r19` (Hexagon)                         | This is used internally by LLVM as a "base pointer" for functions with complex stack frames.                                                                                        |
+| MIPS         | `$0` or `$zero`                         | This is a constant zero register which can't be modified.                                                                                                                           |
+| MIPS         | `$1` or `$at`                           | Reserved for assembler.                                                                                                                                                             |
+| MIPS         | `$26`/`$k0`, `$27`/`$k1`                | OS-reserved registers.                                                                                                                                                              |
+| MIPS         | `$28`/`$gp`                             | Global pointer cannot be used as inputs or outputs.                                                                                                                                 |
+| MIPS         | `$ra`                                   | Return address cannot be used as inputs or outputs.                                                                                                                                 |
+| Hexagon      | `lr`                                    | This is the link register which cannot be used as an input or output.                                                                                                               |
+| AVR          | `r0`, `r1`, `r1r0`                      | Due to an issue in LLVM, the `r0` and `r1` registers cannot be used as inputs or outputs.  If modified, they must be restored to their original values before the end of the block. |
+
+## Template modifiers
+
+| Architecture | Register class | Modifier | Example output | LLVM modifier |
+| ------------ | -------------- | -------- | -------------- | ------------- |
+| MIPS         | `reg`          | None     | `$2`           | None          |
+| MIPS         | `freg`         | None     | `$f0`          | None          |
+| NVPTX        | `reg16`        | None     | `rs0`          | None          |
+| NVPTX        | `reg32`        | None     | `r0`           | None          |
+| NVPTX        | `reg64`        | None     | `rd0`          | None          |
+| Hexagon      | `reg`          | None     | `r0`           | None          |
+| PowerPC      | `reg`          | None     | `0`            | None          |
+| PowerPC      | `reg_nonzero`  | None     | `3`            | `b`           |
+| PowerPC      | `freg`         | None     | `0`            | None          |
+
+# Flags covered by `preserves_flags`
+
+These flags registers must be restored upon exiting the asm block if the `preserves_flags` option is set:
+- AVR
+  - The status register `SREG`.
diff --git a/src/doc/unstable-book/src/language-features/asm-sym.md b/src/doc/unstable-book/src/language-features/asm-sym.md
new file mode 100644
index 00000000000..7544e20807e
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/asm-sym.md
@@ -0,0 +1,13 @@
+# `asm_sym`
+
+The tracking issue for this feature is: [#72016]
+
+[#72016]: https://github.com/rust-lang/rust/issues/72016
+
+------------------------
+
+This feature adds a `sym <path>` operand type to `asm!` and `global_asm!`.
+- `<path>` must refer to a `fn` or `static`.
+- A mangled symbol name referring to the item is substituted into the asm template string.
+- The substituted string does not include any modifiers (e.g. GOT, PLT, relocations, etc).
+- `<path>` is allowed to point to a `#[thread_local]` static, in which case the asm code can combine the symbol with relocations (e.g. `@plt`, `@TPOFF`) to read from thread-local data.
diff --git a/src/doc/unstable-book/src/language-features/asm-unwind.md b/src/doc/unstable-book/src/language-features/asm-unwind.md
new file mode 100644
index 00000000000..414193fe801
--- /dev/null
+++ b/src/doc/unstable-book/src/language-features/asm-unwind.md
@@ -0,0 +1,9 @@
+# `asm_unwind`
+
+The tracking issue for this feature is: [#72016]
+
+[#72016]: https://github.com/rust-lang/rust/issues/72016
+
+------------------------
+
+This feature adds a `may_unwind` option to `asm!` which allows an `asm` block to unwind stack and be part of the stack unwinding process. This option is only supported by the LLVM backend right now.
diff --git a/src/test/ui/const-generics/issues/issue-79674.rs b/src/test/ui/const-generics/issues/issue-79674.rs
new file mode 100644
index 00000000000..2f196533dd8
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-79674.rs
@@ -0,0 +1,28 @@
+#![feature(const_fn_trait_bound, generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait MiniTypeId {
+    const TYPE_ID: u64;
+}
+
+impl<T> MiniTypeId for T {
+    const TYPE_ID: u64 = 0;
+}
+
+enum Lift<const V: bool> {}
+
+trait IsFalse {}
+impl IsFalse for Lift<false> {}
+
+const fn is_same_type<T: MiniTypeId, U: MiniTypeId>() -> bool {
+    T::TYPE_ID == U::TYPE_ID
+}
+
+fn requires_distinct<A, B>(_a: A, _b: B) where
+    A: MiniTypeId, B: MiniTypeId,
+    Lift<{is_same_type::<A, B>()}>: IsFalse {}
+
+fn main() {
+    requires_distinct("str", 12);
+    //~^ ERROR mismatched types
+}
diff --git a/src/test/ui/const-generics/issues/issue-79674.stderr b/src/test/ui/const-generics/issues/issue-79674.stderr
new file mode 100644
index 00000000000..8c029289cbb
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-79674.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-79674.rs:26:5
+   |
+LL |     requires_distinct("str", 12);
+   |     ^^^^^^^^^^^^^^^^^ expected `true`, found `false`
+   |
+   = note: expected type `true`
+              found type `false`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/const-generics/issues/issue-83765.rs b/src/test/ui/const-generics/issues/issue-83765.rs
new file mode 100644
index 00000000000..68536348d38
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-83765.rs
@@ -0,0 +1,115 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait TensorDimension {
+    const DIM : usize;
+    const ISSCALAR : bool = Self::DIM == 0;
+    fn is_scalar(&self) -> bool {Self::ISSCALAR}
+}
+
+trait TensorSize : TensorDimension {
+    fn size(&self) -> [usize;Self::DIM];
+    fn inbounds(&self,index : [usize;Self::DIM]) -> bool {
+        index.iter().zip(self.size().iter()).all(|(i,s)| i < s)
+    }
+}
+
+
+trait Broadcastable: TensorSize + Sized {
+    type Element;
+    fn bget(&self, index:[usize;Self::DIM]) -> Option<Self::Element>;
+    fn lazy_updim<const NEWDIM : usize>(&self, size : [usize;NEWDIM] ) ->
+       LazyUpdim<Self,{Self::DIM},NEWDIM>
+    {
+        assert!(NEWDIM >= Self::DIM,
+            "Updimmed tensor cannot have fewer indices than the initial one.");
+        LazyUpdim {size,reference:&self}
+    }
+    fn bmap<T,F :Fn(Self::Element) -> T>(&self,foo : F) -> BMap<T,Self,F,{Self::DIM}>{
+        BMap {reference:self,closure : foo}
+    }
+}
+
+
+struct LazyUpdim<'a,T : Broadcastable,const OLDDIM : usize, const DIM : usize> {
+    size : [usize;DIM],
+    reference : &'a T
+}
+
+impl<'a,T : Broadcastable,const DIM : usize> TensorDimension for LazyUpdim<'a,T,{T::DIM},DIM> {
+    const DIM : usize = DIM;
+}
+
+impl<'a,T : Broadcastable,const DIM : usize> TensorSize for LazyUpdim<'a,T,{T::DIM},DIM> {
+    fn size(&self) -> [usize;DIM] {self.size}
+    //~^ ERROR method not compatible with trait
+}
+
+impl<'a,T : Broadcastable,const DIM : usize>  Broadcastable for LazyUpdim<'a,T,{T::DIM},DIM>
+{
+    type Element = T::Element;
+    fn bget(&self,index:[usize;DIM]) -> Option<Self::Element> {
+      //~^ ERROR method not compatible with trait
+        assert!(DIM >= T::DIM);
+        if !self.inbounds(index) {return None}
+        //~^ ERROR unconstrained generic constant
+        //~| ERROR mismatched types
+        let size = self.size();
+        //~^ ERROR unconstrained generic constant
+        let newindex : [usize;T::DIM] = Default::default();
+        //~^ ERROR the trait bound `[usize; _]: Default` is not satisfied
+        self.reference.bget(newindex)
+    }
+}
+
+struct BMap<'a,R, T : Broadcastable, F :  Fn(T::Element) -> R  , const DIM: usize> {
+    reference : &'a T,
+    closure : F
+}
+
+impl<'a,R, T : Broadcastable, F :  Fn(T::Element) -> R,
+     const DIM: usize> TensorDimension for BMap<'a,R,T,F,DIM> {
+
+    const DIM : usize = DIM;
+}
+impl<'a,R, T : Broadcastable, F :  Fn(T::Element) -> R  ,
+      const DIM: usize> TensorSize for BMap<'a,R,T,F,DIM> {
+
+    fn size(&self) -> [usize;DIM] {self.reference.size()}
+    //~^ ERROR unconstrained generic constant
+    //~| ERROR mismatched types
+    //~| ERROR method not compatible with trait
+}
+
+impl<'a,R, T : Broadcastable, F :  Fn(T::Element) -> R  ,
+  const DIM: usize> Broadcastable for BMap<'a,R,T,F,DIM> {
+
+    type Element = R;
+    fn bget(&self,index:[usize;DIM]) -> Option<Self::Element> {
+      //~^ ERROR method not compatible with trait
+        self.reference.bget(index).map(&self.closure)
+        //~^ ERROR unconstrained generic constant
+        //~| ERROR mismatched types
+    }
+}
+
+impl<T> TensorDimension for Vec<T> {
+    const DIM : usize = 1;
+}
+impl<T> TensorSize for Vec<T> {
+    fn size(&self) -> [usize;1] {[self.len()]}
+}
+impl<T: Clone> Broadcastable for Vec<T> {
+    type Element = T;
+    fn bget(& self,index : [usize;1]) -> Option<T> {
+        self.get(index[0]).cloned()
+    }
+}
+
+fn main() {
+    let v = vec![1,2,3];
+    let bv = v.lazy_updim([3,4]);
+    let bbv = bv.bmap(|x| x*x);
+
+    println!("The size of v is {:?}",bbv.bget([0,2]).expect("Out of bounds."));
+}
diff --git a/src/test/ui/const-generics/issues/issue-83765.stderr b/src/test/ui/const-generics/issues/issue-83765.stderr
new file mode 100644
index 00000000000..a49f850717f
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-83765.stderr
@@ -0,0 +1,130 @@
+error[E0308]: method not compatible with trait
+  --> $DIR/issue-83765.rs:44:5
+   |
+LL |     fn size(&self) -> [usize;DIM] {self.size}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
+   |
+   = note: expected type `Self::DIM`
+              found type `DIM`
+
+error[E0308]: method not compatible with trait
+  --> $DIR/issue-83765.rs:51:5
+   |
+LL |     fn bget(&self,index:[usize;DIM]) -> Option<Self::Element> {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
+   |
+   = note: expected type `Self::DIM`
+              found type `DIM`
+
+error[E0308]: method not compatible with trait
+  --> $DIR/issue-83765.rs:78:5
+   |
+LL |     fn size(&self) -> [usize;DIM] {self.reference.size()}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
+   |
+   = note: expected type `Self::DIM`
+              found type `DIM`
+
+error[E0308]: method not compatible with trait
+  --> $DIR/issue-83765.rs:88:5
+   |
+LL |     fn bget(&self,index:[usize;DIM]) -> Option<Self::Element> {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM`
+   |
+   = note: expected type `Self::DIM`
+              found type `DIM`
+
+error: unconstrained generic constant
+  --> $DIR/issue-83765.rs:54:18
+   |
+LL |         if !self.inbounds(index) {return None}
+   |                  ^^^^^^^^
+   |
+   = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
+note: required by a bound in `TensorSize::inbounds`
+  --> $DIR/issue-83765.rs:12:38
+   |
+LL |     fn inbounds(&self,index : [usize;Self::DIM]) -> bool {
+   |                                      ^^^^^^^^^ required by this bound in `TensorSize::inbounds`
+
+error[E0308]: mismatched types
+  --> $DIR/issue-83765.rs:54:27
+   |
+LL |         if !self.inbounds(index) {return None}
+   |                           ^^^^^ expected `Self::DIM`, found `DIM`
+   |
+   = note: expected type `Self::DIM`
+              found type `DIM`
+
+error: unconstrained generic constant
+  --> $DIR/issue-83765.rs:57:25
+   |
+LL |         let size = self.size();
+   |                         ^^^^
+   |
+   = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
+note: required by a bound in `TensorSize::size`
+  --> $DIR/issue-83765.rs:11:30
+   |
+LL |     fn size(&self) -> [usize;Self::DIM];
+   |                              ^^^^^^^^^ required by this bound in `TensorSize::size`
+
+error[E0277]: the trait bound `[usize; _]: Default` is not satisfied
+  --> $DIR/issue-83765.rs:59:41
+   |
+LL |         let newindex : [usize;T::DIM] = Default::default();
+   |                                         ^^^^^^^^^^^^^^^^ the trait `Default` is not implemented for `[usize; _]`
+   |
+help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
+   |
+LL | impl<'a,T : Broadcastable,const DIM : usize>  Broadcastable for LazyUpdim<'a,T,{T::DIM},DIM> where [usize; _]: Default
+   |                                                                                              +++++++++++++++++++++++++
+
+error: unconstrained generic constant
+  --> $DIR/issue-83765.rs:78:51
+   |
+LL |     fn size(&self) -> [usize;DIM] {self.reference.size()}
+   |                                                   ^^^^
+   |
+   = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
+note: required by a bound in `TensorSize::size`
+  --> $DIR/issue-83765.rs:11:30
+   |
+LL |     fn size(&self) -> [usize;Self::DIM];
+   |                              ^^^^^^^^^ required by this bound in `TensorSize::size`
+
+error[E0308]: mismatched types
+  --> $DIR/issue-83765.rs:78:36
+   |
+LL |     fn size(&self) -> [usize;DIM] {self.reference.size()}
+   |                                    ^^^^^^^^^^^^^^^^^^^^^ expected `DIM`, found `Self::DIM`
+   |
+   = note: expected type `DIM`
+              found type `Self::DIM`
+
+error: unconstrained generic constant
+  --> $DIR/issue-83765.rs:90:24
+   |
+LL |         self.reference.bget(index).map(&self.closure)
+   |                        ^^^^
+   |
+   = help: try adding a `where` bound using this expression: `where [(); Self::DIM]:`
+note: required by a bound in `Broadcastable::bget`
+  --> $DIR/issue-83765.rs:20:33
+   |
+LL |     fn bget(&self, index:[usize;Self::DIM]) -> Option<Self::Element>;
+   |                                 ^^^^^^^^^ required by this bound in `Broadcastable::bget`
+
+error[E0308]: mismatched types
+  --> $DIR/issue-83765.rs:90:29
+   |
+LL |         self.reference.bget(index).map(&self.closure)
+   |                             ^^^^^ expected `Self::DIM`, found `DIM`
+   |
+   = note: expected type `Self::DIM`
+              found type `DIM`
+
+error: aborting due to 12 previous errors
+
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/const-generics/issues/issue-86033.rs b/src/test/ui/const-generics/issues/issue-86033.rs
new file mode 100644
index 00000000000..cf08f722fbb
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-86033.rs
@@ -0,0 +1,20 @@
+// check-pass
+
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+pub trait IsTrue<const T: bool> {}
+impl IsTrue<true> for () {}
+
+pub trait IsZST {}
+
+impl<T> IsZST for T
+where
+    (): IsTrue<{ std::mem::size_of::<T>() == 0 }>
+{}
+
+fn _func() -> impl IsZST {
+    || {}
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-88468.rs b/src/test/ui/const-generics/issues/issue-88468.rs
new file mode 100644
index 00000000000..914047236ab
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-88468.rs
@@ -0,0 +1,13 @@
+// check-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+
+pub struct Assert<const COND: bool>();
+pub trait IsTrue {}
+impl IsTrue for Assert<true> {}
+
+pub trait IsNotZST {}
+impl<T> IsNotZST for T where Assert<{ std::mem::size_of::<T>() > 0 }>: IsTrue {}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/issues/issue-90318.rs b/src/test/ui/const-generics/issues/issue-90318.rs
new file mode 100644
index 00000000000..0c640a5ef71
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-90318.rs
@@ -0,0 +1,32 @@
+#![feature(const_type_id)]
+#![feature(generic_const_exprs)]
+#![feature(core_intrinsics)]
+#![allow(incomplete_features)]
+
+use std::any::TypeId;
+
+struct If<const B: bool>;
+pub trait True {}
+impl True for If<true> {}
+
+fn consume<T: 'static>(_val: T)
+where
+    If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
+    //~^ ERROR: overly complex generic constant
+    //~| ERROR: calls in constants are limited to constant functions
+{
+}
+
+fn test<T: 'static>()
+where
+    If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
+    //~^ ERROR: overly complex generic constant
+    //~| ERROR: calls in constants are limited to constant functions
+{
+}
+
+fn main() {
+    let a = ();
+    consume(0i32);
+    consume(a);
+}
diff --git a/src/test/ui/const-generics/issues/issue-90318.stderr b/src/test/ui/const-generics/issues/issue-90318.stderr
new file mode 100644
index 00000000000..2b8afe2ef09
--- /dev/null
+++ b/src/test/ui/const-generics/issues/issue-90318.stderr
@@ -0,0 +1,37 @@
+error: overly complex generic constant
+  --> $DIR/issue-90318.rs:14:8
+   |
+LL |     If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
+   |        ^^-----------------^^^^^^^^^^^^^^^^^^^^^^^^
+   |          |
+   |          borrowing is not supported in generic constants
+   |
+   = help: consider moving this anonymous constant into a `const` function
+   = note: this operation may be supported in the future
+
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+  --> $DIR/issue-90318.rs:14:10
+   |
+LL |     If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: overly complex generic constant
+  --> $DIR/issue-90318.rs:22:8
+   |
+LL |     If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
+   |        ^^-----------------^^^^^^^^^^^^^^^^^^^^^^^^
+   |          |
+   |          borrowing is not supported in generic constants
+   |
+   = help: consider moving this anonymous constant into a `const` function
+   = note: this operation may be supported in the future
+
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+  --> $DIR/issue-90318.rs:22:10
+   |
+LL |     If<{ TypeId::of::<T>() != TypeId::of::<()>() }>: True,
+   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0015`.