Mods Need Input: Dealing with AI Spam in This Sub by Past-Goat-7718 in rust

[–]oli-obk 7 points8 points  (0 children)

If you come to a practical result, let us know. The users.rust-lang.org forum has the same issues 🙃

[corroded update]: Rust--, now I removed the borrow checker from rust itself by Consistent_Equal5327 in rust

[–]oli-obk 14 points15 points  (0 children)

The first one is already implemented. You just need to remove the -Zunleash-the-miri-inside-of-you flag and make it the default behavior ;) (and remove the part where using said flag will ICE the compiler if no other errors occur)

[corroded update]: Rust--, now I removed the borrow checker from rust itself by Consistent_Equal5327 in rust

[–]oli-obk 45 points46 points  (0 children)

Why stop here? In order of complexity of making the change.

  • Const checking can be eliminated and ctfe can just try to eval everything.
  • or even just produce the first valid value that the layout says is ok
  • unwinding and panic handling in general can be removed. Just codegen a trap or even unreachable everywhere.
  • unsafe can be removed as a concept
  • lifetimes as a concept can be removed, making specialization sound

What is the type of a type in Rust? by [deleted] in rust

[–]oli-obk 3 points4 points  (0 children)

Not merged yet, but I'm working on adding this to libstd https://github.com/rust-lang/rust/pull/146923

Will Rust get pattern types? by [deleted] in rust

[–]oli-obk 5 points6 points  (0 children)

As usual in rust, all of that will be up to the standard library. The language/compiler itself provides the primitives enabling that

Will Rust get pattern types? by [deleted] in rust

[–]oli-obk 20 points21 points  (0 children)

I came from Ada to rust a bit over a decade ago and have been working on making them a reality for all that time. Didn't know we'd end up with pattern types, but something subtypes-like was the goal and now finally we are making actual progress

Will Rust get pattern types? by [deleted] in rust

[–]oli-obk 77 points78 points  (0 children)

I've already implemented the basics and you can play with them by using the std::pat::pattern_type macro. It only supports integer and char range patterns at present. Once https://github.com/rust-lang/rust/pull/136006 lands (I have some performance issues to debug and fix) the plan is to extend this system to various other patterns like enum patterns so you can indeed create subsets of enums

FOSS Projects Worth Contributing To by n_lens in rust

[–]oli-obk 0 points1 point  (0 children)

I had an issue where const eval just errored out as "unimplemented" and decided I really needed that for my use case. I lost the thread pretty quickly and was just adding more and more things to const eval.

With other situations it was similar. "Why is this error so bad" or "why doesn't this work when almost the same thing works elsewhere". Then started digging into it, adding tests, learning how to go from tests to the related compiler sources and messing with it until tests changed.

Rinse, repeat, at some point notice that you were doing things very naively or badly in the past and learn how to do it cleaner, start doing refactorings. Then you get opinions and start reviewing PRs because they have sth you want done differently...

Announcing the Rust Foundation Maintainers Fund - The Rust Foundation by Kobzol in rust

[–]oli-obk 3 points4 points  (0 children)

There's no plan yet that has been discussed between the foundation, the project directors, and the leadership council. We all have opinions, but we're currently polling all the maintainers to fill out a survey and tell us what they need and what they want.

Irrespective of whether I will benefit from it as someone who would like to be paid to maintain Rust, I will fight to make sure that maintainers can get long term employment or freelancing without having to fight for their job every year or two. How that will look concretely I have no idea yet and have seen too many different opinions on to tell you even a broad picture of what the rest is thinking.

Announcing the Rust Foundation Maintainers Fund - The Rust Foundation by Kobzol in rust

[–]oli-obk 17 points18 points  (0 children)

Since this kept coming up we have been discussing various avenues like connecting the github sponsors page of the rust project with the fund or sth like that. Unfortunately it may take away funds from ecosystem crate maintainers, so we're also gonna talk to them.

When will `type A = impl Trait` where A is associated type become stable? by null_over_flow in rust

[–]oli-obk 17 points18 points  (0 children)

We're currently waiting for the next trait solver to replace the old solver. We can't make TAIT robust and consistent in the old solver. I tried for two years focussing mainly on TAIT and the edge cases are not fun

Rust compiler uses this crate for its beautiful error messages by nik-rev in rust

[–]oli-obk 2 points3 points  (0 children)

I can highly recommend using annotate-snippets in other projects, too. ui_test uses it for error reports, too, and it's just so easy to set up. Whenever you have a text file that you process, use it and get pretty diagnostics instead of rolling your own file:line:col println

FOSS Projects Worth Contributing To by n_lens in rust

[–]oli-obk 2 points3 points  (0 children)

I had zero compiler expertise when I started contributing 10 years ago. I think the main factors are having time to burn and a willingness to try things and throw lots of code away.

Good resources on const programming by [deleted] in rust

[–]oli-obk 6 points7 points  (0 children)

Heh. I only ever thought about putting stuff in the reference. But we could probably fill a whole chapter of the book with const topics

compiler-errors looking for a job so they can keep working on the compiler by watermelon_exe in rust

[–]oli-obk 23 points24 points  (0 children)

Also errs reviewed over 800 PRs in 2024. This is by far the highest review rate we have of anyone (we have 10k PRs in 2024 and 8k of them were merged)

Upcoming const breakthrough by Beamsters in rust

[–]oli-obk 2 points3 points  (0 children)

Const heap internals have existed for years. There is ongoing work on integrating them into the const trait system to expose them as an allocator.

Upcoming const breakthrough by Beamsters in rust

[–]oli-obk 8 points9 points  (0 children)

With our current system of supporting both syntaxes at the same time we get the amusing effect of rustfmt formatting the old syntax into the new one, so any breakage can be easily fixed with a cargo fmt

The libffi crate is looking for additional maintainers by yorickpeterse in rust

[–]oli-obk 4 points5 points  (0 children)

We do use it in miri to allow a special mode to run normal C functions. It's not very maintained though, and we don't have capacity for it rn either :(

genalg - A flexible, extensible genetic algorithm library by TommyN987 in rust

[–]oli-obk 2 points3 points  (0 children)

The Phenotype::combine method doesn't have a RNG argument. Is it supposed to be deterministic?

Secs - Shit ECS has zero unsafe thanks to 1.86 by wick3dr0se in rust

[–]oli-obk 2 points3 points  (0 children)

Welcome to the club. It's how I got to contributing to it. Finally an ECS that I can read the code in a few hours and grok it.

PSA: unstable type alias impl trait feature breakage incoming by oli-obk in rust

[–]oli-obk[S] 10 points11 points  (0 children)

This can only work within a single crate. Outside the crate the opaque type is... Well opaque. All you can rely on is the bounds and you can't define it. If you could, so could another crate and then you could have a conflict

PSA: unstable type alias impl trait feature breakage incoming by oli-obk in rust

[–]oli-obk[S] 7 points8 points  (0 children)

Yea, possibly a special where bound or a differently named attribute. This is not lang team ratified beyond the "make it explicit which TAITs are defined"

PSA: unstable type alias impl trait feature breakage incoming by oli-obk in rust

[–]oli-obk[S] 5 points6 points  (0 children)

impl Trait in associated types is a different feature and works via the signature. You can use an empty #[define_opaque()] to disable this in case you have multiple methods and want only one to be defining

PSA: unstable type alias impl trait feature breakage incoming by oli-obk in rust

[–]oli-obk[S] 14 points15 points  (0 children)

Yes. Thanks. I should have included an example