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

[E0635] Use of Unknown feature. #2513

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

MahadMuhammad
Copy link
Contributor

Use of Unknown feature - E0635

Added ErrorCode support for use of unknown
feature.


Code Tested:

// ErrorCode - E0635
#![feature(AA)] //{ dg-error "unknown feature .AA." }
#![feature(iamcrabby)] // { dg-error "unknown feature .iamcrabby." }
#![feature(nonexistent_gccrs_feature)] // { dg-error "unknown feature .nonexistent_gccrs_feature." }

fn main() {}

Output:

➜  gccrs-build gcc/crab1 /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/feature.rs
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/feature.rs:1:12: error: unknown feature ‘AA[E0635]
    1 | #![feature(AA)] //{ dg-error "unknown feature .AA." }
      |            ^~
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/feature.rs:2:12: error: unknown feature ‘iamcrabby’ [E0635]
    2 | #![feature(iamcrabby)] // { dg-error "unknown feature .iamcrabby." }
      |            ^~~~~~~~~
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/feature.rs:3:12: error: unknown feature ‘asm’ [E0635]
    3 | #![feature(asm)] // { dg-error "unknown feature .asm." }
      |            ^~~

Analyzing compilation unit

Time variable                                   usr           sys          wall           GGC
 TOTAL                              :   0.00          0.00          0.00          146k
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --enable-checking=release to disable checks.

gcc/rust/ChangeLog:

* checks/errors/rust-feature-gate.cc (FeatureGate::check): errorcode support for unknown feature.

gcc/testsuite/ChangeLog:

* rust/compile/feature.rs: Added new unknown feature.

Added ErrorCode support for use of unknown
feature.

gcc/rust/ChangeLog:

	* checks/errors/rust-feature-gate.cc (FeatureGate::check):
	errorcode support for unknown feature.

gcc/testsuite/ChangeLog:

	* rust/compile/feature.rs: Added new unknown feature.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
@MahadMuhammad
Copy link
Contributor Author

Should I also raise issue for this also E0554?. Seen in godbolt

Copy link
Member

@CohenArthur CohenArthur left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thank you!

gcc/rust/checks/errors/rust-feature-gate.cc Show resolved Hide resolved
@CohenArthur CohenArthur added this pull request to the merge queue Aug 3, 2023
Merged via the queue into Rust-GCC:master with commit 5eac656 Aug 3, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants