mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Auto merge of #28247 - christopherdumas:fix_28243, r=eddyb
as per #28243.
This commit is contained in:
commit
bc6c3970a0
@ -2365,7 +2365,7 @@ impl<'a> Parser<'a> {
|
|||||||
self.fileline_help(last_span,
|
self.fileline_help(last_span,
|
||||||
&format!("try parenthesizing the first index; e.g., `(foo.{}){}`",
|
&format!("try parenthesizing the first index; e.g., `(foo.{}){}`",
|
||||||
float.trunc() as usize,
|
float.trunc() as usize,
|
||||||
&float.fract().to_string()[1..]));
|
format!(".{}", fstr.splitn(2, ".").last().unwrap())));
|
||||||
}
|
}
|
||||||
self.abort_if_errors();
|
self.abort_if_errors();
|
||||||
|
|
||||||
|
16
src/test/parse-fail/tuple-float-index.rs
Normal file
16
src/test/parse-fail/tuple-float-index.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
||||||
|
// file at the top-level directory of this distribution and at
|
||||||
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||||
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||||
|
// option. This file may not be copied, modified, or distributed
|
||||||
|
// except according to those terms.
|
||||||
|
|
||||||
|
// compile-flags: -Z parse-only
|
||||||
|
|
||||||
|
fn main () {
|
||||||
|
(1, (2, 3)).1.1; //~ ERROR unexpected token
|
||||||
|
//~^ HELP try parenthesizing the first index; e.g., `(foo.1).1`
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user