Change:
<ins> #![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.")); } </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.