-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1037: Support placeholders becoming slices r=philberty a=philberty When we setup trait-impls the type-alias are allowed to become any type this interface was missing a visitor. We also need to support constraining type-parameters behind slices. The get_root interface is currently unsafe, it needs a flag for allowing unsized and for keeping a map of adjustments along the way. This will be added down the line when we support unsized method resolution. Fixes #1034 Addresses #849 Co-authored-by: Philip Herron <philip.herron@embecosm.com>
- Loading branch information
Showing
5 changed files
with
32 additions
and
3 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
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,16 @@ | ||
trait Foo<T> { | ||
type Output; | ||
|
||
fn test(self, slice: &T) -> &Self::Output; | ||
} | ||
|
||
struct Bar<T>(T); | ||
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 } | ||
|
||
impl<T> Foo<[T]> for Bar<usize> { | ||
type Output = [T]; | ||
|
||
fn test(self, slice: &[T]) -> &[T] { | ||
slice | ||
} | ||
} |