gccrs: Add fatal_error when experimental flag is not present
authorArthur Cohen <arthur.cohen@embecosm.com>
Mon, 28 Nov 2022 17:22:34 +0000 (18:22 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 13 Dec 2022 13:00:08 +0000 (14:00 +0100)
commitb07ef39ffbf4e77a586605019c64e2e070915ac3
treeca0b82d92b43078d877edcd8e39a0146a1c6899d
parent88415d33bb34c087da29938ef270788f155bb584
gccrs: Add fatal_error when experimental flag is not present

This commits ports over the flag/env variable checking from #1540 which only
allows compilation using gccrs if a certain flag is specified

gcc/rust/
* lang.opt (-frust-incomplete-and-experimental-compiler-do-not-use):
New.
* rust-session-manager.cc (Session::compile_crate): Check it.
* Make-lang.in (RUST_SELFTEST_FLAGS): Add it.
gcc/testsuite/
* lib/rust.exp (rust_init): Add
'-frust-incomplete-and-experimental-compiler-do-not-use'.
gcc/rust/Make-lang.in
gcc/rust/lang.opt
gcc/rust/rust-session-manager.cc
gcc/testsuite/lib/rust.exp