aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-12-02 10:19:39 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-12-05 14:52:09 +0100
commitb2d445c2bbb15e6a1f1d0e5ac693fd671ecaa473 (patch)
treed79b849967b142fddcb7859445d3a10e446158c8 /gcc/rust/rust-session-manager.cc
parent3df7703a627ed3a070c91cf2e3b92ec993684531 (diff)
downloadgcc-b2d445c2bbb15e6a1f1d0e5ac693fd671ecaa473.zip
gcc-b2d445c2bbb15e6a1f1d0e5ac693fd671ecaa473.tar.gz
gcc-b2d445c2bbb15e6a1f1d0e5ac693fd671ecaa473.tar.bz2
long_flag: Add env variable, remove bootstrap guards
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r--gcc/rust/rust-session-manager.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 78dc3a0..54660a8 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -427,9 +427,8 @@ Session::handle_crate_name (const AST::Crate &parsed_crate)
void
Session::compile_crate (const char *filename)
{
-#ifdef RUST_BOOTSTRAP_BUILD
- // Do not emit the fatal error or require the flag for dev builds
- if (!flag_rust_experimental)
+ if (!flag_rust_experimental
+ && !std::getenv ("GCCRS_INCOMPLETE_AND_EXPERIMENTAL_COMPILER_DO_NOT_USE"))
rust_fatal_error (
Location (), "%s",
"gccrs is not yet able to compile Rust code "
@@ -443,11 +442,12 @@ Session::compile_crate (const char *filename)
"If you understand this, and understand that the binaries produced might "
"not behave accordingly, you may attempt to use gccrs in an experimental "
"manner by passing the following flag:\n\n"
- "`-frust-incomplete-and-experimental-compiler-do-not-use`\n\nFor "
+ "`-frust-incomplete-and-experimental-compiler-do-not-use`\n\nor by "
+ "defining the following environment variable (any value will "
+ "do)\n\nGCCRS_INCOMPLETE_AND_EXPERIMENTAL_COMPILER_DO_NOT_USE\n\nFor"
"cargo-gccrs, this means passing\n\n"
"GCCRS_EXTRA_FLAGS=\"-frust-incomplete-and-experimental-compiler-do-not-"
"use\"\n\nas an environment variable.");
-#endif
RAIIFile file_wrap (filename);
if (!file_wrap.ok ())