diff options
-rw-r--r-- | src/de.rs | 2 | ||||
-rw-r--r-- | test-suite/tests/invalid.rs | 2 | ||||
-rw-r--r-- | test-suite/tests/invalid/float-no-suffix.toml | 1 |
3 files changed, 5 insertions, 0 deletions
@@ -1396,6 +1396,8 @@ impl<'a> Deserializer<'a> { return Err(self.error(start, ErrorKind::NumberInvalid)); } exponent = Some(a); + } else if !suffix.is_empty() { + return Err(self.error(start, ErrorKind::NumberInvalid)); } let mut number = integral diff --git a/test-suite/tests/invalid.rs b/test-suite/tests/invalid.rs index e8015c0..7ac17d5 100644 --- a/test-suite/tests/invalid.rs +++ b/test-suite/tests/invalid.rs @@ -40,6 +40,8 @@ test!(empty_table, include_str!("invalid/empty-table.toml")); test!(float_no_leading_zero, include_str!("invalid/float-no-leading-zero.toml")); +test!(float_no_suffix, + include_str!("invalid/float-no-suffix.toml")); test!(float_no_trailing_digits, include_str!("invalid/float-no-trailing-digits.toml")); test!(key_after_array, diff --git a/test-suite/tests/invalid/float-no-suffix.toml b/test-suite/tests/invalid/float-no-suffix.toml new file mode 100644 index 0000000..76106de --- /dev/null +++ b/test-suite/tests/invalid/float-no-suffix.toml @@ -0,0 +1 @@ +a = 1.2f |