public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] resolve: Add ResolveExpr::funny_error
@ 2023-04-18 16:45 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2023-04-18 16:45 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:3bd09533b321ec7f47c95356e146619e9d861836
commit 3bd09533b321ec7f47c95356e146619e9d861836
Author: Sergey Bugaev <bugaevc@gmail.com>
Date: Mon Apr 3 18:51:58 2023 +0300
resolve: Add ResolveExpr::funny_error
...and thread it through the constructors and the ResolveExpr::go ()
method.
This will be used for implementing the "break rust" Easter egg.
gcc/rust/ChangeLog:
* resolve/rust-ast-resolve-expr.h,
resolve/rust-ast-resolve-expr.cc: Add ResolveExpr::funny_error
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Diff:
---
gcc/rust/resolve/rust-ast-resolve-expr.cc | 10 ++++++----
gcc/rust/resolve/rust-ast-resolve-expr.h | 6 ++++--
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.cc b/gcc/rust/resolve/rust-ast-resolve-expr.cc
index 6486fde773c..82ec2485d71 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.cc
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.cc
@@ -29,9 +29,9 @@ namespace Resolver {
void
ResolveExpr::go (AST::Expr *expr, const CanonicalPath &prefix,
- const CanonicalPath &canonical_prefix)
+ const CanonicalPath &canonical_prefix, bool funny_error)
{
- ResolveExpr resolver (prefix, canonical_prefix);
+ ResolveExpr resolver (prefix, canonical_prefix, funny_error);
expr->accept_vis (resolver);
}
@@ -674,8 +674,10 @@ ResolveExpr::resolve_closure_param (AST::ClosureParam ¶m,
}
ResolveExpr::ResolveExpr (const CanonicalPath &prefix,
- const CanonicalPath &canonical_prefix)
- : ResolverBase (), prefix (prefix), canonical_prefix (canonical_prefix)
+ const CanonicalPath &canonical_prefix,
+ bool funny_error)
+ : ResolverBase (), prefix (prefix), canonical_prefix (canonical_prefix),
+ funny_error (funny_error)
{}
} // namespace Resolver
diff --git a/gcc/rust/resolve/rust-ast-resolve-expr.h b/gcc/rust/resolve/rust-ast-resolve-expr.h
index 3c73a892ebf..2011903ba7e 100644
--- a/gcc/rust/resolve/rust-ast-resolve-expr.h
+++ b/gcc/rust/resolve/rust-ast-resolve-expr.h
@@ -31,7 +31,8 @@ class ResolveExpr : public ResolverBase
public:
static void go (AST::Expr *expr, const CanonicalPath &prefix,
- const CanonicalPath &canonical_prefix);
+ const CanonicalPath &canonical_prefix,
+ bool funny_error = false);
void visit (AST::TupleIndexExpr &expr) override;
void visit (AST::TupleExpr &expr) override;
@@ -84,10 +85,11 @@ protected:
private:
ResolveExpr (const CanonicalPath &prefix,
- const CanonicalPath &canonical_prefix);
+ const CanonicalPath &canonical_prefix, bool funny_error);
const CanonicalPath &prefix;
const CanonicalPath &canonical_prefix;
+ bool funny_error;
};
} // namespace Resolver
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-18 16:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-18 16:45 [gcc/devel/rust/master] resolve: Add ResolveExpr::funny_error Thomas Schwinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).