forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#73261 - estebank:generics-sized, r=nikomats…
…akis Suggest `?Sized` when applicable for ADTs Address rust-lang#71790, fix rust-lang#27964.
- Loading branch information
Showing
17 changed files
with
352 additions
and
34 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
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
28 changes: 28 additions & 0 deletions
28
src/test/ui/suggestions/adt-param-with-implicit-sized-bound.rs
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,28 @@ | ||
trait Trait { | ||
fn func1() -> Struct1<Self>; //~ ERROR E0277 | ||
fn func2<'a>() -> Struct2<'a, Self>; //~ ERROR E0277 | ||
fn func3() -> Struct3<Self>; //~ ERROR E0277 | ||
fn func4() -> Struct4<Self>; //~ ERROR E0277 | ||
} | ||
|
||
struct Struct1<T>{ | ||
_t: std::marker::PhantomData<*const T>, | ||
} | ||
struct Struct2<'a, T>{ | ||
_t: &'a T, | ||
} | ||
struct Struct3<T>{ | ||
_t: T, | ||
} | ||
|
||
struct X<T>(T); | ||
|
||
struct Struct4<T>{ | ||
_t: X<T>, | ||
} | ||
|
||
struct Struct5<T: ?Sized>{ | ||
_t: X<T>, //~ ERROR E0277 | ||
} | ||
|
||
fn main() {} |
Oops, something went wrong.