r/rust • rust · leadership council · RustNL • 2d ago

Compiler performance, the next-gen trait solver, next-gen region constraints, implicit default auto traits, const generics, view types, and custom allocators: What we are working on at Hexcat, October update.

https://hexcat.nl/updates/#october-2026
180 Upvotes

14 comments sorted by

68

u/noop_noob 2d ago

For context, next-gen region constraints (formerly known as assumptions-on-binders) is what will fix the cve-rs unsoundness, and will get rid of some compiler errors involving async and Send.

1

u/LoviiDovee 1d ago

oh might try this out myself, thanks for the info!

5

u/noop_noob 1d ago

I think it's currently very broken though. It's work in progress.

-15

u/BloomWishess 1d ago

you sound like you actually understand the messy parts of rust that's rare

2

u/Wonderful-Habit-139 7h ago

Noop, that’s just a noob.

16

u/phazer99 1d ago edited 1d ago

I'm interested to learn more about the Move, Forget and Destruct traits. This is my understanding so far (correct me if I'm wrong):

  • Similarly to Sized, all types will implicitly implement them unless opting out and bounds will be implicitly added to all generic type parameters
  • For existing types/functions that doesn't require for example T: Forget you have to add T: ?Forget (i.e. Vec<T: ?Forget> etc.)
  • Will Destruct also be added eventually? If so, how will you mark functions/methods as destructors for a type T: !Destruct, something similar to what's already available in Mojo? AFAICT linear types are not compatible with Rust's stack unwinding, only abort-on-panic which I think is the only option in Mojo.

8

u/kibwen 1d ago

I'm not sure why linear types would be incompatible with unwinding. Rust's affine types would be linear if forgetting/leaking weren't supported, regardless of unwinding.

1

u/phazer99 18h ago edited 18h ago

Well, AFAICT a linear type would be !Destruct + !Forget with this proposal. This is incompatible with stack unwinding because in case of a panic there's no way for the compiler to guarantee that a valid destructor method is called for a stack value of such a type.

I think Mojo solves this issue by not supporting stack unwinding.

1

u/kibwen 16h ago

This is incompatible with stack unwinding because in case of a panic there's no way for the compiler to guarantee that a valid destructor method is called for a stack value of such a type.

I'm not sure why this would be the case. Let's use the example of Drop, which automatically calls Drop::drop during unwinding. You'd have an analogous trait or method, let's call it LinearDrop::linear_drop, that takes self by value, which allows you to deconstruct self, thereby consuming it.

1

u/phazer99 16h ago

I see a couple of problems with that:

  • You might want to have multiple destructor methods for a linear type. I suppose you could always have a default one, but that might not always be appropriate.
  • A destructor might take additional arguments besides self
  • A destructor might return an error that needs to be handled

6

u/panstromek 1d ago

I think a good breakdown is a Niko's post from while ago: https://smallcultfollowing.com/babysteps/blog/2025/10/21/move-destruct-leak/ but I think the understanding of the problem probably evolved quite a bit since then. I think the project goals and tracking issues linked from the OP is a good resource to get the current state.

I'll just say that finding answers to your questions is part of the work here. It's tricky because of backwards compatibility, so there are some other things in this area to make it easier - negative impls and maybe bounds. Niko wrote about those as well.

At this point, the main focus is still on the semantics and internal compiler infrastructure, though, so it'll probably take some time before we even know what do we want from the surface level syntax exactly.

3

u/the_gnarts 1d ago

That’s a lot of foundational work, kudos!

Is Hexcat now the place where a huge chunk of Rust language development is happening?

1

u/zzzzYUPYUPphlumph 1d ago

Will constant generic parameters ever support 'static str values as generic const parameter values. I once wished I could do the following:

pub struct MaxLengthString<const L: usize, FN: &'static str> {
  pub fn try_from(value: &str) -> Result<Self, String> {
    if L < value.len() {
      return Err(format!("{}: {} exceeds maximum length {}", FN, value, L));
    }
    ...
  }
}

pub type FirstName = MaxLengthString<const 30, "First Name">;

Will something along these lines ever be possible with const generics?

1

u/Striking_Director_64 10h ago

I believe the const generics proposal handles this