diff options
| author | MarcusGrass <34198073+MarcusGrass@users.noreply.github.com> | 2024-03-05 04:19:57 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-04 22:19:57 -0500 |
| commit | 73c81495cdb03d1fb73dd4313466c146ca8f4d98 (patch) | |
| tree | b3da1c816d00139a38d15c60b24cf26234ebd089 /tests | |
| parent | 35c1b7d734e1132073c1fd578bda0843641cb8e7 (diff) | |
| download | rust-73c81495cdb03d1fb73dd4313466c146ca8f4d98.tar.gz rust-73c81495cdb03d1fb73dd4313466c146ca8f4d98.zip | |
Ensure space after binary exprs that ends with `.` before range expr
Removing the space would lead to compilation errors.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/source/issue-6059/repro.rs | 3 | ||||
| -rw-r--r-- | tests/target/issue-6059/additional.rs | 6 | ||||
| -rw-r--r-- | tests/target/issue-6059/repro.rs | 3 |
3 files changed, 12 insertions, 0 deletions
diff --git a/tests/source/issue-6059/repro.rs b/tests/source/issue-6059/repro.rs new file mode 100644 index 00000000000..1dc62cc8d26 --- /dev/null +++ b/tests/source/issue-6059/repro.rs @@ -0,0 +1,3 @@ +fn float_range_tests() { + self.coords.x -= rng.gen_range(-self.radius / 2. .. self.radius / 2.); +} diff --git a/tests/target/issue-6059/additional.rs b/tests/target/issue-6059/additional.rs new file mode 100644 index 00000000000..fe708dcbdd3 --- /dev/null +++ b/tests/target/issue-6059/additional.rs @@ -0,0 +1,6 @@ +fn float_range_tests() { + let _range = 3. / 2. ..4.; + let _range = 3.0 / 2. ..4.0; + let _range = 3.0 / 2.0..4.0; + let _range = 3. / 2.0..4.0; +} diff --git a/tests/target/issue-6059/repro.rs b/tests/target/issue-6059/repro.rs new file mode 100644 index 00000000000..e8744c9ffcf --- /dev/null +++ b/tests/target/issue-6059/repro.rs @@ -0,0 +1,3 @@ +fn float_range_tests() { + self.coords.x -= rng.gen_range(-self.radius / 2. ..self.radius / 2.); +} |
