Most active commenters
  • johnisgood(3)

←back to thread

88 points BrainBacon | 15 comments | | HN request time: 0.693s | source | bottom

This project is inspired by some of the asserts in Unreal engine.

Due to reliance on core_intrinsics it is necessary to develop using nightly Rust, but there are stubs in place so a production build will not require nightly.

I recently released version 0.2 which includes no_std support and adds optional log message arguments to the ensure macro.

1. revskill ◴[] No.42193918[source]
What does nightly mean ? I hate that you could not know a specific version of a nightly.
replies(3): >>42193965 #>>42194026 #>>42197811 #
2. nindalf ◴[] No.42193965[source]
The master branch of the Rust repo is built every night and distributed. That's a nightly build. Most people are on the stable release, which is updated every six weeks.

A minority use the nightly build for various reasons: a feature that hasn't reached stable yet, or because they want to help test the nightly releases and prevent bugs from reaching stable.

replies(1): >>42194032 #
3. dvtkrlbs ◴[] No.42194026[source]
You can pin versions with the rust-toolchain.toml file you need to be using Rustup afaik. Nightly is just the daily builds.
replies(2): >>42194058 #>>42197476 #
4. jtrueb ◴[] No.42194032[source]
Is it a minority? Are there stats posted for this?

Only recently have I had some projects switching to stable after their required features stabilized.

replies(2): >>42194079 #>>42197108 #
5. johnisgood ◴[] No.42194058[source]
I assume any "nightly" version would work in this context, meaning it would not refer to a version from a year ago, as it would have already been made stable by that point, right?
replies(2): >>42194082 #>>42194127 #
6. JoshTriplett ◴[] No.42194079{3}[source]
https://raw.githubusercontent.com/rust-lang/surveys/main/sur...

89.4% of users surveyed use stable. 31.1% use nightly, but there's overlap there (e.g. I use nightly to try out new things but don't build things that depend on nightly). Only 11.5% of people say they use a crate that requires it.

7. traxys ◴[] No.42194082{3}[source]
"nightly" versions also allow to use unstable features, and unstable features may remain so for a very long time (potentially forever) without breaking, so an old nightly could maybe work
replies(1): >>42194218 #
8. monocasa ◴[] No.42194127{3}[source]
A lot of people pin a specific nightly since the feature they're depending on could change (or ostensibly it would be in stable), so they can keep working without continuously having to track nightly changes or deal with it breaking on a different system with a different nightly version.

That obviously only works for non-library uses of nightly.

9. johnisgood ◴[] No.42194218{4}[source]
Right, not everything gets merged to stable. In that case: letting us know the specifics beyond "nightly" is advisable, IMO.
replies(1): >>42194533 #
10. do_not_redeem ◴[] No.42194533{5}[source]
The readme does mention the specifics, immediately after mentioning nightly.

> BREAKPOINTS REQUIRE ENABLING THE EXPERIMENTAL core_intrinsics FEATURE

replies(1): >>42194632 #
11. johnisgood ◴[] No.42194632{6}[source]
How do I know which versions of nightly support that feature, and that specific version of the feature though?

I like your username.

replies(1): >>42195593 #
12. GolDDranks ◴[] No.42195593{7}[source]
Just use a recent nightly and you should be fine. Rust project doesn't offically provide support even for old stable versions, so "using nightly" with no specifics generally means using any nightly build, around or newer than, the current stable release.
13. littlestymaar ◴[] No.42197108{3}[source]
> Only recently have I had some projects switching to stable after their required features stabilized.

While this used to be very common back then (in 2016-18 many things where progressively stabilized and you had cornerstone libraries switching to stable at almost every release) it hasn't been so for the past 5 years.

Rust gets way less “exciting” new features nowadays, as the language has settled a lot (there are still moving parts, but they are the minority not the norm).

14. kookamamie ◴[] No.42197476[source]
I thought nightly is for nightly builds. I'll get my coat.
15. landr0id ◴[] No.42197811[source]
It's a bit unfortunate wording but it basically requires any nightly toolchain version. It uses `std::intrinsics::breakpoint()` which is a compiler intrinstic. This has been available for a long time, but afaik will never be exposed on a stable toolchain.

Per https://dev-doc.rust-lang.org/nightly/unstable-book/library-...

>This feature is internal to the Rust compiler and is not intended for general use.