-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some more error handling to generics
Check for wrong number of arguments and fix crash with invalid Type specified as generic argument.
- Loading branch information
Showing
9 changed files
with
63 additions
and
7 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,9 @@ | ||
struct GenericStruct<T>(T, usize); | ||
|
||
fn main() { | ||
let a2: GenericStruct<i8>; | ||
a2 = GenericStruct::<_>(1, 456); | ||
|
||
let b2: i32 = a2.0; | ||
let c2: usize = a2.1; | ||
} |
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,9 @@ | ||
struct GenericStruct<T>(T, usize); | ||
|
||
fn main() { | ||
let a2: GenericStruct<i8>; | ||
a2 = GenericStruct(1, 456); | ||
|
||
let b2: i32 = a2.0; | ||
let c2: usize = a2.1; | ||
} |
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,9 @@ | ||
struct GenericStruct<T>(T, usize); | ||
|
||
fn main() { | ||
let a2; | ||
a2 = GenericStruct::<i8>(1, 456); | ||
|
||
let b2: i32 = a2.0; | ||
let c2: usize = a2.1; | ||
} |
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,9 @@ | ||
struct GenericStruct<T>(T, usize); | ||
|
||
fn main() { | ||
let a2; | ||
a2 = GenericStruct::<i8, i32>(1, 456); | ||
|
||
let b2: i32 = a2.0; | ||
let c2: usize = a2.1; | ||
} |
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,9 @@ | ||
struct GenericStruct<T>(T, usize); | ||
|
||
fn main() { | ||
let a2; | ||
a2 = GenericStruct::<i8, T>(1, 456); | ||
|
||
let b2: i32 = a2.0; | ||
let c2: usize = a2.1; | ||
} |