Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/ast/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2414,6 +2414,30 @@ impl Log {
})
}

/// `add_warning`, with `AddErrorOptions`. Use when the offending source line can
/// contain a credential: `redact_sensitive_information` masks the value in the frame.
#[cold]
pub fn add_warning_opts(&mut self, text: Str, opts: AddErrorOptions<'_>) {
if !Kind::Warn.should_print(self.level) {
return;
}
self.warnings += 1;
let data = self.tracked_range_data(
opts.source,
Range {
loc: opts.loc,
len: opts.len,
},
text,
);
self.add_msg(Msg {
kind: Kind::Warn,
data,
redact_sensitive_information: opts.redact_sensitive_information,
..Default::default()
})
}
Comment thread
robobun marked this conversation as resolved.
Outdated

// TODO(dylan-conway): rename and replace `addError`
#[cold]
pub fn add_error_opts(&mut self, text: Str, opts: AddErrorOptions<'_>) {
Expand Down
Loading
Loading