diff options
| author | Caleb Cartwright <caleb.cartwright@outlook.com> | 2021-11-18 12:38:34 -0600 |
|---|---|---|
| committer | Caleb Cartwright <calebcartwright@users.noreply.github.com> | 2021-11-18 13:43:37 -0600 |
| commit | 0023abfb2c826d8a9ff74146ece513b22b86fdce (patch) | |
| tree | 22f5dd7de06b7f9f3f4c1fbe81f72629da31c748 | |
| parent | eee8f0419dca910187350ac38fe9694b8b7919b9 (diff) | |
| download | rust-0023abfb2c826d8a9ff74146ece513b22b86fdce.tar.gz rust-0023abfb2c826d8a9ff74146ece513b22b86fdce.zip | |
tests: add cases for type alias issues
| -rw-r--r-- | tests/source/issue_4823.rs | 5 | ||||
| -rw-r--r-- | tests/source/issue_5027.rs | 7 | ||||
| -rw-r--r-- | tests/source/issue_5086.rs | 2 | ||||
| -rw-r--r-- | tests/target/issue_4823.rs | 5 | ||||
| -rw-r--r-- | tests/target/issue_5027.rs | 17 | ||||
| -rw-r--r-- | tests/target/issue_5086.rs | 2 |
6 files changed, 38 insertions, 0 deletions
diff --git a/tests/source/issue_4823.rs b/tests/source/issue_4823.rs new file mode 100644 index 00000000000..a008dd3d838 --- /dev/null +++ b/tests/source/issue_4823.rs @@ -0,0 +1,5 @@ +macro_rules! m { +() => { +type Type; +}; +} diff --git a/tests/source/issue_5027.rs b/tests/source/issue_5027.rs new file mode 100644 index 00000000000..67beeb23b71 --- /dev/null +++ b/tests/source/issue_5027.rs @@ -0,0 +1,7 @@ +// rustfmt-version: Two + +pub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)>+ ExactSizeIterator+ 'a; + +trait FOo {pub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)>+ ExactSizeIterator+ 'a;} + +impl Bar {pub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)>+ ExactSizeIterator+ 'a;} \ No newline at end of file diff --git a/tests/source/issue_5086.rs b/tests/source/issue_5086.rs new file mode 100644 index 00000000000..1644c9d2ccb --- /dev/null +++ b/tests/source/issue_5086.rs @@ -0,0 +1,2 @@ +#[cfg(any())] + type Type : Bound ; \ No newline at end of file diff --git a/tests/target/issue_4823.rs b/tests/target/issue_4823.rs new file mode 100644 index 00000000000..de17467c0ef --- /dev/null +++ b/tests/target/issue_4823.rs @@ -0,0 +1,5 @@ +macro_rules! m { + () => { + type Type; + }; +} diff --git a/tests/target/issue_5027.rs b/tests/target/issue_5027.rs new file mode 100644 index 00000000000..26d771720b6 --- /dev/null +++ b/tests/target/issue_5027.rs @@ -0,0 +1,17 @@ +// rustfmt-version: Two + +pub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)> + + ExactSizeIterator + + 'a; + +trait FOo { + pub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)> + + ExactSizeIterator + + 'a; +} + +impl Bar { + type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)> + + ExactSizeIterator + + 'a; +} diff --git a/tests/target/issue_5086.rs b/tests/target/issue_5086.rs new file mode 100644 index 00000000000..7a0be06f791 --- /dev/null +++ b/tests/target/issue_5086.rs @@ -0,0 +1,2 @@ +#[cfg(any())] +type Type: Bound; |
