about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr/nixexpr.hh')
-rw-r--r--third_party/nix/src/libexpr/nixexpr.hh8
1 files changed, 2 insertions, 6 deletions
diff --git a/third_party/nix/src/libexpr/nixexpr.hh b/third_party/nix/src/libexpr/nixexpr.hh
index 0bf5245181ec..7ec6f7f17f39 100644
--- a/third_party/nix/src/libexpr/nixexpr.hh
+++ b/third_party/nix/src/libexpr/nixexpr.hh
@@ -1,6 +1,7 @@
 #pragma once
 
 #include <map>
+#include <variant>
 
 #include "libexpr/symbol-table.hh"
 #include "libexpr/value.hh"
@@ -60,12 +61,7 @@ class EvalState;
 struct StaticEnv;
 
 /* An attribute path is a sequence of attribute names. */
-struct AttrName {
-  Symbol symbol;
-  Expr* expr;
-  AttrName(const Symbol& s) : symbol(s){};
-  AttrName(Expr* e) : expr(e){};
-};
+using AttrName = std::variant<Symbol, Expr*>;
 
 typedef std::vector<AttrName> AttrPath;