-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gccrs: self paths are patterns but we dont have mappings for it
With simple patterns we dont introduce any more inference varaibles as they are already declared in a specific way. This would only lead to more unconstrained inference varaibles than is required. Fixes #3022 gcc/rust/ChangeLog: * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_self): add location mappings * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): check for self gcc/testsuite/ChangeLog: * rust/compile/issue-3022.rs: New test. Signed-off-by: Philip Herron <[email protected]>
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
trait Foo<T> { | ||
fn foo(self) -> T; | ||
} | ||
|
||
struct Bar<T, U> { | ||
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } | ||
value: U, | ||
valte: T, | ||
} | ||
|
||
impl<T: Foo<U>, U> Foo<U> for Bar<T, U> { | ||
fn foo(self) -> U { | ||
self.value | ||
} | ||
} |