Auto merge of #120454 - clubby789:cargo-update, r=Nilstrieb

`cargo update`

Run `cargo update`, with some pinning and fixes necessitated by that. This *should* unblock #112865

There's a couple of places where I only pinned a dependency in one location - this seems like a bit of a hack, but better than duplicating the FIXME across all `Cargo.toml` where a dependency is introduced.

cc `@Nilstrieb`
This commit is contained in:
bors 2024-02-14 05:27:31 +00:00
commit cc1c0990ab
31 changed files with 801 additions and 821 deletions

1218
Cargo.lock

File diff suppressed because it is too large Load diff

View file

@ -4,9 +4,10 @@ version = "0.0.0"
edition = "2021"
[dependencies]
# FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto
# tidy-alphabetical-start
bitflags = "2.4.1"
memchr = "2.5.0"
memchr = "=2.5.0"
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_index = { path = "../rustc_index" }
rustc_lexer = { path = "../rustc_lexer" }

View file

@ -2479,7 +2479,8 @@ mod diags {
&mut self,
span: Span,
) -> Option<(DiagnosticBuilder<'tcx>, usize)> {
self.diags.buffered_mut_errors.remove(&span)
// FIXME(#120456) - is `swap_remove` correct?
self.diags.buffered_mut_errors.swap_remove(&span)
}
pub fn buffer_mut_error(&mut self, span: Span, t: DiagnosticBuilder<'tcx>, count: usize) {

View file

@ -58,7 +58,8 @@ impl GatherUsedMutsVisitor<'_, '_, '_> {
// be those that were never initialized - we will consider those as being used as
// they will either have been removed by unreachable code optimizations; or linted
// as unused variables.
self.never_initialized_mut_locals.remove(&into.local);
// FIXME(#120456) - is `swap_remove` correct?
self.never_initialized_mut_locals.swap_remove(&into.local);
}
}

View file

