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

Unable to find associated type in trait #3079

Closed
1 of 2 tasks
MahadMuhammad opened this issue Jul 8, 2024 · 1 comment
Closed
1 of 2 tasks

Unable to find associated type in trait #3079

MahadMuhammad opened this issue Jul 8, 2024 · 1 comment
Labels

Comments

@MahadMuhammad
Copy link
Contributor

MahadMuhammad commented Jul 8, 2024


I tried this modified code from rust-lang/rust/blob/master/tests/ui/anon-params/anon-params-denied-2018.rs)

Code

// { dg-additional-options "-frust-edition=2018" }
trait T {

    fn foo_with_qualified_path(<Bar as T>::Baz); // { dg-error "expecting .:. but .\\). found" ""  { target *-*-* } }

}

fn main() {}

I expected to see this happen:

gccrs should emit these error codes:

error[E0576]: cannot find associated type `Baz` in trait `T`
 --> <source>:4:44
  |
4 |     fn foo_with_qualified_path(<Bar as T>::Baz);
  |                                            ^^^ not found in `T`

error[E0412]: cannot find type `Bar` in this scope
 --> <source>:4:33
  |
4 |     fn foo_with_qualified_path(<Bar as T>::Baz);
  |                                 ^^^ not found in this scope

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0412, E0576.
For more information about an error, try `rustc --explain E0412`.
Compiler returned: 1

Instead, this happened:

gccrs doesn't emit any error code.

<source>:4:47: error: expecting ':' but ')' found
    4 |     fn foo_with_qualified_path(<Bar as T>::Baz);
      |                                               ^
Compiler returned: 1

Meta

  • What version of Rust GCC were you using, git sha 61bf444
  • gccrs (Compiler-Explorer-Build-gcc-61bf44479706ff92dd66c4ce5abc97c4c7465b29-binutils-2.42) 14.0.1 20240309 (experimental)

@CohenArthur
Copy link
Member

Closed in #3089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants