rust/src
bors 7276a6a117 Auto merge of - dtolnay:dotzero, r=petrochenkov
Append .0 to unsuffixed float if it would otherwise become int token

Previously the unsuffixed f32/f64 constructors of `proc_macro::Literal` would create literal tokens that are definitely not a float:

```rust
Literal::f32_unsuffixed(10.0)  // 10
Literal::f32_suffixed(10.0)    // 10f32
Literal::f64_unsuffixed(10.0)  // 10
Literal::f64_suffixed(10.0)    // 10f64
```

Notice that the `10` are actually integer tokens if you were to reparse them, not float tokens.

This diff updates `Literal::f32_unsuffixed` and `Literal::f64_unsuffixed` to produce tokens that unambiguously parse as a float. This matches longstanding behavior of the proc-macro2 crate's implementation of these APIs dating back at least 3.5 years, so it's likely an unobjectionable behavior.

```rust
Literal::f32_unsuffixed(10.0)  // 10.0
Literal::f32_suffixed(10.0)    // 10f32
Literal::f64_unsuffixed(10.0)  // 10.0
Literal::f64_suffixed(10.0)    // 10f64
```

Fixes https://github.com/dtolnay/syn/issues/1085.
2021-11-06 07:15:05 +00:00
..
bootstrap Provide standalone libc.a in self-contained for musl and wasi 2021-11-03 21:12:15 +08:00
build_helper
ci Pull in libkvm on FreeBSD 2021-11-02 10:44:14 +02:00
doc Mention possible future rejections 2021-11-04 11:31:03 -04:00
etc
librustdoc Auto merge of - willcrichton:example-analyzer, r=jyn514 2021-11-05 19:05:36 +00:00
llvm-project@a7348ae0df Update to the final LLVM 13.0.0 release 2021-10-01 21:06:19 -07:00
rustdoc-json-types Moved format-version constant to rustdoc-json-types 2021-10-15 12:27:42 +03:00
test Auto merge of - dtolnay:dotzero, r=petrochenkov 2021-11-06 07:15:05 +00:00
tools Rollup merge of - wesleywiser:fix_only_i686_tests, r=Mark-Simulacrum 2021-11-05 21:12:28 +01:00
README.md
stage0.json bump boostrap compiler 2021-10-23 21:55:57 -04:00
version bump version to rust 1.58.0 2021-10-17 16:04:44 +02:00

This directory contains the source code of the rust project, including:

  • The test suite
  • The bootstrapping build system
  • Various submodules for tools, like rustdoc, rls, etc.

For more information on how various parts of the compiler work, see the rustc dev guide.