Rename DiagCtxt::with_emitter as DiagCtxt::new.

Because it's now the only constructor.
This commit is contained in:
Nicholas Nethercote 2024-02-29 11:50:32 +11:00
parent f9eef38e32
commit 880c1c585f
12 changed files with 20 additions and 20 deletions

View file

@ -61,7 +61,7 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) {
);
let span = Span::with_root_ctxt(BytePos(span.0), BytePos(span.1));
let dcx = DiagCtxt::with_emitter(Box::new(je));
let dcx = DiagCtxt::new(Box::new(je));
dcx.span_err(span, "foo");
let bytes = output.lock().unwrap();

View file

@ -601,7 +601,7 @@ impl DiagCtxt {
self
}
pub fn with_emitter(emitter: Box<DynEmitter>) -> Self {
pub fn new(emitter: Box<DynEmitter>) -> Self {
Self {
inner: Lock::new(DiagCtxtInner {
flags: DiagCtxtFlags { can_emit_warnings: true, ..Default::default() },