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

Compiler expected where but there is a where #93567

Closed
aaronddavies opened this issue Feb 2, 2022 · 1 comment · Fixed by #93571
Closed

Compiler expected where but there is a where #93567

aaronddavies opened this issue Feb 2, 2022 · 1 comment · Fixed by #93571
Assignees
Labels
C-bug Category: This is a bug.

Comments

@aaronddavies
Copy link

aaronddavies commented Feb 2, 2022

I tried this code:

pub trait MyTrait {}
pub trait AnotherTrait<U> {}
pub struct MyStruct<T> where T: AnotherTrait<U> where U: MyTrait {
    t: T,
    u: U,
}

I expected to see this happen: The compiler would give a sensible error.

Instead, this happened: The compiler complains that it expected where where I actually do have where:

error: expected `where`, or `{` after struct name, found keyword `where`
  --> src/main.rs:29:49
   |
29 | pub struct MyStruct<T> where T: AnotherTrait<U> where U: MyTrait {
   |                                                 ^^^^^ expected `where`, or `{` after struct name

Meta

rustc --version --verbose:

rustc 1.59.0-nightly (cfa4ac66c 2022-01-06)
binary: rustc
commit-hash: cfa4ac66c194046f631ce076c75516ecfdeb77ee
commit-date: 2022-01-06
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0
Backtrace

Adding RUST_BACKTRACE=1 did not produce any additional output.

@aaronddavies aaronddavies added the C-bug Category: This is a bug. label Feb 2, 2022
@compiler-errors
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants