diff options
author | Muhammad Mahad <mahadtxt@gmail.com> | 2023-07-11 14:50:39 +0500 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-07-14 17:02:18 +0000 |
commit | a34d6675726d3c88c4c1d2860ea00884a36406f2 (patch) | |
tree | d9f3b0c230d2147deb6f3c8fcb50f9d4e991679d /gcc | |
parent | 04353fb887c7e66769e817500bdca2ef6f53ba6f (diff) | |
download | gcc-a34d6675726d3c88c4c1d2860ea00884a36406f2.zip gcc-a34d6675726d3c88c4c1d2860ea00884a36406f2.tar.gz gcc-a34d6675726d3c88c4c1d2860ea00884a36406f2.tar.bz2 |
gccrs: [E0658] Use of unstable feature
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::gate):
called error function.
gcc/testsuite/ChangeLog:
* rust/compile/changed_intrinsics.rs: New test.
Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/checks/errors/rust-feature-gate.cc | 4 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/changed_intrinsics.rs | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/rust/checks/errors/rust-feature-gate.cc b/gcc/rust/checks/errors/rust-feature-gate.cc index ca7b920..ee3da8a 100644 --- a/gcc/rust/checks/errors/rust-feature-gate.cc +++ b/gcc/rust/checks/errors/rust-feature-gate.cc @@ -79,8 +79,8 @@ FeatureGate::gate (Feature::Name name, Location loc, "<https://github.com/rust-lang/rust/issues/%u> for more " "information. add `#![feature(%s)]` to the crate attributes to " "enable."; - rust_error_at (loc, fmt_str, error_msg.c_str (), issue, issue, - feature.as_string ().c_str ()); + rust_error_at (loc, ErrorCode ("E0658"), fmt_str, error_msg.c_str (), + issue, issue, feature.as_string ().c_str ()); } else { diff --git a/gcc/testsuite/rust/compile/changed_intrinsics.rs b/gcc/testsuite/rust/compile/changed_intrinsics.rs new file mode 100644 index 0000000..172c7a4 --- /dev/null +++ b/gcc/testsuite/rust/compile/changed_intrinsics.rs @@ -0,0 +1,9 @@ +extern "rust-intrinsic" { // { dg-error "intrinsics are subject to change." "" { target *-*-* } } + fn foo(); +} + +fn main() { + unsafe { + foo(); + } +} |