-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gccrs: add diagnostic for E0229 no associated type arguments allowed …
…here It seems bounds in qualified paths are not allowed to specify associated type bindings because its going to be associated with the impl block anyway. Fixes #2369 gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-base.h: add flag * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): likewise * typecheck/rust-tyty-bounds.cc: new diagnostic gcc/testsuite/ChangeLog: * rust/compile/issue-2369.rs: New test. Signed-off-by: Philip Herron <[email protected]>
- Loading branch information
Showing
4 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
fn main() { | ||
pub trait Foo { | ||
type A; | ||
fn boo(&self) -> <Self as Foo>::A; | ||
} | ||
|
||
struct Bar; | ||
|
||
impl Foo for isize { | ||
type A = usize; | ||
fn boo(&self) -> usize { | ||
42 | ||
} | ||
} | ||
|
||
fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | ||
// { dg-error "associated type bindings are not allowed here .E0229." "" { target *-*-* } .-1 } | ||
} |