summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2015-01-28 14:27:28 +1300
committerNick Cameron <ncameron@mozilla.com>2015-01-30 12:00:20 +1300
commita9d465fec902588b71937de96e66d160d2adebf5 (patch)
treef82484ce9849bd594796f0fcb1e2c51722b87a53 /src/libsyntax/parse/parser.rs
parent7ea93abfb2c11111496d6e1f5b82fc21c2da27ad (diff)
downloadrust-a9d465fec902588b71937de96e66d160d2adebf5.tar.gz
rust-a9d465fec902588b71937de96e66d160d2adebf5.zip
Use absolute path to FullRange, rather than assuming it is in the prelude
Closes #21263

[breaking-change]

If you are using `core::ops::FullRange` you should change to using `core::ops::RangeFull`
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 4c1ae532d13..3d65dd82643 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -2531,10 +2531,23 @@ impl<'a> Parser<'a> {
                     // FIXME(#20516) It would be better to use a lang item or
                     // something for FullRange.
                     hi = self.last_span.hi;
-                    let range = ExprStruct(ident_to_path(mk_sp(lo, hi),
-                                                         token::special_idents::FullRange),
-                                           vec![],
-                                           None);
+
+                    let idents = vec![token::str_to_ident("core"),
+                                      token::str_to_ident("ops"),
+                                      token::str_to_ident("FullRange")];
+                    let segments = idents.into_iter().map(|ident| {
+                        ast::PathSegment {
+                            identifier: ident,
+                            parameters: ast::PathParameters::none(),
+                        }
+                    }).collect();
+                    let path = ast::Path {
+                        span: mk_sp(lo, hi),
+                        global: true,
+                        segments: segments,
+                    };
+
+                    let range = ExprStruct(path, vec![], None);
                     let ix = self.mk_expr(bracket_pos, hi, range);
                     let index = self.mk_index(e, ix);
                     e = self.mk_expr(lo, hi, index)