Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d51e703
As Windows 10 requires certain features like CMPXCHG16B and a few oth…
CKingX Feb 9, 2024
d6766e2
Update x86_64_pc_windows_msvc.rs
CKingX Feb 9, 2024
fcb06f7
Update x86_64_pc_windows_msvc.rs
CKingX Feb 9, 2024
abeac8f
Update x86_64_uwp_windows_gnu.rs
CKingX Feb 9, 2024
1c6dda7
Possibly removed merge policy
CKingX Feb 9, 2024
376c7b9
Added sahf feature to windows targets
CKingX Feb 13, 2024
2d25c3b
Updated test to account for added previous features (thanks erikdesja…
CKingX Feb 20, 2024
2fc091f
Use volatile to make `p_thread_callback` used
ChrisDenton Feb 24, 2024
ad4c4f4
Remove _tls_used trickery unless needed
ChrisDenton Feb 24, 2024
205319d
Skip unnecessary comparison with half-open ranges
Nadrieril Feb 20, 2024
7c6960e
Document invariant in `thir::PatRange`
Nadrieril Feb 27, 2024
be01e28
Push down the decision to skip fields
Nadrieril Feb 6, 2024
ab06037
Push the decision to skip fields further down
Nadrieril Feb 6, 2024
4f7f067
Add special `Skip` constructor
Nadrieril Feb 6, 2024
ea38166
Don't filter out skipped fields
Nadrieril Feb 6, 2024
39441e4
Simplify
Nadrieril Feb 6, 2024
c918893
Rename `Skip` to `PrivateUninhabited`
Nadrieril Feb 28, 2024
c4ec196
Don't cancel stashed `OpaqueHiddenTypeMismatch` errors.
nnethercote Feb 26, 2024
ec25d6d
Don't cancel stashed `TraitMissingMethod` errors.
nnethercote Feb 26, 2024
260ae70
Overhaul how stashed diagnostics work, again.
nnethercote Feb 26, 2024
b4e9f93
Mark some once-again-unreachable paths as unreachable.
nnethercote Feb 27, 2024
9aff357
Stop miri if delayed bugs are present.
nnethercote Feb 27, 2024
82961c0
Reinstate `emit_stashed_diagnostics` in `DiagCtxtInner::drop`.
nnethercote Feb 28, 2024
c1f0163
Minor visibility and formatting improvements.
nnethercote Feb 28, 2024
869bd03
Simplify `UnusedExterns` lifetimes.
nnethercote Feb 28, 2024
3c3f15c
Use `Destination` more.
nnethercote Feb 28, 2024
805e50e
Remove unnecessary `diagnostic_width` call.
nnethercote Feb 29, 2024
ca5b79d
Remove unnecessary `output` local variable.
nnethercote Feb 29, 2024
f9eef38
Inline and remove `DiagCtxt::with_tty_emitter`
nnethercote Feb 29, 2024
880c1c5
Rename `DiagCtxt::with_emitter` as `DiagCtxt::new`.
nnethercote Feb 29, 2024
d372741
Merge HumanEmitter::{new,create}.
nnethercote Feb 28, 2024
437325b
Inline and remove `HumanReadableErrorType::new_emitter`.
nnethercote Feb 29, 2024
067d7c3
Inline and remove `HumanEmitter::stderr`.
nnethercote Feb 29, 2024
2999d8d
Inline and remove `JsonEmitter::{basic,stderr}`.
nnethercote Feb 28, 2024
9ff4487
Make `JsonEmitter` more like `HumanEmitter`.
nnethercote Feb 29, 2024
58f4505
Add a useful comment.
nnethercote Feb 29, 2024
607bf65
Avoid unnecessary `color` local variable.
nnethercote Feb 29, 2024
36bd9ef
Rollup merge of #120820 - CKingX:cpu-base-minimum, r=petrochenkov,Chr…
GuillaumeGomez Feb 29, 2024
9df7f26
Rollup merge of #121000 - Nadrieril:keep_all_fields, r=compiler-errors
GuillaumeGomez Feb 29, 2024
2e0a26a
Rollup merge of #121376 - Nadrieril:mir-half-ranges, r=pnkfelix
GuillaumeGomez Feb 29, 2024
eea8cee
Rollup merge of #121596 - ChrisDenton:tls, r=joboet
GuillaumeGomez Feb 29, 2024
a5945b5
Rollup merge of #121669 - nnethercote:count-stashed-errs-again, r=est…
GuillaumeGomez Feb 29, 2024
0e9f02d
Rollup merge of #121783 - nnethercote:emitter-cleanups, r=oli-obk
GuillaumeGomez Feb 29, 2024
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
Prev Previous commit
Next Next commit
Rename DiagCtxt::with_emitter as DiagCtxt::new.
Because it's now the only constructor.
  • Loading branch information
nnethercote committed Feb 29, 2024
commit 880c1c585f1252a8b63b402b44def940cac6f134
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ pub struct CodegenContext<B: WriteBackendMethods> {

impl<B: WriteBackendMethods> CodegenContext<B> {
pub fn create_dcx(&self) -> DiagCtxt {
DiagCtxt::with_emitter(Box::new(self.diag_emitter.clone()))
DiagCtxt::new(Box::new(self.diag_emitter.clone()))
}

pub fn config(&self, kind: ModuleKind) -> &ModuleConfig {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_driver_impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ fn report_ice(
rustc_errors::ColorConfig::Auto,
fallback_bundle,
));
let dcx = rustc_errors::DiagCtxt::with_emitter(emitter);
let dcx = rustc_errors::DiagCtxt::new(emitter);

// a .span_bug or .bug call has already printed what
// it wants to print.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/json/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() },
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn create_test_handler() -> (DiagCtxt, Lrc<SourceMap>, Arc<Mutex<Vec<u8>>>) {
let emitter = HumanEmitter::new(Box::new(Shared { data: output.clone() }), fallback_bundle)
.sm(Some(source_map.clone()))
.diagnostic_width(Some(140));
let dcx = DiagCtxt::with_emitter(Box::new(emitter));
let dcx = DiagCtxt::new(Box::new(emitter));
(dcx, source_map, output)
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_session/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ impl ParseSess {
let sm = Lrc::new(SourceMap::new(file_path_mapping));
let emitter =
Box::new(HumanEmitter::stderr(ColorConfig::Auto, fallback_bundle).sm(Some(sm.clone())));
let dcx = DiagCtxt::with_emitter(emitter);
let dcx = DiagCtxt::new(emitter);
ParseSess::with_dcx(dcx, sm)
}

Expand Down Expand Up @@ -269,9 +269,9 @@ impl ParseSess {
let fallback_bundle = fallback_fluent_bundle(Vec::new(), false);
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let emitter = Box::new(HumanEmitter::stderr(ColorConfig::Auto, fallback_bundle));
let fatal_dcx = DiagCtxt::with_emitter(emitter);
let dcx = DiagCtxt::with_emitter(Box::new(SilentEmitter { fatal_dcx, fatal_note }))
.disable_warnings();
let fatal_dcx = DiagCtxt::new(emitter);
let dcx =
DiagCtxt::new(Box::new(SilentEmitter { fatal_dcx, fatal_note })).disable_warnings();
ParseSess::with_dcx(dcx, sm)
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_session/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,8 +1080,8 @@ pub fn build_session(
);
let emitter = default_emitter(&sopts, registry, source_map.clone(), bundle, fallback_bundle);

let mut dcx = DiagCtxt::with_emitter(emitter)
.with_flags(sopts.unstable_opts.dcx_flags(can_emit_warnings));
let mut dcx =
DiagCtxt::new(emitter).with_flags(sopts.unstable_opts.dcx_flags(can_emit_warnings));
if let Some(ice_file) = ice_file {
dcx = dcx.with_ice_file(ice_file);
}
Expand Down Expand Up @@ -1402,7 +1402,7 @@ pub struct EarlyDiagCtxt {
impl EarlyDiagCtxt {
pub fn new(output: ErrorOutputType) -> Self {
let emitter = mk_emitter(output);
Self { dcx: DiagCtxt::with_emitter(emitter) }
Self { dcx: DiagCtxt::new(emitter) }
}

/// Swap out the underlying dcx once we acquire the user's preference on error emission
Expand All @@ -1412,7 +1412,7 @@ impl EarlyDiagCtxt {
self.dcx.abort_if_errors();

let emitter = mk_emitter(output);
self.dcx = DiagCtxt::with_emitter(emitter);
self.dcx = DiagCtxt::new(emitter);
}

#[allow(rustc::untranslatable_diagnostic)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ pub(crate) fn new_dcx(
}
};

rustc_errors::DiagCtxt::with_emitter(emitter).with_flags(unstable_opts.dcx_flags(true))
rustc_errors::DiagCtxt::new(emitter).with_flags(unstable_opts.dcx_flags(true))
}

/// Parse, resolve, and typecheck the given crate.
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ pub(crate) fn make_test(
let emitter = HumanEmitter::new(Box::new(io::sink()), fallback_bundle);

// FIXME(misdreavus): pass `-Z treat-err-as-bug` to the doctest parser
let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
let dcx = DiagCtxt::new(Box::new(emitter)).disable_warnings();
let sess = ParseSess::with_dcx(dcx, sm);

let mut found_main = false;
Expand Down Expand Up @@ -767,7 +767,7 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> bool {

let emitter = HumanEmitter::new(Box::new(io::sink()), fallback_bundle);

let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
let dcx = DiagCtxt::new(Box::new(emitter)).disable_warnings();
let sess = ParseSess::with_dcx(dcx, sm);
let mut parser =
match maybe_new_parser_from_source_str(&sess, filename, source.to_owned()) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/passes/lint/check_code_block_syntax.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn check_rust_syntax(
let emitter = BufferEmitter { buffer: Lrc::clone(&buffer), fallback_bundle };

let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
let dcx = DiagCtxt::new(Box::new(emitter)).disable_warnings();
let source = dox[code_block.code].to_owned();
let sess = ParseSess::with_dcx(dcx, sm);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn check(
let fallback_bundle =
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
let emitter = HumanEmitter::new(Box::new(io::sink()), fallback_bundle);
let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
let dcx = DiagCtxt::new(Box::new(emitter)).disable_warnings();
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let sess = ParseSess::with_dcx(dcx, sm);
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rustfmt/src/parse/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ fn default_dcx(
);
Box::new(HumanEmitter::stderr(emit_color, fallback_bundle).sm(Some(source_map.clone())))
};
DiagCtxt::with_emitter(Box::new(SilentOnIgnoredFilesEmitter {
DiagCtxt::new(Box::new(SilentOnIgnoredFilesEmitter {
has_non_ignorable_parser_errors: false,
source_map,
emitter,
Expand Down Expand Up @@ -235,7 +235,7 @@ impl ParseSess {
}

pub(crate) fn set_silent_emitter(&mut self) {
self.parse_sess.dcx = DiagCtxt::with_emitter(silent_emitter());
self.parse_sess.dcx = DiagCtxt::new(silent_emitter());
}

pub(crate) fn span_to_filename(&self, span: Span) -> FileName {
Expand Down