forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#72492 - JohnTitor:add-tests, r=matthewjasper
Add some regression tests Closes rust-lang#69415 Closes rust-lang#72455 r? @matthewjasper
- Loading branch information
Showing
3 changed files
with
46 additions
and
16 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/test/ui/feature-gates/feature-gate-associated_type_bounds.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
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,27 @@ | ||
// check-pass | ||
|
||
pub trait ResultExt { | ||
type Ok; | ||
fn err_eprint_and_ignore(self) -> Option<Self::Ok>; | ||
} | ||
|
||
impl<O, E> ResultExt for std::result::Result<O, E> | ||
where | ||
E: std::error::Error, | ||
{ | ||
type Ok = O; | ||
fn err_eprint_and_ignore(self) -> Option<O> | ||
where | ||
Self: , | ||
{ | ||
match self { | ||
Err(e) => { | ||
eprintln!("{}", e); | ||
None | ||
} | ||
Ok(o) => Some(o), | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |