about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2019-09-29 19:22:18 -0400
committerAaron Hill <aa1ronham@gmail.com>2019-10-02 00:38:52 -0400
commit73b50d211b254bf72ce10b5ea4c3e0033e3189f4 (patch)
treeffd2406f05d8bae7607cac2399493bbd331657ef /src/libstd/sys
parent7130fc54e05e247f93c7ecc2d10f56b314c97831 (diff)
downloadrust-73b50d211b254bf72ce10b5ea4c3e0033e3189f4.tar.gz
rust-73b50d211b254bf72ce10b5ea4c3e0033e3189f4.zip
Add support for 'extern const fn'
This works just as you might expect - an 'extern const fn' is a 'const
fn' that is callable from foreign code.

Currently, panicking is not allowed in consts. When RFC 2345 is
stabilized, then panicking in an 'extern const 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.
Diffstat (limited to 'src/libstd/sys')
0 files changed, 0 insertions, 0 deletions