Skip to content

Commit 8b36867

Browse files
committed
Auto merge of #61583 - Centril:rollup-ug2cbfd, r=Centril
Rollup of 4 pull requests Successful merges: - #61556 (librustc_errors: Rename AnnotateRs -> AnnotateSnippet) - #61557 (rustbuild: Include `rustfmt` in deduplicated dependencies) - #61571 (Escape HashMap with backticks in needs_drop docs) - #61582 (submodules: update clippy from 20da8f4 to 71be6f6) Failed merges: r? @ghost
2 parents 51dc52b + 97a2acd commit 8b36867

File tree

9 files changed

+30
-22
lines changed

9 files changed

+30
-22
lines changed

src/bootstrap/tool.rs

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl Step for ToolBuild {
8484
| "cargo"
8585
| "clippy-driver"
8686
| "miri"
87+
| "rustfmt"
8788
=> {}
8889

8990
_ => return,

src/libcore/mem/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -374,13 +374,13 @@ pub fn align_of_val<T: ?Sized>(val: &T) -> usize {
374374
/// will do a single needs_drop check for all the values.
375375
///
376376
/// Types like Vec therefore just `drop_in_place(&mut self[..])` without using
377-
/// needs_drop explicitly. Types like HashMap, on the other hand, have to drop
377+
/// needs_drop explicitly. Types like `HashMap`, on the other hand, have to drop
378378
/// values one at a time and should use this API.
379379
///
380380
///
381381
/// # Examples
382382
///
383-
/// Here's an example of how a collection might make use of needs_drop:
383+
/// Here's an example of how a collection might make use of `needs_drop`:
384384
///
385385
/// ```
386386
/// use std::{mem, ptr};

src/librustc/session/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ pub fn build_session_options_and_crate_config(
20032003
None |
20042004
Some("human") => ErrorOutputType::HumanReadable(HumanReadableErrorType::Default(color)),
20052005
Some("human-annotate-rs") => {
2006-
ErrorOutputType::HumanReadable(HumanReadableErrorType::AnnotateRs(color))
2006+
ErrorOutputType::HumanReadable(HumanReadableErrorType::AnnotateSnippet(color))
20072007
},
20082008
Some("json") => ErrorOutputType::Json { pretty: false, json_rendered },
20092009
Some("pretty-json") => ErrorOutputType::Json { pretty: true, json_rendered },
@@ -2041,7 +2041,7 @@ pub fn build_session_options_and_crate_config(
20412041
"--error-format=pretty-json is unstable",
20422042
);
20432043
}
2044-
if let ErrorOutputType::HumanReadable(HumanReadableErrorType::AnnotateRs(_)) =
2044+
if let ErrorOutputType::HumanReadable(HumanReadableErrorType::AnnotateSnippet(_)) =
20452045
error_format {
20462046
early_error(
20472047
ErrorOutputType::Json { pretty: false, json_rendered },

src/librustc/session/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_data_structures::sync::{
2424
use errors::{DiagnosticBuilder, DiagnosticId, Applicability};
2525
use errors::emitter::{Emitter, EmitterWriter};
2626
use errors::emitter::HumanReadableErrorType;
27-
use errors::annotate_rs_emitter::{AnnotateRsEmitterWriter};
27+
use errors::annotate_snippet_emitter_writer::{AnnotateSnippetEmitterWriter};
2828
use syntax::ast::{self, NodeId};
2929
use syntax::edition::Edition;
3030
use syntax::feature_gate::{self, AttributeType};
@@ -1034,8 +1034,8 @@ fn default_emitter(
10341034
(config::ErrorOutputType::HumanReadable(kind), dst) => {
10351035
let (short, color_config) = kind.unzip();
10361036

1037-
if let HumanReadableErrorType::AnnotateRs(_) = kind {
1038-
let emitter = AnnotateRsEmitterWriter::new(
1037+
if let HumanReadableErrorType::AnnotateSnippet(_) = kind {
1038+
let emitter = AnnotateSnippetEmitterWriter::new(
10391039
Some(source_map.clone()),
10401040
short,
10411041
);

src/librustc_errors/annotate_rs_emitter.rs src/librustc_errors/annotate_snippet_emitter_writer.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/// Emit diagnostics using the `annotate-snippets` library
2-
///
3-
/// This is the equivalent of `./emitter.rs` but making use of the
4-
/// [`annotate-snippets`][annotate_snippets] library instead of building the output ourselves.
5-
///
6-
/// [annotate_snippets]: https://docs.rs/crate/annotate-snippets/
1+
//! Emit diagnostics using the `annotate-snippets` library
2+
//!
3+
//! This is the equivalent of `./emitter.rs` but making use of the
4+
//! [`annotate-snippets`][annotate_snippets] library instead of building the output ourselves.
5+
//!
6+
//! [annotate_snippets]: https://docs.rs/crate/annotate-snippets/
77
88
use syntax_pos::{SourceFile, MultiSpan, Loc};
99
use crate::{
@@ -18,16 +18,16 @@ use annotate_snippets::display_list::DisplayList;
1818
use annotate_snippets::formatter::DisplayListFormatter;
1919

2020

21-
/// Generates diagnostics using annotate-rs
22-
pub struct AnnotateRsEmitterWriter {
21+
/// Generates diagnostics using annotate-snippet
22+
pub struct AnnotateSnippetEmitterWriter {
2323
source_map: Option<Lrc<SourceMapperDyn>>,
2424
/// If true, hides the longer explanation text
2525
short_message: bool,
2626
/// If true, will normalize line numbers with LL to prevent noise in UI test diffs.
2727
ui_testing: bool,
2828
}
2929

30-
impl Emitter for AnnotateRsEmitterWriter {
30+
impl Emitter for AnnotateSnippetEmitterWriter {
3131
/// The entry point for the diagnostics generation
3232
fn emit_diagnostic(&mut self, db: &DiagnosticBuilder<'_>) {
3333
let primary_span = db.span.clone();
@@ -158,7 +158,7 @@ impl<'a> DiagnosticConverter<'a> {
158158
}
159159
}
160160

161-
impl AnnotateRsEmitterWriter {
161+
impl AnnotateSnippetEmitterWriter {
162162
pub fn new(
163163
source_map: Option<Lrc<SourceMapperDyn>>,
164164
short_message: bool

src/librustc_errors/emitter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use termcolor::{WriteColor, Color, Buffer};
2424
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
2525
pub enum HumanReadableErrorType {
2626
Default(ColorConfig),
27-
AnnotateRs(ColorConfig),
27+
AnnotateSnippet(ColorConfig),
2828
Short(ColorConfig),
2929
}
3030

@@ -34,7 +34,7 @@ impl HumanReadableErrorType {
3434
match self {
3535
HumanReadableErrorType::Default(cc) => (false, cc),
3636
HumanReadableErrorType::Short(cc) => (true, cc),
37-
HumanReadableErrorType::AnnotateRs(cc) => (false, cc),
37+
HumanReadableErrorType::AnnotateSnippet(cc) => (false, cc),
3838
}
3939
}
4040
pub fn new_emitter(

src/librustc_errors/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use termcolor::{ColorSpec, Color};
3333
mod diagnostic;
3434
mod diagnostic_builder;
3535
pub mod emitter;
36-
pub mod annotate_rs_emitter;
36+
pub mod annotate_snippet_emitter_writer;
3737
mod snippet;
3838
pub mod registry;
3939
mod styled_buffer;

src/tools/clippy

src/tools/rustc-workspace-hack/Cargo.toml

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,22 @@ features = [
2626
"basetsd",
2727
"consoleapi",
2828
"errhandlingapi",
29+
"ioapiset",
2930
"jobapi",
3031
"jobapi2",
3132
"knownfolders",
3233
"lmcons",
3334
"memoryapi",
3435
"minschannel",
3536
"minwinbase",
37+
"namedpipeapi",
38+
"ntdef",
3639
"ntsecapi",
3740
"ntstatus",
3841
"objbase",
39-
"profileapi",
4042
"processenv",
4143
"processthreadsapi",
44+
"profileapi",
4245
"psapi",
4346
"schannel",
4447
"securitybaseapi",
@@ -53,6 +56,10 @@ features = [
5356
"winbase",
5457
"wincon",
5558
"wincrypt",
59+
"winsock2",
60+
"ws2def",
61+
"ws2ipdef",
62+
"ws2tcpip",
5663
]
5764

5865
[dependencies]

0 commit comments

Comments
 (0)