Change:
<ins> 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`. </ins>

Discussion:
features: constgenerics constevaluatablechecked cargo doc running the rustdoc command manually without --crate-version <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<pbacktrace from the rustdoc command (without --crate-version) </p</details
ICE still occurs on with feature flags changed to
With a bit of modification, this ICE happens on when running rather than ():

In some cases compiler panicks when, I believe, computing const generic argument containing , where is some closure type. Interestingly, it works well when I put closure into associated type, so expression looks like . Changing closure type to something more simple makes everything fine. This gives panic: () Interestingly, following code also requires closure type to be ZST, but compiles well: () <!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
label +A-closures +A-zst
sorry for bothering you, but probably ZST is not a real cause of a problem. I'm very far from compiler internals, but it looks like issue is coming from using in const generics using incomplete feature . Sorry if title was inaccurate. Unfortunately I do not know what tags may be more suitable here and even can't edit them. Upd: Making closure non-ZST still crashes the compiler:
After googling a bit I finally learned how to become a better contributor :) label +F-constevaluatablechecked +A-const-eval +F-const_generics +A-const-generics -A-zst
That's quite alright! You don't need to worry about bothering me. I appreciate any advice on how to make my categorizations more helpful. That said, I might suggest editing the title and opening post to make the probable source of the problem a bit more clear. :) label +requires-nightly

I found this ICE while playing with const generics on the Rust playground. () : <details<summary<strongBacktrace</strong</summary<p</p</details
Ah, it looks like that feature enables extra behavior for s.
glacier ""
This ICEs since modify labels: +regression-from-stable-to-stable
This seems to need unstable features to reproduce? Or did I miss something?
You can reproduce the ICE on stable, but to actually use the code you need to be on nightly. I think makes sense here.
Oh, so you need the feature gates, but you can still reproduce it on stable, got it. In that case it is technically not since you can reproduce the ICE on stable.
Assigning and removing as in the prioritization working group.
would fix the ICE. To me it looks as if the problem is that the bound is not satisfied in this example, but we get a really confusing error message now: I suggest we'd close this issue and open a new diagnostics issue in case the PR would be merged.