Skip to content

Conversation

MahadMuhammad
Copy link
Contributor

E0658 Use of Unstable feature

  • Added Errorcode Support for unstable features.

Code Tested:

extern "rust-intrinsic" { // { dg-error "intrinsics are subject to change." "" { target *-*-* }  }
    fn foo(); // { dg-error "unrecognized intrinsic function: .foo." }
}

fn main() {
    unsafe {
        foo(); // { dg-error "unrecognized intrinsic function: .foo." }
    }
}

Output:

/gccrs/gcc/testsuite/rust/compile/feature_extern_types.rs:2:5: error: extern types are experimental. see issue 43467 <https://github.com/rust-lang/rust/issues/43467> for more information. add `#![feature(extern_types)]` to the crate attributes to enable. [E0658]
compiler exited with status 1

gcc/rust/ChangeLog:

* checks/errors/rust-feature-gate.cc (FeatureGate::gate): called error function.

gcc/testsuite/ChangeLog:

* rust/compile/changed_intrinsics.rs: New test.

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty philberty added the diagnostic diagnostic static analysis label Jul 11, 2023
@philberty philberty added this to the GCC 14 Stage 3 milestone Jul 11, 2023
@philberty philberty added this pull request to the merge queue Jul 11, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 11, 2023
@philberty philberty added this pull request to the merge queue Jul 12, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jul 12, 2023
@MahadMuhammad MahadMuhammad requested a review from philberty July 12, 2023 17:39
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 <[email protected]>
@philberty philberty added this pull request to the merge queue Jul 14, 2023
Merged via the queue into Rust-GCC:master with commit a34d667 Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants