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.
Backport PR rust-lang#4730 (rust-lang#5390)
* Backport PR rust-lang#4730 that fix issue rust-lang#4689 * Test files for each Verion One and Two * Simplify per review comment - use defer and matches! * Changes per reviewer comments for reducing indentations
- Loading branch information
1 parent
a67d909
commit ea017d7
Showing
5 changed files
with
639 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
// rustfmt-version: One | ||
|
||
// Based on the issue description | ||
pub trait PrettyPrinter<'tcx>: | ||
Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> + fmt::Write | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> + fmt::Write1 + fmt::Write2 | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
fmt::Write + Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
fmt::Write + Printer1< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> + Printer2< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> | ||
{ | ||
// | ||
} | ||
|
||
// Some test cases to ensure other cases formatting were not changed | ||
fn f() -> Box< | ||
FnMut() -> Thing< | ||
WithType = LongItemName, | ||
Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger, | ||
>, | ||
> { | ||
} | ||
fn f() -> Box< | ||
FnMut() -> Thing< | ||
WithType = LongItemName, | ||
Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger, | ||
> + fmt::Write1 | ||
+ fmt::Write2, | ||
> { | ||
} | ||
|
||
fn foo<F>(foo2: F) | ||
where | ||
F: Fn( | ||
// this comment is deleted | ||
) | ||
{ | ||
} | ||
fn foo<F>(foo2: F) | ||
where | ||
F: Fn( | ||
// this comment is deleted | ||
) + fmt::Write | ||
{ | ||
} | ||
|
||
fn elaborate_bounds<F>(mut mk_cand: F) | ||
where | ||
F: for<> FnMut( | ||
&mut ProbeContext<>, | ||
ty::PolyTraitRefffffffffffffffffffffffffffffffff<>, | ||
tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem, | ||
), | ||
{ | ||
} | ||
fn elaborate_bounds<F>(mut mk_cand: F) | ||
where | ||
F: for<> FnMut( | ||
&mut ProbeContext<>, | ||
ty::PolyTraitRefffffffffffffffffffffffffffffffff<>, | ||
tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem, | ||
) + fmt::Write, | ||
{ | ||
} | ||
|
||
fn build_sorted_static_get_entry_names( | ||
mut entries: entryyyyyyyy, | ||
) -> ( | ||
impl Fn( | ||
AlphabeticalTraversal, | ||
Seconddddddddddddddddddddddddddddddddddd | ||
) -> Parammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm | ||
+ Sendddddddddddddddddddddddddddddddddddddddddddd | ||
) { | ||
} | ||
|
||
pub trait SomeTrait: | ||
Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | ||
+ Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq | ||
{ | ||
} | ||
|
||
trait B = where | ||
for<'b> &'b Self: Send | ||
+ Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | ||
+ Copyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy; |
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,149 @@ | ||
// rustfmt-version: Two | ||
|
||
// Based on the issue description | ||
pub trait PrettyPrinter<'tcx>: | ||
Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> + fmt::Write | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> + fmt::Write1 + fmt::Write2 | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
fmt::Write + Printer< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> | ||
{ | ||
// | ||
} | ||
pub trait PrettyPrinter<'tcx>: | ||
fmt::Write + Printer1< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> + Printer2< | ||
'tcx, | ||
Error = fmt::Error, | ||
Path = Self, | ||
Region = Self, | ||
Type = Self, | ||
DynExistential = Self, | ||
Const = Self, | ||
> | ||
{ | ||
// | ||
} | ||
|
||
// Some test cases to ensure other cases formatting were not changed | ||
fn f() -> Box< | ||
FnMut() -> Thing< | ||
WithType = LongItemName, | ||
Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger, | ||
>, | ||
> { | ||
} | ||
fn f() -> Box< | ||
FnMut() -> Thing< | ||
WithType = LongItemName, | ||
Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger, | ||
> + fmt::Write1 | ||
+ fmt::Write2, | ||
> { | ||
} | ||
|
||
fn foo<F>(foo2: F) | ||
where | ||
F: Fn( | ||
// this comment is deleted | ||
) | ||
{ | ||
} | ||
fn foo<F>(foo2: F) | ||
where | ||
F: Fn( | ||
// this comment is deleted | ||
) + fmt::Write | ||
{ | ||
} | ||
|
||
fn elaborate_bounds<F>(mut mk_cand: F) | ||
where | ||
F: for<> FnMut( | ||
&mut ProbeContext<>, | ||
ty::PolyTraitRefffffffffffffffffffffffffffffffff<>, | ||
tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem, | ||
), | ||
{ | ||
} | ||
fn elaborate_bounds<F>(mut mk_cand: F) | ||
where | ||
F: for<> FnMut( | ||
&mut ProbeContext<>, | ||
ty::PolyTraitRefffffffffffffffffffffffffffffffff<>, | ||
tyyyyyyyyyyyyyyyyyyyyy::AssociatedItem, | ||
) + fmt::Write, | ||
{ | ||
} | ||
|
||
fn build_sorted_static_get_entry_names( | ||
mut entries: entryyyyyyyy, | ||
) -> ( | ||
impl Fn( | ||
AlphabeticalTraversal, | ||
Seconddddddddddddddddddddddddddddddddddd | ||
) -> Parammmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm | ||
+ Sendddddddddddddddddddddddddddddddddddddddddddd | ||
) { | ||
} | ||
|
||
pub trait SomeTrait: | ||
Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | ||
+ Eqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq | ||
{ | ||
} | ||
|
||
trait B = where | ||
for<'b> &'b Self: Send | ||
+ Cloneeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee | ||
+ Copyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy; |
Oops, something went wrong.