File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -112,11 +112,35 @@ macro_rules! from_str_float_impl {
112112 /// * '2.5E10', or equivalently, '2.5e10'
113113 /// * '2.5E-10'
114114 /// * '5.'
115- /// * '.5', or, equivalently, '0.5'
115+ /// * '.5', or, equivalently, '0.5'
116116 /// * 'inf', '-inf', 'NaN'
117117 ///
118118 /// Leading and trailing whitespace represent an error.
119119 ///
120+ /// # Grammar
121+ ///
122+ /// All strings that adhere to the following [EBNF] grammar
123+ /// will result in an [`Ok`] being returned:
124+ ///
125+ /// ```txt
126+ /// Float ::= Sign? ( 'inf' | 'NaN' | Number )
127+ /// Number ::= ( Digit+ |
128+ /// Digit+ '.' Digit* |
129+ /// Digit* '.' Digit+ ) Exp?
130+ /// Exp ::= [eE] Sign? Digit+
131+ /// Sign ::= [+-]
132+ /// Digit ::= [0-9]
133+ /// ```
134+ ///
135+ /// [EBNF]: https://www.w3.org/TR/REC-xml/#sec-notation
136+ ///
137+ /// # Known bugs
138+ ///
139+ /// In some situations, some strings that should create a valid float
140+ /// instead return an error. See [issue #31407] for details.
141+ ///
142+ /// [issue #31407]: https://github.com/rust-lang/rust/issues/31407
143+ ///
120144 /// # Arguments
121145 ///
122146 /// * src - A string
You can’t perform that action at this time.
0 commit comments