@ -106,7 +106,8 @@ fn asm_target_features(tcx: TyCtxt<'_>, did: DefId) -> &FxIndexSet<Symbol> {
match attrs.instruction_set {
None => {}
Some(InstructionSetAttr::ArmA32) => {
target_features.remove(&sym::thumb_mode);
// FIXME(#120456) - is `swap_remove` correct?
target_features.swap_remove(&sym::thumb_mode);
}
Some(InstructionSetAttr::ArmT32) => {
target_features.insert(sym::thumb_mode);

View file

@ -122,7 +122,8 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
where
K: Borrow<Q>,
{
FxIndexMap::remove(self, k)
// FIXME(#120456) - is `swap_remove` correct?
FxIndexMap::swap_remove(self, k)
}
#[inline(always)]

View file

@ -49,7 +49,8 @@ fn intern_shallow<'rt, 'mir, 'tcx, T, M: CompileTimeMachine<'mir, 'tcx, T>>(
) -> Result<impl Iterator<Item = CtfeProvenance> + 'tcx, ()> {
trace!("intern_shallow {:?}", alloc_id);
// remove allocation
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.remove(&alloc_id) else {
// FIXME(#120456) - is `swap_remove` correct?
let Some((_kind, mut alloc)) = ecx.memory.alloc_map.swap_remove(&alloc_id) else {
return Err(());
};
// Set allocation mutability as appropriate. This is used by LLVM to put things into

View file

@ -1635,7 +1635,8 @@ impl HumanEmitter {
let mut to_add = FxHashMap::default();
for (depth, style) in depths {
if multilines.remove(&depth).is_none() {
// FIXME(#120456) - is `swap_remove` correct?
if multilines.swap_remove(&depth).is_none() {
to_add.insert(depth, style);
}
}

View file

@ -737,7 +737,8 @@ impl DiagCtxt {
pub fn steal_diagnostic(&self, span: Span, key: StashKey) -> Option<DiagnosticBuilder<'_, ()>> {
let mut inner = self.inner.borrow_mut();
let key = (span.with_parent(None), key);
let diag = inner.stashed_diagnostics.remove(&key)?;
// FIXME(#120456) - is `swap_remove` correct?
let diag = inner.stashed_diagnostics.swap_remove(&key)?;
if diag.is_error() {
if diag.is_lint.is_none() {
inner.stashed_err_count -= 1;

View file

@ -218,7 +218,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
for def_ids in associated_types.values_mut() {
for (projection_bound, span) in &projection_bounds {
let def_id = projection_bound.projection_def_id();
def_ids.remove(&def_id);
// FIXME(#120456) - is `swap_remove` correct?
def_ids.swap_remove(&def_id);
if tcx.generics_require_sized_self(def_id) {
tcx.emit_node_span_lint(
UNUSED_ASSOCIATED_TYPE_BOUNDS,

View file

@ -1873,7 +1873,8 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> {
lifetime_ref: &'tcx hir::Lifetime,
bad_def: ResolvedArg,
) {
let old_value = self.map.defs.remove(&lifetime_ref.hir_id);
// FIXME(#120456) - is `swap_remove` correct?
let old_value = self.map.defs.swap_remove(&lifetime_ref.hir_id);
assert_eq!(old_value, Some(bad_def));
}
}

View file

@ -1579,7 +1579,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let ctxt = {
let mut enclosing_breakables = self.enclosing_breakables.borrow_mut();
debug_assert!(enclosing_breakables.stack.len() == index + 1);
enclosing_breakables.by_id.remove(&id).expect("missing breakable context");
// FIXME(#120456) - is `swap_remove` correct?
enclosing_breakables.by_id.swap_remove(&id).expect("missing breakable context");
enclosing_breakables.stack.pop().expect("missing breakable context")
};
(ctxt, result)

View file

@ -20,7 +20,8 @@ impl<'tcx> OpaqueTypeStorage<'tcx> {
if let Some(idx) = idx {
self.opaque_types.get_mut(&key).unwrap().hidden_type = idx;
} else {
match self.opaque_types.remove(&key) {
// FIXME(#120456) - is `swap_remove` correct?
match self.opaque_types.swap_remove(&key) {
None => bug!("reverted opaque type inference that was never registered: {:?}", key),
Some(_) => {}
}

View file

@ -708,7 +708,8 @@ impl LintBuffer {
}
pub fn take(&mut self, id: NodeId) -> Vec<BufferedEarlyLint> {
self.map.remove(&id).unwrap_or_default()
// FIXME(#120456) - is `swap_remove` correct?
self.map.swap_remove(&id).unwrap_or_default()
}
pub fn buffer_lint(

View file

@ -8,7 +8,12 @@ edition = "2021"
libc = "0.2.73"
# tidy-alphabetical-end
# FIXME: updating cc past 1.0.79 breaks libstd bootstrapping, pin
# to the last working version here so `cargo update` doesn't cause the
# a higher version to be selected
# https://github.com/rust-lang/cc-rs/issues/913
# 1.0.{84, 85} fix this but have been yanked
[build-dependencies]
# tidy-alphabetical-start
cc = "1.0.69"
cc = "=1.0.79"
# tidy-alphabetical-end

View file

@ -398,7 +398,8 @@ impl<'alloc> Candidates<'alloc> {
let candidates = entry.get_mut();
Self::vec_filter_candidates(p, candidates, f, at);
if candidates.len() == 0 {
entry.remove();
// FIXME(#120456) - is `swap_remove` correct?
entry.swap_remove();
}
}

View file

@ -957,8 +957,9 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
// available as we'd like it to be.
// FIXME: only remove `libc` when `stdbuild` is active.
// FIXME: remove special casing for `test`.
remaining_lib_features.remove(&sym::libc);
remaining_lib_features.remove(&sym::test);
// FIXME(#120456) - is `swap_remove` correct?
remaining_lib_features.swap_remove(&sym::libc);
remaining_lib_features.swap_remove(&sym::test);
/// For each feature in `defined_features`..
///
@ -996,7 +997,8 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
unnecessary_stable_feature_lint(tcx, *span, feature, since);
}
}
remaining_lib_features.remove(&feature);
// FIXME(#120456) - is `swap_remove` correct?
remaining_lib_features.swap_remove(&feature);
// `feature` is the feature doing the implying, but `implied_by` is the feature with
// the attribute that establishes this relationship. `implied_by` is guaranteed to be a

View file

@ -92,7 +92,8 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
} else {
// This trait import is definitely used, in a way other than
// method resolution.
self.r.maybe_unused_trait_imports.remove(&def_id);
// FIXME(#120456) - is `swap_remove` correct?
self.r.maybe_unused_trait_imports.swap_remove(&def_id);
if let Some(i) = self.unused_imports.get_mut(&self.base_id) {
i.unused.remove(&id);
}

View file

@ -524,13 +524,15 @@ impl<'tcx> AutoTraitFinder<'tcx> {
if let Entry::Occupied(v) = vid_map.entry(*smaller) {
let smaller_deps = v.into_mut();
smaller_deps.larger.insert(*larger);
smaller_deps.larger.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
smaller_deps.larger.swap_remove(&target);
}
if let Entry::Occupied(v) = vid_map.entry(*larger) {
let larger_deps = v.into_mut();
larger_deps.smaller.insert(*smaller);
larger_deps.smaller.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
larger_deps.smaller.swap_remove(&target);
}
}
(&RegionTarget::RegionVid(v1), &RegionTarget::Region(r1)) => {
@ -543,13 +545,15 @@ impl<'tcx> AutoTraitFinder<'tcx> {
if let Entry::Occupied(v) = vid_map.entry(*smaller) {
let smaller_deps = v.into_mut();
smaller_deps.larger.insert(*larger);
smaller_deps.larger.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
smaller_deps.larger.swap_remove(&target);
}
if let Entry::Occupied(v) = vid_map.entry(*larger) {
let larger_deps = v.into_mut();
larger_deps.smaller.insert(*smaller);
larger_deps.smaller.remove(&target);
// FIXME(#120456) - is `swap_remove` correct?
larger_deps.smaller.swap_remove(&target);
}
}
}

View file

@ -522,7 +522,8 @@ pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Opti
for (p, _) in predicates {
if let Some(poly_trait_ref) = p.as_trait_clause() {
if Some(poly_trait_ref.def_id()) == sized_trait {
types_without_default_bounds.remove(&poly_trait_ref.self_ty().skip_binder());
// FIXME(#120456) - is `swap_remove` correct?
types_without_default_bounds.swap_remove(&poly_trait_ref.self_ty().skip_binder());
continue;
}
}

View file

@ -4,9 +4,9 @@ version = 3
[[package]]
name = "r-efi"
version = "4.2.0"
version = "4.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "575fc2d9b3da54adbdfaddf6eca48fec256d977c8630a1750b8991347d1ac911"
checksum = "0e244f96e03a3067f9e521d3167bd42657594cb8588c8d3a2db01545dc1af2e0"
[[package]]
name = "uefi_qemu_test"

View file

@ -511,7 +511,8 @@ fn scan_block_for_eq<'tcx>(
for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] {
if let StmtKind::Local(l) = stmt.kind {
l.pat.each_binding_or_first(&mut |_, id, _, _| {
eq.locals.remove(&id);
// FIXME(rust/#120456) - is `swap_remove` correct?
eq.locals.swap_remove(&id);
});
}
}

View file

@ -138,7 +138,8 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) {
if cmt.place.projections.is_empty() {
if let PlaceBase::Local(lid) = cmt.place.base {
self.set.remove(&lid);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.set.swap_remove(&lid);
}
}
}
@ -146,7 +147,8 @@ impl<'a, 'tcx> Delegate<'tcx> for EscapeDelegate<'a, 'tcx> {
fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) {
if cmt.place.projections.is_empty() {
if let PlaceBase::Local(lid) = cmt.place.base {
self.set.remove(&lid);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.set.swap_remove(&lid);
}
}
}

View file

@ -106,7 +106,8 @@ fn find_slice_values(cx: &LateContext<'_>, pat: &hir::Pat<'_>) -> FxIndexMap<hir
}
if sub_pat.is_some() {
removed_pat.insert(value_hir_id);
slices.remove(&value_hir_id);
// FIXME(rust/#120456) - is `swap_remove` correct?
slices.swap_remove(&value_hir_id);
return;
}
@ -259,7 +260,8 @@ impl<'a, 'tcx> Visitor<'tcx> for SliceIndexLintingVisitor<'a, 'tcx> {
}
// The slice was used for something other than indexing
self.slice_lint_info.remove(&local_id);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.slice_lint_info.swap_remove(&local_id);
}
intravisit::walk_expr(self, expr);
}

View file

@ -415,6 +415,7 @@ fn pat_contains_local(pat: &Pat<'_>, id: HirId) -> bool {
/// Returns true if all the bindings in the `Pat` are in `ids` and vice versa
fn bindings_eq(pat: &Pat<'_>, mut ids: HirIdSet) -> bool {
let mut result = true;
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.remove(&id));
// FIXME(rust/#120456) - is `swap_remove` correct?
pat.each_binding_or_first(&mut |_, id, _, _| result &= ids.swap_remove(&id));
result && ids.is_empty()
}

View file

@ -382,7 +382,8 @@ impl<'tcx> euv::Delegate<'tcx> for MutablyUsedVariablesCtxt<'tcx> {
self.add_mutably_used_var(*vid);
}
self.prev_bind = None;
self.prev_move_to_closure.remove(vid);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.prev_move_to_closure.swap_remove(vid);
}
}

View file

@ -98,7 +98,8 @@ impl<'tcx> LateLintPass<'tcx> for NoEffect {
fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx rustc_hir::Block<'tcx>) {
for hir_id in self.local_bindings.pop().unwrap() {
if let Some(span) = self.underscore_bindings.remove(&hir_id) {
// FIXME(rust/#120456) - is `swap_remove` correct?
if let Some(span) = self.underscore_bindings.swap_remove(&hir_id) {
span_lint_hir(
cx,
NO_EFFECT_UNDERSCORE_BINDING,
@ -112,7 +113,8 @@ impl<'tcx> LateLintPass<'tcx> for NoEffect {
fn check_expr(&mut self, _: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) {
if let Some(def_id) = path_to_local(expr) {
self.underscore_bindings.remove(&def_id);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.underscore_bindings.swap_remove(&def_id);
}
}
}

View file

@ -153,7 +153,8 @@ impl Params {
param.uses = Vec::new();
let key = (param.fn_id, param.idx);
self.by_fn.remove(&key);
self.by_id.remove(&id);
// FIXME(rust/#120456) - is `swap_remove` correct?
self.by_id.swap_remove(&id);
}
}

View file

@ -13,8 +13,10 @@ const LICENSES: &[&str] = &[
"0BSD OR MIT OR Apache-2.0", // adler license
"0BSD",
"Apache-2.0 / MIT",
"Apache-2.0 OR ISC OR MIT",
"Apache-2.0 OR MIT",
"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
"Apache-2.0",
"Apache-2.0/MIT",
"BSD-2-Clause OR Apache-2.0 OR MIT", // zerocopy
"ISC",
@ -217,6 +219,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"darling_core",
"darling_macro",
"datafrog",
"deranged",
"derivative",
"derive_more",
"derive_setters",
@ -258,7 +261,6 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"indexmap",
"intl-memoizer",
"intl_pluralrules",
"is-terminal",
"itertools",
"itoa",
"jemalloc-sys",
@ -278,6 +280,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"memoffset",
"miniz_oxide",
"nu-ansi-term",
"num-conv",
"num_cpus",
"object",
"odht",
@ -290,6 +293,7 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
"pin-project-lite",
"polonius-engine",
"portable-atomic", // dependency for platforms doesn't support `AtomicU64` in std
"powerfmt",
"ppv-lite86",
"proc-macro-hack",
"proc-macro2",

View file

@ -2,7 +2,7 @@ error: unsupported type attribute for diagnostic derive enum
--> $DIR/diagnostic-derive.rs:47:1
|
LL | #[diag(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:50:5
@ -24,27 +24,21 @@ error: `#[nonsense(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:63:1
|
LL | #[nonsense(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:63:1
|
LL | / #[nonsense(no_crate_example, code = E0123)]
LL | |
LL | |
LL | |
LL | | struct InvalidStructAttr {}
| |___________________________^
LL | #[nonsense(no_crate_example, code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:70:1
|
LL | / #[diag(code = E0123)]
LL | |
LL | | struct InvalidLitNestedAttr {}
| |______________________________^
LL | #[diag(code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -57,11 +51,8 @@ LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:80:1
|
LL | / #[diag(nonsense("foo"), code = E0123, slug = "foo")]
LL | |
LL | |
LL | | struct InvalidNestedStructAttr1 {}
| |__________________________________^
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -76,11 +67,8 @@ LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:86:1
|
LL | / #[diag(nonsense = "...", code = E0123, slug = "foo")]
LL | |
LL | |
LL | | struct InvalidNestedStructAttr2 {}
| |__________________________________^
LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -95,11 +83,8 @@ LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:92:1
|
LL | / #[diag(nonsense = 4, code = E0123, slug = "foo")]
LL | |
LL | |
LL | | struct InvalidNestedStructAttr3 {}
| |__________________________________^
LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -115,7 +100,7 @@ error: `#[suggestion = ...]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:105:5
|
LL | #[suggestion = "bar"]
| ^^^^^^^^^^^^^^^^^^^^^
| ^
error: specified multiple times
--> $DIR/diagnostic-derive.rs:112:8
@ -163,17 +148,15 @@ error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:128:1
|
LL | struct KindNotProvided {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:131:1
|
LL | / #[diag(code = E0123)]
LL | |
LL | | struct SlugNotProvided {}
| |_________________________^
LL | #[diag(code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -181,19 +164,19 @@ error: the `#[primary_span]` attribute can only be applied to fields of type `Sp
--> $DIR/diagnostic-derive.rs:142:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
error: `#[nonsense]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:150:5
|
LL | #[nonsense]
| ^^^^^^^^^^^
| ^
error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/diagnostic-derive.rs:167:5
|
LL | #[label(no_crate_label)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: `name` doesn't refer to a field on this type
--> $DIR/diagnostic-derive.rs:175:46
@ -223,13 +206,13 @@ error: the `#[label(...)]` attribute can only be applied to fields of type `Span
--> $DIR/diagnostic-derive.rs:210:5
|
LL | #[label(no_crate_label)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:229:5
|
LL | #[suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: invalid nested attribute
--> $DIR/diagnostic-derive.rs:237:18
@ -243,7 +226,7 @@ error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:237:5
|
LL | #[suggestion(nonsense = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: invalid nested attribute
--> $DIR/diagnostic-derive.rs:246:18
@ -257,15 +240,13 @@ error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:246:5
|
LL | #[suggestion(msg = "bar")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: wrong field type for suggestion
--> $DIR/diagnostic-derive.rs:269:5
|
LL | / #[suggestion(no_crate_suggestion, code = "This is suggested code")]
LL | |
LL | | suggestion: Applicability,
| |_____________________________^
LL | #[suggestion(no_crate_suggestion, code = "This is suggested code")]
| ^
|
= help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`
@ -297,13 +278,13 @@ error: `#[label = ...]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:300:5
|
LL | #[label = "bar"]
| ^^^^^^^^^^^^^^^^
| ^
error: specified multiple times
--> $DIR/diagnostic-derive.rs:451:5
|
LL | #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
note: previously specified here
--> $DIR/diagnostic-derive.rs:453:24
@ -321,7 +302,7 @@ error: the `#[help(...)]` attribute can only be applied to fields of type `Span`
--> $DIR/diagnostic-derive.rs:526:5
|
LL | #[help(no_crate_help)]
| ^^^^^^^^^^^^^^^^^^^^^^
| ^
error: a diagnostic slug must be the first argument to the attribute
--> $DIR/diagnostic-derive.rs:535:32
@ -345,7 +326,7 @@ error: `#[primary_span]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:563:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
|
= help: the `primary_span` field attribute is not valid for lint diagnostics
@ -353,17 +334,13 @@ error: `#[error(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:583:1
|
LL | #[error(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:583:1
|
LL | / #[error(no_crate_example, code = E0123)]
LL | |
LL | |
LL | |
LL | | struct ErrorAttribute {}
| |________________________^
LL | #[error(no_crate_example, code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -371,17 +348,13 @@ error: `#[warn_(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:590:1
|
LL | #[warn_(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:590:1
|
LL | / #[warn_(no_crate_example, code = E0123)]
LL | |
LL | |
LL | |
LL | | struct WarnAttribute {}
| |_______________________^
LL | #[warn_(no_crate_example, code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -389,17 +362,13 @@ error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:597:1
|
LL | #[lint(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:597:1
|
LL | / #[lint(no_crate_example, code = E0123)]
LL | |
LL | |
LL | |
LL | | struct LintAttributeOnSessionDiag {}
| |____________________________________^
LL | #[lint(no_crate_example, code = E0123)]
| ^
|
= help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`
@ -407,26 +376,21 @@ error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:604:1
|
LL | #[lint(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: `#[lint(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:604:1
|
LL | #[lint(no_crate_example, code = E0123)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: diagnostic slug not specified
--> $DIR/diagnostic-derive.rs:604:1
|
LL | / #[lint(no_crate_example, code = E0123)]
LL | |
LL | |
LL | |
LL | |
LL | | struct LintAttributeOnLintDiag {}
| |_________________________________^
LL | #[lint(no_crate_example, code = E0123)]
| ^
|
= help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest_example)]`
@ -462,13 +426,13 @@ error: suggestion without `code = "..."`
--> $DIR/diagnostic-derive.rs:638:5
|
LL | #[suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:645:1
|
LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: consider creating a `Subdiagnostic` instead
@ -476,7 +440,7 @@ error: `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:648:1
|
LL | #[multipart_suggestion()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: consider creating a `Subdiagnostic` instead
@ -484,7 +448,7 @@ error: `#[multipart_suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:652:5
|
LL | #[multipart_suggestion(no_crate_suggestion)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: consider creating a `Subdiagnostic` instead
@ -492,7 +456,7 @@ error: `#[suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:660:1
|
LL | #[suggestion(no_crate_suggestion, code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: `#[label]` and `#[suggestion]` can only be applied to fields
@ -500,7 +464,7 @@ error: `#[label]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:669:1
|
LL | #[label]
| ^^^^^^^^
| ^
|
= help: `#[label]` and `#[suggestion]` can only be applied to fields
@ -508,31 +472,31 @@ error: `eager` is the only supported nested attribute for `subdiagnostic`
--> $DIR/diagnostic-derive.rs:703:7
|
LL | #[subdiagnostic(bad)]
| ^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^
error: `#[subdiagnostic = ...]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:711:5
|
LL | #[subdiagnostic = "bad"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: `eager` is the only supported nested attribute for `subdiagnostic`
--> $DIR/diagnostic-derive.rs:719:7
|
LL | #[subdiagnostic(bad, bad)]
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^
error: `eager` is the only supported nested attribute for `subdiagnostic`
--> $DIR/diagnostic-derive.rs:727:7
|
LL | #[subdiagnostic("bad")]
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^
error: `#[subdiagnostic(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:735:5
|
LL | #[subdiagnostic(eager)]
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: eager subdiagnostics are not supported on lints
@ -552,7 +516,7 @@ error: `#[suggestion(...)]` is not a valid attribute
--> $DIR/diagnostic-derive.rs:825:5
|
LL | #[suggestion(no_crate_suggestion, code = "")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= note: `#[suggestion(...)]` applied to `Vec` field is ambiguous
= help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`

View file

@ -1,30 +1,26 @@
error: label without `#[primary_span]` field
--> $DIR/subdiagnostic-derive.rs:51:1
|
LL | / #[label(no_crate_example)]
LL | |
LL | | struct C {
LL | | var: String,
LL | | }
| |_^
LL | #[label(no_crate_example)]
| ^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:58:1
|
LL | #[label]
| ^^^^^^^^
| ^
error: `#[foo]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:67:1
|
LL | #[foo]
| ^^^^^^
| ^
error: `#[label = ...]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:77:1
|
LL | #[label = "..."]
| ^^^^^^^^^^^^^^^^
| ^
error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:86:9
@ -36,7 +32,7 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:86:1
|
LL | #[label(bug = "...")]
| ^^^^^^^^^^^^^^^^^^^^^
| ^
error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:106:9
@ -48,7 +44,7 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:106:1
|
LL | #[label(slug = 4)]
| ^^^^^^^^^^^^^^^^^^
| ^
error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:116:9
@ -60,13 +56,13 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:116:1
|
LL | #[label(slug("..."))]
| ^^^^^^^^^^^^^^^^^^^^^
| ^
error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:136:1
|
LL | #[label()]
| ^^^^^^^^^^
| ^
error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:145:27
@ -84,31 +80,31 @@ error: unsupported type attribute for subdiagnostic enum
--> $DIR/subdiagnostic-derive.rs:163:1
|
LL | #[foo]
| ^^^^^^
| ^
error: `#[bar]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:177:5
|
LL | #[bar]
| ^^^^^^
| ^
error: `#[bar = ...]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:189:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
| ^
error: `#[bar = ...]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:201:5
|
LL | #[bar = 4]
| ^^^^^^^^^^
| ^
error: `#[bar(...)]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:213:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
| ^
error: only `no_span` is a valid nested attribute
--> $DIR/subdiagnostic-derive.rs:225:13
@ -120,37 +116,31 @@ error: diagnostic slug must be first argument of a `#[label(...)]` attribute
--> $DIR/subdiagnostic-derive.rs:225:5
|
LL | #[label(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^
| ^
error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/subdiagnostic-derive.rs:254:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
error: label without `#[primary_span]` field
--> $DIR/subdiagnostic-derive.rs:251:1
|
LL | / #[label(no_crate_example)]
LL | |
LL | | struct W {
LL | | #[primary_span]
LL | |
LL | | span: String,
LL | | }
| |_^
LL | #[label(no_crate_example)]
| ^
error: `#[applicability]` is only valid on suggestions
--> $DIR/subdiagnostic-derive.rs:264:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
| ^
error: `#[bar]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:274:5
|
LL | #[bar]
| ^^^^^^
| ^
|
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
@ -158,13 +148,13 @@ error: `#[bar = ...]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:285:5
|
LL | #[bar = "..."]
| ^^^^^^^^^^^^^^
| ^
error: `#[bar(...)]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:296:5
|
LL | #[bar("...")]
| ^^^^^^^^^^^^^
| ^
|
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
@ -178,13 +168,13 @@ error: specified multiple times
--> $DIR/subdiagnostic-derive.rs:341:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
|
note: previously specified here
--> $DIR/subdiagnostic-derive.rs:338:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
error: subdiagnostic kind not specified
--> $DIR/subdiagnostic-derive.rs:347:8
@ -208,25 +198,25 @@ error: specified multiple times
--> $DIR/subdiagnostic-derive.rs:402:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
| ^
|
note: previously specified here
--> $DIR/subdiagnostic-derive.rs:399:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
| ^
error: the `#[applicability]` attribute can only be applied to fields of type `Applicability`
--> $DIR/subdiagnostic-derive.rs:412:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
| ^
error: suggestion without `code = "..."`
--> $DIR/subdiagnostic-derive.rs:425:1
|
LL | #[suggestion(no_crate_example)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: invalid applicability
--> $DIR/subdiagnostic-derive.rs:435:62
@ -237,18 +227,14 @@ LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
error: suggestion without `#[primary_span]` field
--> $DIR/subdiagnostic-derive.rs:453:1
|
LL | / #[suggestion(no_crate_example, code = "...")]
LL | |
LL | | struct AR {
LL | | var: String,
LL | | }
| |_^
LL | #[suggestion(no_crate_example, code = "...")]
| ^
error: unsupported type attribute for subdiagnostic enum
--> $DIR/subdiagnostic-derive.rs:467:1
|
LL | #[label]
| ^^^^^^^^
| ^
error: `var` doesn't refer to a field on this type
--> $DIR/subdiagnostic-derive.rs:487:39
@ -266,7 +252,7 @@ error: `#[suggestion_part]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:529:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
| ^
|
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
@ -274,21 +260,15 @@ error: `#[suggestion_part(...)]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:532:5
|
LL | #[suggestion_part(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions
error: suggestion without `#[primary_span]` field
--> $DIR/subdiagnostic-derive.rs:526:1
|
LL | / #[suggestion(no_crate_example, code = "...")]
LL | |
LL | | struct BA {
LL | | #[suggestion_part]
... |
LL | | var: String,
LL | | }
| |_^
LL | #[suggestion(no_crate_example, code = "...")]
| ^
error: invalid nested attribute
--> $DIR/subdiagnostic-derive.rs:541:42
@ -301,57 +281,46 @@ LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "mac
error: multipart suggestion without any `#[suggestion_part(...)]` fields
--> $DIR/subdiagnostic-derive.rs:541:1
|
LL | / #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
LL | |
LL | |
LL | | struct BBa {
LL | | var: String,
LL | | }
| |_^
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
| ^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
--> $DIR/subdiagnostic-derive.rs:551:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
| ^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
--> $DIR/subdiagnostic-derive.rs:559:5
|
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
| ^
error: `#[primary_span]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:568:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
|
= help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
error: multipart suggestion without any `#[suggestion_part(...)]` fields
--> $DIR/subdiagnostic-derive.rs:565:1
|
LL | / #[multipart_suggestion(no_crate_example)]
LL | |
LL | | struct BC {
LL | | #[primary_span]
LL | |
LL | | span: Span,
LL | | }
| |_^
LL | #[multipart_suggestion(no_crate_example)]
| ^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
--> $DIR/subdiagnostic-derive.rs:576:5
|
LL | #[suggestion_part]
| ^^^^^^^^^^^^^^^^^^
| ^
error: `#[suggestion_part(...)]` attribute without `code = "..."`
--> $DIR/subdiagnostic-derive.rs:579:5
|
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
| ^
error: `code` is the only valid nested attribute
--> $DIR/subdiagnostic-derive.rs:582:23
@ -363,13 +332,13 @@ error: the `#[suggestion_part(...)]` attribute can only be applied to fields of
--> $DIR/subdiagnostic-derive.rs:587:5
|
LL | #[suggestion_part(code = "...")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
--> $DIR/subdiagnostic-derive.rs:590:5
|
LL | #[suggestion_part()]
| ^^^^^^^^^^^^^^^^^^^^
| ^
error: specified multiple times
--> $DIR/subdiagnostic-derive.rs:598:37
@ -387,7 +356,7 @@ error: `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_sugg
--> $DIR/subdiagnostic-derive.rs:627:5
|
LL | #[applicability]
| ^^^^^^^^^^^^^^^^
| ^
error: expected exactly one string literal for `code = ...`
--> $DIR/subdiagnostic-derive.rs:675:34
@ -417,19 +386,19 @@ error: specified multiple times
--> $DIR/subdiagnostic-derive.rs:763:1
|
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
note: previously specified here
--> $DIR/subdiagnostic-derive.rs:763:1
|
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
error: `#[suggestion_hidden(...)]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:772:1
|
LL | #[suggestion_hidden(no_crate_example, code = "")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: Use `#[suggestion(..., style = "hidden")]` instead
@ -437,7 +406,7 @@ error: `#[suggestion_hidden(...)]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:780:1
|
LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^
|
= help: Use `#[suggestion(..., style = "hidden")]` instead
@ -471,7 +440,7 @@ error: `#[primary_span]` is not a valid attribute
--> $DIR/subdiagnostic-derive.rs:825:5
|
LL | #[primary_span]
| ^^^^^^^^^^^^^^^
| ^
|
= note: there must be exactly one primary span
= help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
@ -479,14 +448,8 @@ LL | #[primary_span]
error: suggestion without `#[primary_span]` field
--> $DIR/subdiagnostic-derive.rs:822:1
|
LL | / #[suggestion(no_crate_example, code = "")]
LL | |
LL | | struct PrimarySpanOnVec {
LL | | #[primary_span]
... |
LL | | sub: Vec<Span>,
LL | | }
| |_^
LL | #[suggestion(no_crate_example, code = "")]
| ^
error[E0433]: failed to resolve: maybe a missing crate `core`?
--> $DIR/subdiagnostic-derive.rs:96:9