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

Invalid order of generic parameters #2557

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

MahadMuhammad
Copy link
Contributor

@MahadMuhammad MahadMuhammad commented Aug 14, 2023

Invalid order of generic parameters

  • Added more user-friendly message & hint for fixing ordering

Output:

➜  gccrs-build gcc/crab1 /home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/generics13.rs
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/generics13.rs:1:12: error: invalid order for generic parameters: lifetime parameters must be declared prior to type and const parameters
    1 | struct Foo<A, 'a>; // { dg-error "invalid order for generic parameters: lifetimes should always come before types" }
      |            ^
      |            reorder the parameters: lifetimes, then consts and types

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:

* parse/rust-parse-impl.h (Parser::parse_generic_params): Added fixit_hint and more user friendly message.

gcc/testsuite/ChangeLog:

* rust/compile/generics13.rs: for dejagnu,

gcc/rust/parse/rust-parse-impl.h Outdated Show resolved Hide resolved
Added more userfriendly message.

gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_generic_params):
	Added more user friendly message.

gcc/testsuite/ChangeLog:

	* rust/compile/generics13.rs:
	for dejagnu,

Signed-off-by: Muhammad Mahad <[email protected]>
@CohenArthur CohenArthur added this pull request to the merge queue Aug 22, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 22, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 23, 2023
Merged via the queue into Rust-GCC:master with commit a613433 Aug 23, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants