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

[E0034] found more than one items for method #2560

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

MahadMuhammad
Copy link
Contributor

@MahadMuhammad MahadMuhammad commented Aug 15, 2023

Multiple Applicable items found for method foo - E0034

Added rich location and error code for E0034

Also, Fixes #2366

Code tested:

/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/generics6.rs:29:23: error: multiple applicable items in scope for: ‘test’ [E0034]
    9 |     fn test() -> i32 { // { dg-error "possible candidate" "TODO" { xfail *-*-* } }
      |     ~~                 
......
   19 |     fn test() -> i32 { // { dg-error "possible candidate" "TODO" { xfail *-*-* } }
      |     ~~                 
......
   29 |     let a: i32 = Foo::test(); // { dg-error "multiple applicable items in scope for: test" }
      |                       ^~~~
      |                       multiple test found
/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/generics6.rs:29:18: error: Failed to resolve expression of function call
   29 |     let a: i32 = Foo::test(); // { dg-error "multiple applicable items in scope for: test" }
      |                  ^~~

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Added rich location and error code.

gcc/testsuite/ChangeLog:

* rust/compile/generics7.rs: Updated dejagnu comment.
* rust/compile/issue-925.rs: likewise.

Multiple items found with same prototype.
Fixes: Rust-GCC#2366

gcc/rust/ChangeLog:

	* typecheck/rust-hir-path-probe.h:
	Fixes issue & added rich location message.
	* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
	Added rich location and error code.

gcc/testsuite/ChangeLog:

	* rust/compile/generics6.rs: Updated dejagnu comment.
	* rust/compile/generics7.rs: likewise.
	* rust/compile/issue-925.rs: likewise.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
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 this pull request to the merge queue Aug 17, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 17, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 17, 2023
Merged via the queue into Rust-GCC:master with commit d4bf5e3 Aug 17, 2023
9 checks passed
mvvsmk added a commit to mvvsmk/gccrs that referenced this pull request Nov 10, 2023
Fixes issue Rust-GCC#2560
The parser now parses ASYNC functions.
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_item):Added ASYNC case.
	(Parser::parse_vis_item):Added a switch case to handel ASYNC.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-2650.rs: New test.

Signed-off-by: M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
mvvsmk added a commit to mvvsmk/gccrs that referenced this pull request Nov 10, 2023
Fixes issue Rust-GCC#2560
The parser now parses ASYNC functions.
gcc/rust/ChangeLog:

	* parse/rust-parse-impl.h (Parser::parse_item):Added ASYNC case.
	(Parser::parse_vis_item):Added a switch case to handel ASYNC.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-2650.rs: New test.

Signed-off-by: M V V S Manoj Kumar <mvvsmanojkumar@gmail.com>
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.

Location Info error for "multiple applicable items in scope for: test"
3 participants