-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return
ErrorGuaranteed
from items_of_instance
query
Signed-off-by: FedericoBruzzone <federico.bruzzone.i@gmail.com>
- Loading branch information
1 parent
e347b48
commit e860813
Showing
9 changed files
with
100 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//@ check-pass | ||
|
||
fn pass_to_ptr_call<T>(f: fn(T), x: T) { | ||
f(x); | ||
} | ||
|
||
trait TrackedTrait { | ||
fn trait_tracked_unit_default(_: ()) { | ||
let location = std::panic::Location::caller(); | ||
assert_eq!(location.file(), file!()); | ||
} | ||
} | ||
|
||
impl TrackedTrait for () {} | ||
|
||
fn main() { | ||
pass_to_ptr_call(<() as TrackedTrait>::trait_tracked_unit_default, ()); | ||
} |
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,15 @@ | ||
//@ check-pass | ||
|
||
trait Foo<T> { | ||
fn print<'a>(&'a self) where T: 'a { println!("foo"); } | ||
} | ||
|
||
impl<'a> Foo<&'a ()> for () { } | ||
|
||
trait Bar: for<'a> Foo<&'a ()> { } | ||
|
||
impl Bar for () {} | ||
|
||
fn main() { | ||
(&() as &dyn Bar).print(); | ||
} |
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 @@ | ||
//@ check-pass | ||
|
||
// When -Zprint-mono-items=eager option was used, the following | ||
// code previously caused an ICE. | ||
|
||
pub struct S(); | ||
|
||
pub trait X { | ||
fn unused3(var: i32) { | ||
println!("{}", var); | ||
} | ||
} | ||
|
||
impl X for S {} | ||
|
||
fn main() {} |