Skip to content

Commit 0ff8610

Browse files
committed
Auto merge of #118134 - Nilstrieb:rollup-kyo1l6e, r=Nilstrieb
Rollup of 6 pull requests Successful merges: - #116085 (rustdoc-search: add support for traits and associated types) - #117522 (Remove `--check-cfg` checking of command line `--cfg` args) - #118029 (Expand Miri's BorTag GC to a Provenance GC) - #118035 (Fix early param lifetimes in generic_const_exprs) - #118083 (Remove i686-apple-darwin cross-testing) - #118091 (Remove now deprecated target x86_64-sun-solaris.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e24e5af + fa8878b commit 0ff8610

File tree

96 files changed

+1988
-602
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1988
-602
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::session_diagnostics::{
3535
LifetimeReturnCategoryErr, RequireStaticErr, VarHereDenote,
3636
};
3737

38-
use super::{OutlivesSuggestionBuilder, RegionName};
38+
use super::{OutlivesSuggestionBuilder, RegionName, RegionNameSource};
3939
use crate::region_infer::{BlameConstraint, ExtraConstraintInfo};
4040
use crate::{
4141
nll::ConstraintDescription,
@@ -763,7 +763,14 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
763763
let err = LifetimeOutliveErr { span: *span };
764764
let mut diag = self.infcx.tcx.sess.create_err(err);
765765

766-
let fr_name = self.give_region_a_name(*fr).unwrap();
766+
// In certain scenarios, such as the one described in issue #118021,
767+
// we might encounter a lifetime that cannot be named.
768+
// These situations are bound to result in errors.
769+
// To prevent an immediate ICE, we opt to create a dummy name instead.
770+
let fr_name = self.give_region_a_name(*fr).unwrap_or(RegionName {
771+
name: kw::UnderscoreLifetime,
772+
source: RegionNameSource::Static,
773+
});
767774
fr_name.highlight_region_name(&mut diag);
768775
let outlived_fr_name = self.give_region_a_name(*outlived_fr).unwrap();
769776
outlived_fr_name.highlight_region_name(&mut diag);

compiler/rustc_const_eval/src/const_eval/machine.rs

+8
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ impl<K: Hash + Eq, V> interpret::AllocMap<K, V> for FxIndexMap<K, V> {
107107
FxIndexMap::contains_key(self, k)
108108
}
109109

110+
#[inline(always)]
111+
fn contains_key_ref<Q: ?Sized + Hash + Eq>(&self, k: &Q) -> bool
112+
where
113+
K: Borrow<Q>,
114+
{
115+
FxIndexMap::contains_key(self, k)
116+
}
117+
110118
#[inline(always)]
111119
fn insert(&mut self, k: K, v: V) -> Option<V> {
112120
FxIndexMap::insert(self, k, v)

compiler/rustc_const_eval/src/interpret/machine.rs

+8
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ pub trait AllocMap<K: Hash + Eq, V> {
4949
where
5050
K: Borrow<Q>;
5151

52+
/// Callers should prefer [`AllocMap::contains_key`] when it is possible to call because it may
53+
/// be more efficient. This function exists for callers that only have a shared reference
54+
/// (which might make it slightly less efficient than `contains_key`, e.g. if
55+
/// the data is stored inside a `RefCell`).
56+
fn contains_key_ref<Q: ?Sized + Hash + Eq>(&self, k: &Q) -> bool
57+
where
58+
K: Borrow<Q>;
59+
5260
/// Inserts a new entry into the map.
5361
fn insert(&mut self, k: K, v: V) -> Option<V>;
5462

compiler/rustc_const_eval/src/interpret/memory.rs

+9
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,15 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
692692
Ok((&mut alloc.extra, machine))
693693
}
694694

695+
/// Check whether an allocation is live. This is faster than calling
696+
/// [`InterpCx::get_alloc_info`] if all you need to check is whether the kind is
697+
/// [`AllocKind::Dead`] because it doesn't have to look up the type and layout of statics.
698+
pub fn is_alloc_live(&self, id: AllocId) -> bool {
699+
self.tcx.try_get_global_alloc(id).is_some()
700+
|| self.memory.alloc_map.contains_key_ref(&id)
701+
|| self.memory.extra_fn_ptr_map.contains_key(&id)
702+
}
703+
695704
/// Obtain the size and alignment of an allocation, even if that allocation has
696705
/// been deallocated.
697706
pub fn get_alloc_info(&self, id: AllocId) -> (Size, Align, AllocKind) {

compiler/rustc_lint/messages.ftl

-6
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ lint_builtin_type_alias_generic_bounds = bounds on generic parameters are not en
128128
lint_builtin_type_alias_where_clause = where clauses are not enforced in type aliases
129129
.suggestion = the clause will not be checked when the type alias is used, and should be removed
130130
131-
lint_builtin_unexpected_cli_config_name = unexpected `{$name}` as condition name
132-
.help = was set with `--cfg` but isn't in the `--check-cfg` expected names
133-
134-
lint_builtin_unexpected_cli_config_value = unexpected condition value `{$value}` for condition name `{$name}`
135-
.help = was set with `--cfg` but isn't in the `--check-cfg` expected values
136-
137131
lint_builtin_unpermitted_type_init_label = this code causes undefined behavior when executed
138132
lint_builtin_unpermitted_type_init_label_suggestion = help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
139133

compiler/rustc_lint/src/builtin.rs

-25
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use crate::{
3333
BuiltinMutablesTransmutes, BuiltinNoMangleGeneric, BuiltinNonShorthandFieldPatterns,
3434
BuiltinSpecialModuleNameUsed, BuiltinTrivialBounds, BuiltinTypeAliasGenericBounds,
3535
BuiltinTypeAliasGenericBoundsSuggestion, BuiltinTypeAliasWhereClause,
36-
BuiltinUnexpectedCliConfigName, BuiltinUnexpectedCliConfigValue,
3736
BuiltinUngatedAsyncFnTrackCaller, BuiltinUnpermittedTypeInit,
3837
BuiltinUnpermittedTypeInitSub, BuiltinUnreachablePub, BuiltinUnsafe,
3938
BuiltinUnstableFeatures, BuiltinUnusedDocComment, BuiltinUnusedDocCommentSub,
@@ -60,7 +59,6 @@ use rustc_middle::ty::GenericArgKind;
6059
use rustc_middle::ty::ToPredicate;
6160
use rustc_middle::ty::TypeVisitableExt;
6261
use rustc_middle::ty::{self, Ty, TyCtxt, VariantDef};
63-
use rustc_session::config::ExpectedValues;
6462
use rustc_session::lint::{BuiltinLintDiagnostics, FutureIncompatibilityReason};
6563
use rustc_span::edition::Edition;
6664
use rustc_span::source_map::Spanned;
@@ -2889,26 +2887,3 @@ impl EarlyLintPass for SpecialModuleName {
28892887
}
28902888
}
28912889
}
2892-
2893-
pub use rustc_session::lint::builtin::UNEXPECTED_CFGS;
2894-
2895-
declare_lint_pass!(UnexpectedCfgs => [UNEXPECTED_CFGS]);
2896-
2897-
impl EarlyLintPass for UnexpectedCfgs {
2898-
fn check_crate(&mut self, cx: &EarlyContext<'_>, _: &ast::Crate) {
2899-
let cfg = &cx.sess().parse_sess.config;
2900-
let check_cfg = &cx.sess().parse_sess.check_config;
2901-
for &(name, value) in cfg {
2902-
match check_cfg.expecteds.get(&name) {
2903-
Some(ExpectedValues::Some(values)) if !values.contains(&value) => {
2904-
let value = value.unwrap_or(kw::Empty);
2905-
cx.emit_lint(UNEXPECTED_CFGS, BuiltinUnexpectedCliConfigValue { name, value });
2906-
}
2907-
None if check_cfg.exhaustive_names => {
2908-
cx.emit_lint(UNEXPECTED_CFGS, BuiltinUnexpectedCliConfigName { name });
2909-
}
2910-
_ => { /* expected */ }
2911-
}
2912-
}
2913-
}
2914-
}

compiler/rustc_lint/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ early_lint_methods!(
179179
IncompleteInternalFeatures: IncompleteInternalFeatures,
180180
RedundantSemicolons: RedundantSemicolons,
181181
UnusedDocComment: UnusedDocComment,
182-
UnexpectedCfgs: UnexpectedCfgs,
183182
]
184183
]
185184
);

