Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[E0658] Use of unstable feature #2408

Merged
merged 1 commit into from
Jul 14, 2023
Merged

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
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>
@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