Skip to content

Commit 3f876bc

Browse files
authored
Merge pull request #14231 from roberth/code-docs
Code docs
2 parents f770947 + 48a5e2d commit 3f876bc

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

src/libexpr/include/nix/expr/eval.hh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,15 @@ private:
508508

509509
public:
510510

511+
/**
512+
* @param lookupPath Only used during construction.
513+
* @param store The store to use for instantiation
514+
* @param fetchSettings Must outlive the lifetime of this EvalState!
515+
* @param settings Must outlive the lifetime of this EvalState!
516+
* @param buildStore The store to use for builds ("import from derivation", C API `nix_string_realise`)
517+
*/
511518
EvalState(
512-
const LookupPath & _lookupPath,
519+
const LookupPath & lookupPath,
513520
ref<Store> store,
514521
const fetchers::Settings & fetchSettings,
515522
const EvalSettings & settings,

src/libutil/include/nix/util/error.hh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,27 @@ public:
192192
err.traces.push_front(trace);
193193
}
194194

195+
/**
196+
* Prepends an item to the error trace, as is usual for extra context.
197+
*
198+
* @param pos Nullable source position to put in trace item
199+
* @param fs Format string, see `HintFmt`
200+
* @param args... Format string arguments.
201+
*/
195202
template<typename... Args>
196-
void addTrace(std::shared_ptr<const Pos> && e, std::string_view fs, const Args &... args)
203+
void addTrace(std::shared_ptr<const Pos> && pos, std::string_view fs, const Args &... args)
197204
{
198-
addTrace(std::move(e), HintFmt(std::string(fs), args...));
205+
addTrace(std::move(pos), HintFmt(std::string(fs), args...));
199206
}
200207

201-
void addTrace(std::shared_ptr<const Pos> && e, HintFmt hint, TracePrint print = TracePrint::Default);
208+
/**
209+
* Prepends an item to the error trace, as is usual for extra context.
210+
*
211+
* @param pos Nullable source position to put in trace item
212+
* @param hint Formatted error message
213+
* @param print Optional, whether to always print (used by `addErrorContext`)
214+
*/
215+
void addTrace(std::shared_ptr<const Pos> && pos, HintFmt hint, TracePrint print = TracePrint::Default);
202216

203217
bool hasTrace() const
204218
{

0 commit comments

Comments
 (0)