compiler/rustc_lint/src/lints.rs

-15
Original file line numberDiff line numberDiff line change
@@ -553,21 +553,6 @@ pub enum BuiltinSpecialModuleNameUsed {
553553
Main,
554554
}
555555

556-
#[derive(LintDiagnostic)]
557-
#[diag(lint_builtin_unexpected_cli_config_name)]
558-
#[help]
559-
pub struct BuiltinUnexpectedCliConfigName {
560-
pub name: Symbol,
561-
}
562-
563-
#[derive(LintDiagnostic)]
564-
#[diag(lint_builtin_unexpected_cli_config_value)]
565-
#[help]
566-
pub struct BuiltinUnexpectedCliConfigValue {
567-
pub name: Symbol,
568-
pub value: Symbol,
569-
}
570-
571556
// deref_into_dyn_supertrait.rs
572557
#[derive(LintDiagnostic)]
573558
#[diag(lint_supertrait_as_deref_target)]

compiler/rustc_lint_defs/src/builtin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3439,6 +3439,7 @@ declare_lint_pass! {
34393439
UNCONDITIONAL_PANIC,
34403440
UNCONDITIONAL_RECURSION,
34413441
UNDEFINED_NAKED_FUNCTION_ABI,
3442+
UNEXPECTED_CFGS,
34423443
UNFULFILLED_LINT_EXPECTATIONS,
34433444
UNINHABITED_STATIC,
34443445
UNKNOWN_CRATE_TYPES,

compiler/rustc_middle/src/mir/interpret/mod.rs

-7
Original file line numberDiff line numberDiff line change
@@ -525,13 +525,6 @@ impl<'tcx> TyCtxt<'tcx> {
525525
self.alloc_map.lock().reserve()
526526
}
527527

528-
/// Miri's provenance GC needs to see all live allocations. The interpreter manages most
529-
/// allocations but some are managed by [`TyCtxt`] and without this method the interpreter
530-
/// doesn't know their [`AllocId`]s are in use.
531-
pub fn iter_allocs<F: FnMut(AllocId)>(self, func: F) {
532-
self.alloc_map.lock().alloc_map.keys().copied().for_each(func)
533-
}
534-
535528
/// Reserves a new ID *if* this allocation has not been dedup-reserved before.
536529
/// Should only be used for "symbolic" allocations (function pointers, vtables, statics), we
537530
/// don't want to dedup IDs for "real" memory!

compiler/rustc_target/src/spec/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,6 @@ supported_targets! {
15871587
("armv7r-none-eabihf", armv7r_none_eabihf),
15881588

15891589
("x86_64-pc-solaris", x86_64_pc_solaris),
1590-
("x86_64-sun-solaris", x86_64_sun_solaris),
15911590
("sparcv9-sun-solaris", sparcv9_sun_solaris),
15921591

15931592
("x86_64-unknown-illumos", x86_64_unknown_illumos),

compiler/rustc_target/src/spec/targets/x86_64_sun_solaris.rs

-20
This file was deleted.

src/bootstrap/src/core/build_steps/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ const MIR_OPT_BLESS_TARGET_MAPPING: &[(&str, &str)] = &[
4949
("i686-unknown-linux-musl", "x86_64-unknown-linux-musl"),
5050
("i686-pc-windows-msvc", "x86_64-pc-windows-msvc"),
5151
("i686-pc-windows-gnu", "x86_64-pc-windows-gnu"),
52-
("i686-apple-darwin", "x86_64-apple-darwin"),
5352
// ARM Macs don't have a corresponding 32-bit target that they can (easily)
5453
// build for, so there is no entry for "aarch64-apple-darwin" here.
54+
// Likewise, i686 for macOS is no longer possible to build.
5555
];
5656

5757
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

src/ci/docker/host-x86_64/dist-various-2/Dockerfile

-6
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ ENV \
4848
AR_x86_64_pc_solaris=x86_64-pc-solaris2.10-ar \
4949
CC_x86_64_pc_solaris=x86_64-pc-solaris2.10-gcc \
5050
CXX_x86_64_pc_solaris=x86_64-pc-solaris2.10-g++ \
51-
AR_x86_64_sun_solaris=x86_64-sun-solaris2.10-ar \
52-
CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
53-
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++ \
5451
CC_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-gcc-9 \
5552
CXX_armv7_unknown_linux_gnueabi=arm-linux-gnueabi-g++-9 \
5653
AR_x86_64_fortanix_unknown_sgx=ar \
@@ -84,8 +81,6 @@ COPY host-x86_64/dist-various-2/build-fuchsia-toolchain.sh /tmp/
8481
RUN /tmp/build-fuchsia-toolchain.sh
8582
COPY host-x86_64/dist-various-2/build-solaris-toolchain.sh /tmp/
8683
RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386 pc
87-
# Build deprecated target 'x86_64-sun-solaris2.10' until removed
88-
RUN /tmp/build-solaris-toolchain.sh x86_64 amd64 solaris-i386 sun
8984
RUN /tmp/build-solaris-toolchain.sh sparcv9 sparcv9 solaris-sparc sun
9085
COPY host-x86_64/dist-various-2/build-x86_64-fortanix-unknown-sgx-toolchain.sh /tmp/
9186
RUN /tmp/build-x86_64-fortanix-unknown-sgx-toolchain.sh
@@ -120,7 +115,6 @@ ENV TARGETS=$TARGETS,wasm32-wasi
120115
ENV TARGETS=$TARGETS,wasm32-wasi-preview1-threads
121116
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
122117
ENV TARGETS=$TARGETS,x86_64-pc-solaris
123-
ENV TARGETS=$TARGETS,x86_64-sun-solaris
124118
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
125119
ENV TARGETS=$TARGETS,x86_64-fortanix-unknown-sgx
126120
ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda

src/ci/docker/host-x86_64/x86_64-gnu-tools/checktools.sh

+10-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,16 @@ cat /tmp/toolstate/toolstates.json
2525
python3 "$X_PY" test --stage 2 check-tools
2626
python3 "$X_PY" test --stage 2 src/tools/clippy
2727
python3 "$X_PY" test --stage 2 src/tools/rustfmt
28-
python3 "$X_PY" test --stage 2 src/tools/miri
28+
29+
# Testing Miri is a bit more complicated.
30+
# We set the GC interval to the shortest possible value (0 would be off) to increase the chance
31+
# that bugs which only surface when the GC runs at a specific time are more likely to cause CI to fail.
32+
# This significantly increases the runtime of our test suite, or we'd do this in PR CI too.
33+
if [[ -z "${PR_CI_JOB:-}" ]]; then
34+
MIRIFLAGS=-Zmiri-provenance-gc=1 python3 "$X_PY" test --stage 2 src/tools/miri
35+
else
36+
python3 "$X_PY" test --stage 2 src/tools/miri
37+
fi
2938
# We natively run this script on x86_64-unknown-linux-gnu and x86_64-pc-windows-msvc.
3039
# Also cover some other targets via cross-testing, in particular all tier 1 targets.
3140
export BOOTSTRAP_SKIP_TARGET_SANITY=1 # we don't need `cc` for these targets

src/doc/rustc/src/platform-support.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ target | std | notes
165165
`riscv64gc-unknown-none-elf` | * | Bare RISC-V (RV64IMAFDC ISA)
166166
`riscv64imac-unknown-none-elf` | * | Bare RISC-V (RV64IMAC ISA)
167167
`sparc64-unknown-linux-gnu` | ✓ | SPARC Linux (kernel 4.4, glibc 2.23)
168-
`sparcv9-sun-solaris` | ✓ | SPARC Solaris 10/11, illumos
168+
`sparcv9-sun-solaris` | ✓ | SPARC Solaris 11, illumos
169169
`thumbv6m-none-eabi` | * | Bare ARMv6-M
170170
`thumbv7em-none-eabi` | * | Bare ARMv7E-M
171171
`thumbv7em-none-eabihf` | * | Bare ARMV7E-M, hardfloat
@@ -184,7 +184,7 @@ target | std | notes
184184
`x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia`
185185
[`x86_64-unknown-fuchsia`](platform-support/fuchsia.md) | ✓ | 64-bit x86 Fuchsia
186186
[`x86_64-linux-android`](platform-support/android.md) | ✓ | 64-bit x86 Android
187-
`x86_64-pc-solaris` | ✓ | 64-bit Solaris 10/11, illumos
187+
`x86_64-pc-solaris` | ✓ | 64-bit Solaris 11, illumos
188188
`x86_64-unknown-linux-gnux32` | ✓ | 64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)
189189
[`x86_64-unknown-none`](platform-support/x86_64-unknown-none.md) | * | Freestanding/bare-metal x86_64, softfloat
190190
`x86_64-unknown-redox` | ✓ | Redox OS
@@ -342,7 +342,6 @@ target | std | host | notes
342342
[`x86_64-pc-nto-qnx710`](platform-support/nto-qnx.md) | ✓ | | x86 64-bit QNX Neutrino 7.1 RTOS |
343343
[`x86_64-pc-windows-gnullvm`](platform-support/pc-windows-gnullvm.md) | ✓ | ✓ |
344344
`x86_64-pc-windows-msvc` | * | | 64-bit Windows XP support
345-
`x86_64-sun-solaris` | ? | | Deprecated target for 64-bit Solaris 10/11, illumos
346345
[`x86_64-unikraft-linux-musl`](platform-support/unikraft-linux-musl.md) | ✓ | | 64-bit Unikraft with musl
347346
`x86_64-unknown-dragonfly` | ✓ | ✓ | 64-bit DragonFlyBSD
348347
`x86_64-unknown-haiku` | ✓ | ✓ | 64-bit Haiku

src/doc/rustdoc/src/read-documentation/search.md

+43-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ the standard library and functions that are included in the results list:
7272
| [`stdout, [u8]`][stdoutu8] | `Stdout::write` |
7373
| [`any -> !`][] | `panic::panic_any` |
7474
| [`vec::intoiter<T> -> [T]`][iterasslice] | `IntoIter::as_slice` and `IntoIter::next_chunk` |
75+
| [`iterator<T>, fnmut -> T`][iterreduce] | `Iterator::reduce` and `Iterator::find` |
7576

7677
[`usize -> vec`]: ../../std/vec/struct.Vec.html?search=usize%20-%3E%20vec&filter-crate=std
7778
[`vec, vec -> bool`]: ../../std/vec/struct.Vec.html?search=vec,%20vec%20-%3E%20bool&filter-crate=std
@@ -81,6 +82,7 @@ the standard library and functions that are included in the results list:
8182
[`any -> !`]: ../../std/vec/struct.Vec.html?search=any%20-%3E%20!&filter-crate=std
8283
[stdoutu8]: ../../std/vec/struct.Vec.html?search=stdout%2C%20[u8]&filter-crate=std
8384
[iterasslice]: ../../std/vec/struct.Vec.html?search=vec%3A%3Aintoiter<T>%20->%20[T]&filter-crate=std
85+
[iterreduce]: ../../std/index.html?search=iterator<T>%2C%20fnmut%20->%20T&filter-crate=std
8486

8587
### How type-based search works
8688

@@ -95,16 +97,47 @@ After deciding which items are type parameters and which are actual types, it
9597
then searches by matching up the function parameters (written before the `->`)
9698
and the return types (written after the `->`). Type matching is order-agnostic,
9799
and allows items to be left out of the query, but items that are present in the
98-
query must be present in the function for it to match.
100+
query must be present in the function for it to match. The `self` parameter is
101+
treated the same as any other parameter, and `Self` is resolved to the
102+
underlying type's name.
99103

100104
Function signature searches can query generics, wrapped in angle brackets, and
101105
traits will be normalized like types in the search engine if no type parameters
102106
match them. For example, a function with the signature
103107
`fn my_function<I: Iterator<Item=u32>>(input: I) -> usize`
104108
can be matched with the following queries:
105109

106-
* `Iterator<u32> -> usize`
107-
* `Iterator -> usize`
110+
* `Iterator<Item=u32> -> usize`
111+
* `Iterator<u32> -> usize` (you can leave out the `Item=` part)
112+
* `Iterator -> usize` (you can leave out iterator's generic entirely)
113+
* `T -> usize` (you can match with a generic parameter)
114+
115+
Each of the above queries is progressively looser, except the last one
116+
would not match `dyn Iterator`, since that's not a type parameter.
117+
118+
If a bound has multiple associated types, specifying the name allows you to
119+
pick which one gets matched. If no name is specified, then the query will
120+
match of any of them. For example,
121+
122+
```rust
123+
pub trait MyTrait {
124+
type First;
125+
type Second;
126+
}
127+
128+
/// This function can be found using the following search queries:
129+
///
130+
/// MyTrait<First=u8, Second=u32> -> bool
131+
/// MyTrait<u32, First=u8> -> bool
132+
/// MyTrait<Second=u32> -> bool
133+
/// MyTrait<u32, u8> -> bool
134+
///
135+
/// The following queries, however, will *not* match it:
136+
///
137+
/// MyTrait<First=u32> -> bool
138+
/// MyTrait<u32, u32> -> bool
139+
pub fn my_fn(x: impl MyTrait<First=u8, Second=u32>) -> bool { true }
140+
```
108141

109142
Generics and function parameters are order-agnostic, but sensitive to nesting
110143
and number of matches. For example, a function with the signature
@@ -134,6 +167,10 @@ Most of these limitations should be addressed in future version of Rustdoc.
134167
with that bound, it'll match, but `option<T> -> T where T: Default`
135168
cannot be precisely searched for (use `option<Default> -> Default`).
136169

170+
* Supertraits, type aliases, and Deref are all ignored. Search mostly
171+
operates on type signatures *as written*, and not as they are
172+
represented within the compiler.
173+
137174
* Type parameters match type parameters, such that `Option<A>` matches
138175
`Option<T>`, but never match concrete types in function signatures.
139176
A trait named as if it were a type, such as `Option<Read>`, will match
@@ -183,7 +220,8 @@ slice = OPEN-SQUARE-BRACKET [ nonempty-arg-list ] CLOSE-SQUARE-BRACKET
183220
arg = [type-filter *WS COLON *WS] (path [generics] / slice / [!])
184221
type-sep = COMMA/WS *(COMMA/WS)
185222
nonempty-arg-list = *(type-sep) arg *(type-sep arg) *(type-sep)
186-
generics = OPEN-ANGLE-BRACKET [ nonempty-arg-list ] *(type-sep)
223+
generic-arg-list = *(type-sep) arg [ EQUAL arg ] *(type-sep arg [ EQUAL arg ]) *(type-sep)
224+
generics = OPEN-ANGLE-BRACKET [ generic-arg-list ] *(type-sep)
187225
CLOSE-ANGLE-BRACKET
188226
return-args = RETURN-ARROW *(type-sep) nonempty-arg-list
189227
@@ -230,6 +268,7 @@ DOUBLE-COLON = "::"
230268
QUOTE = %x22
231269
COMMA = ","
232270
RETURN-ARROW = "->"
271+
EQUAL = "="
233272
234273
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
235274
DIGIT = %x30-39

src/doc/unstable-book/src/compiler-flags/check-cfg.md

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ and `cfg!(name = "value")` call. It will check that the `"value"` specified is p
3535
list of expected values. If `"value"` is not in it, then `rustc` will report an `unexpected_cfgs`
3636
lint diagnostic. The default diagnostic level for this lint is `Warn`.
3737

38+
The command line `--cfg` arguments are currently *NOT* checked but may very well be checked in
39+
the future.
40+
3841
To enable checking of values, but to provide an empty set of expected values, use these forms:
3942

4043
```bash

0 commit comments

Comments
 (0)