Comments (21)
Status update
From my perspective, the main thing happening here that is relevant for t-lang is rust-lang/rfcs#3016. This will unblock stabilizing some unsafe
operations in const fn
.
There's also a bunch of work going on under the hood on the implementation side (moving towards valtrees), but at least for now these should not have any visible effects. Longer-term I think this will be a great foundation for cleaning up our "structural equality" story around consts in patterns.
from lang-team.
I am particularly happy about the last point. :D We are almost done with the multi-year effort of cleaning up the story around promotion. There is one last thread left to discuss, see rust-lang/rust#80619 for details.
from lang-team.
- Oli working on skill-tree to help plan next steps for const-eval
loop
andwhile
(notfor
) is the next candidate for stabilization.- Main blocker was questions around qualification à la
if
andmatch
. - Having
if
andmatch
w/oloop
andwhile
will push people to use recursion for loops in a const context (I believe this happened with C++’sconstexpr
). - Having no
for
loops, which would require const trdait methods, is painful though.
- Main blocker was questions around qualification à la
- Inline
const { … }
expressions (and patterns)- rust-lang/rfcs#2920
- Do we allow code inside a
const { … }
to depend on generic parameters? - Does
unsafe { const { … } }
allow unsafe operations inside the inlineconst
?- See rust-lang/rust#72359 for background
- Do we allow
const { … }
in fallible patterns?
from lang-team.
- RFC 2342, "Allow
if
andmatch
in constants"- Stabilization PR
- Oli wants to tie to stabilization to loops (see below).
from lang-team.
- RFC 2344, "Allow
loop
in constant evaluation- Stabilization proposal
- Currently we have a limit on the amount of time we can spend in const-eval, but the only way to override it is with a nightly feature.
- See rust-lang/rust#67217 for the current implementation (a crate-global attribute).
from lang-team.
- #71824, Check for live drops in constants after drop elaboration
- This is enabled by moving const-checking after drop elaboration
- Additional precision in what is availible
- Concern: This makes drop elaboration more of the public facing languge/”spec”
- Drop elaboration removes most frivolous
Drop
terminators. It seems silly to duplicate this work during const-checking. - Allows
Option::unwrap
to become (unstably) const: rust-lang/rust#66753 - Does this want its own feature gate, or wrap into above? (nominated below)
- This is enabled by moving const-checking after drop elaboration
from lang-team.
Update from meeting:
- rust-lang/rust#71824 has been merged.
from lang-team.
2020-06-22:
- Have the #18 design meeting this week about the skill tree and unsafe and so forth.
from lang-team.
const_if_match
and const_loop
stabilization PR merged (rust-lang/rust#72437). On track for stabilization in 1.46.
from lang-team.
2020-07-06:
- No updates we are aware of :)
from lang-team.
2020-08-3:
- No updates
from lang-team.
2020-08-10:
- No updates
from lang-team.
2020-08-31:
No updates.
from lang-team.
2020-09-21:
We have entered the "const evaluatable" check that allows you to have array sizes beyond [u8; N]
(e.g., [u8; N+1]
), but still lots of work before that would be considered possible on stable.
from lang-team.
@RalfJung opened rust-lang/rfcs#3016 with the following summary:
Define how UB during const evaluation is treated: some kinds of UB must be detected, the rest leads to an unspecified result for the affected CTFE query (but does not otherwise "taint" the compilation process).
from lang-team.
The blog post (in the skill-tree meeting it was discussed that basically all that is missing is a blog post referencing the current status of the skill tree that the lang team will sign off on) is now also ready: rust-lang/blog.rust-lang.org#719
from lang-team.
rust-lang/rfcs#3016 has been merged, we can now start stabilization requests to the lang team for individual unsafe things like transmute or raw pointer derefs.
valtrees are on ice until July and look promising except for some perf things that need to be figured out
there's some discussion going on around panics with user defined messages during CTFE
explicit promotion is being removed from the compiler (rust-lang/rust#85110). It was only used for SIMD intrinsic array lengths. Instead one now needs to specify a constant item and reference that in the length argument. There's work going on to replace all of these "magic arguments that must be constant" with const generics. This should simplify the compiler further and avoid having multiple schemes that do the same thing in slightly different ways.
from lang-team.
Status update
rust-lang/rust#85769 has been proposed for FCP, as our first foray into wildly unsafe
things inside const fn
. The tricky part is that this breaks the property that const fn
will be deterministic even when invoked at runtime. (However, if ptr-to-int transmutes are indeed UB at runtime, then this issue would not come up. Though one could say then we have a bigger problem. ;)
There's been some setback with panic!
inside consts due to edition 2021 issues (the old hacks we used to only evaluate argumentless format strings don't work any more), but just today a new proposal to solve this was made: rust-lang/rust#86830.
There was some more talk about floats and in particular NaNs during CTFE, but again it is unknown how to avoid introducing const fn
that are non-deterministic at runtime.
There might be more things, honestly I am not entirely sure.^^
from lang-team.
Ah, I guess there's also inline consts. No progress, to my knowledge, but it would be really good to figure out what it would take to make progress here. :)
from lang-team.
@RalfJung It'd be helpful to make forward progress on inline consts for the benefit of inline assembly. cc @Amanieu.
from lang-team.
Yeah, that's one reason why I brought it up.
I don't really have any free cycles to work on this though, so I am not sure how much I can do.
from lang-team.
Related Issues (20)
- Design meeting: Implementable trait aliases
- weak alias types for Rust 2024 HOT 5
- Design meeting: Rust issues encountered by new Rust users in the Bevy project HOT 3
- Nail down cargo-script syntax proposal HOT 2
- T-types proposal for stabilizing type alias impl Trait (TAIT)
- 2024 Edition Review HOT 1
- Design meeting: resolve ABI issues around target-feature HOT 6
- Website broken HOT 5
- Design meeting: Rust for Linux
- Design meeting: Match ergonomics 2024
- Lang-team RFC guidelines appear to be out of date
- Design meeting: Profiles
- Bounds for RPIT/RPITIT/async fn
- Discuss RFC 2442: Simple postfix macros HOT 3
- Discuss Rust 2024 edition planning: 2024-01-10
- Discuss ideas for GSoC 2024 HOT 2
- Discuss feedback for T-spec sample chapters HOT 1
- Lang discussion: Item-level `const {}` blocks, and `const { assert!(...) }` HOT 1
- Discuss temporary lifetimes 2024 RFC HOT 1
- Discuss arbitrary self types v2 RFC
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lang-team.