From: Muhammad Mahad Date: Tue, 11 Jul 2023 09:50:39 +0000 (+0500) Subject: gccrs: [E0658] Use of unstable feature X-Git-Tag: basepoints/gcc-15~2349 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=600d78c65ad61090f9b459718d97a4ec3a3a759b;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/rust/checks/errors/rust-feature-gate.cc b/gcc/rust/checks/errors/rust-feature-gate.cc index 2177a5b3a0c1..187fec0dedb0 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, " 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 000000000000..172c7a42e2df --- /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(); + } +}