about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-10-07 00:12:12 +0000
committerbors <bors@rust-lang.org>2019-10-07 00:12:12 +0000
commit4ac4809ccf5f77083ae7155dcc83e921341c2614 (patch)
tree4a1db137f47b0a1e888027b3f19454963b14e177 /src/libstd/sys/unix/stack_overflow.rs
parent09868a56c95f7bc7b6ee3ab7611e3ca551031dbd (diff)
parenta4cad414ad42d36adfe27ac4b9271831e8af5125 (diff)
downloadrust-4ac4809ccf5f77083ae7155dcc83e921341c2614.tar.gz
rust-4ac4809ccf5f77083ae7155dcc83e921341c2614.zip
Auto merge of #64906 - Aaron1011:feature/extern-const-fn, r=Centril
Add support for `const unsafe? extern fn`

This works just as you might expect - an `const extern fn` is a `const fn` that is callable from foreign code.

Currently, panicking is not allowed in `const`s. When https://github.com/rust-lang/rfcs/pull/2345 (https://github.com/rust-lang/rust/issues/51999) is stabilized, then panicking in an `const extern fn` will produce a compile-time error when invoked at compile time, and an abort when invoked at runtime.

Since this is extending the language (we're allowing the `const` keyword in a new context), I believe that this will need an FCP. However, it's a very minor change, so I didn't think that filing an RFC was necessary.

This will allow libc (and other FFI crates) to make many functions `const`, without having to give up on making them `extern` as well.

Tracking issue: https://github.com/rust-lang/rust/issues/64926.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions