aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-26 18:24:36 +0000
committerGitHub <noreply@github.com>2022-04-26 18:24:36 +0000
commit8b2e6da73956c8f12a4a150b5b9dcf8f1b5656ba (patch)
treeba0571c39f01d9cda7a71fa3802481659dd97e6c /gcc/rust/rust-session-manager.cc
parent0ce3b067a84cd4a44fbfcb64a1669e18ed29b7f0 (diff)
parentb3d85dc842f16513a807f404f061dbe8edb9465c (diff)
downloadgcc-8b2e6da73956c8f12a4a150b5b9dcf8f1b5656ba.zip
gcc-8b2e6da73956c8f12a4a150b5b9dcf8f1b5656ba.tar.gz
gcc-8b2e6da73956c8f12a4a150b5b9dcf8f1b5656ba.tar.bz2
Merge #1174
1174: Remove default location for `SimplePath`s r=CohenArthur a=CohenArthur This removes the default argument for the locus of `SimplePath`s. Addresses #1159 There are a lot of places in the code where it is not possible to insert a "correct" location for these `SimplePath`s: namely, when creating the use statement for the standard library's prelude, or when creating the `SimplePath`s of attributes. I've left a few FIXMEs in these cases because I'm unsure about the proper course of action. Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r--gcc/rust/rust-session-manager.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index bdab0d8..8876459 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -870,7 +870,8 @@ Session::injection (AST::Crate &crate)
{
// create "macro use" attribute for use on extern crate item to enable
// loading macros from it
- AST::Attribute attr (AST::SimplePath::from_str ("macro_use"), nullptr);
+ AST::Attribute attr (AST::SimplePath::from_str ("macro_use", Location ()),
+ nullptr);
// create "extern crate" item with the name
std::unique_ptr<AST::ExternCrate> extern_crate (
@@ -885,13 +886,15 @@ Session::injection (AST::Crate &crate)
// create use tree path
// prelude is injected_crate_name
std::vector<AST::SimplePathSegment> segments
- = {AST::SimplePathSegment (injected_crate_name),
- AST::SimplePathSegment ("prelude"), AST::SimplePathSegment ("v1")};
+ = {AST::SimplePathSegment (injected_crate_name, Location ()),
+ AST::SimplePathSegment ("prelude", Location ()),
+ AST::SimplePathSegment ("v1", Location ())};
// create use tree and decl
std::unique_ptr<AST::UseTreeGlob> use_tree (
new AST::UseTreeGlob (AST::UseTreeGlob::PATH_PREFIXED,
AST::SimplePath (std::move (segments)), Location ()));
- AST::Attribute prelude_attr (AST::SimplePath::from_str ("prelude_import"),
+ AST::Attribute prelude_attr (AST::SimplePath::from_str ("prelude_import",
+ Location ()),
nullptr);
std::unique_ptr<AST::UseDeclaration> use_decl (
new AST::UseDeclaration (std::move (use_tree),