Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #124026

Merged
merged 43 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b75e6b4
fetch submodule before checking llvm stamp
onur-ozkan Mar 17, 2024
3683b11
create `Build::update_existing_submodule` and use for llvm
onur-ozkan Mar 28, 2024
1ca1457
Support type '/' to search
mu001999 Apr 2, 2024
5519445
set --sysroot outside the driver rather than messing with the argumen…
RalfJung Mar 25, 2024
9ec38ea
readme updates
RalfJung Mar 26, 2024
a57a990
drop `changelog-seen`
onur-ozkan Apr 10, 2024
cce21be
add change entry for the removal of `changelog-seen`
onur-ozkan Apr 10, 2024
fb779ee
Windows: add basic support for FormatMessageW
RalfJung Apr 15, 2024
65978ed
Auto merge of #3464 - RalfJung:windows-err, r=RalfJung
bors Apr 15, 2024
3868c9f
fix error display for './miri run --dep'
RalfJung Apr 15, 2024
34ab668
Auto merge of #3465 - RalfJung:run-dep-error-format, r=RalfJung
bors Apr 15, 2024
e928fc5
add some basic support for GetFullPathNameW
RalfJung Apr 15, 2024
69e8e2d
Auto merge of #3411 - RalfJung:sysroot, r=RalfJung
bors Apr 15, 2024
0dee2b1
Auto merge of #3466 - RalfJung:GetFullPathNameW, r=RalfJung
bors Apr 15, 2024
54f90bc
Make `split_simd_to_128bit_chunks` take only one operand
eduardosm Apr 14, 2024
ca2bd01
Bump rustc-build-sysroot to 0.4.6
RossSmyth Apr 15, 2024
67334df
The new solver ignores `DefineOpaqueTypes`, so switch it to `Yes`
oli-obk Apr 15, 2024
909fcfc
Stabilize checking of cfgs at compile-time: --check-cfg option
Urgau Feb 25, 2024
a20de73
Move --check-cfg documentation to stable books
Urgau Feb 25, 2024
0abd67f
Auto merge of #3462 - eduardosm:chunk-128, r=RalfJung
bors Apr 15, 2024
78ea5db
Auto merge of #3467 - RossSmyth:bumpSysroot, r=RalfJung
bors Apr 15, 2024
ef1d084
Match ergonomics 2024: `mut` doesn't reset binding mode
Jules-Bertholet Apr 6, 2024
83f330f
Migration lint
Jules-Bertholet Apr 6, 2024
d5d700d
Temporarily remove future compatibility label from migration lint
Jules-Bertholet Apr 6, 2024
1b2e471
Fix typo
Jules-Bertholet Apr 14, 2024
e13911e
Rename feature gate
Jules-Bertholet Apr 14, 2024
1b6d435
Mark gate as incomplete
Jules-Bertholet Apr 14, 2024
7a32117
Fix tests
Jules-Bertholet Apr 14, 2024
2f08c2c
update lockfile
RalfJung Apr 16, 2024
876ac7b
avoid passing --sysroot twice in bootstrap
RalfJung Apr 16, 2024
e03926c
Change a diagnostics-path-only `DefineOpaqueTypes` to `Yes`.
oli-obk Apr 16, 2024
18bfca5
interpret: pass MemoryKind to before_memory_deallocation
RalfJung Apr 16, 2024
5b8b9cf
interpret: remove outdated comment
RalfJung Apr 16, 2024
592b1ca
Rollup merge of #122632 - onur-ozkan:fix-llvm-caching-bug, r=albertla…
matthiaskrgr Apr 16, 2024
49f6c95
Rollup merge of #123355 - mu001999:rustdoc/search, r=GuillaumeGomez
matthiaskrgr Apr 16, 2024
f54219c
Rollup merge of #123501 - Urgau:stabilize-check-cfg, r=petrochenkov
matthiaskrgr Apr 16, 2024
dc40da8
Rollup merge of #123535 - Jules-Bertholet:mut_dont_reset_binding_mode…
matthiaskrgr Apr 16, 2024
0aa7235
Rollup merge of #123711 - onur-ozkan:drop-changelog-seen, r=albertlar…
matthiaskrgr Apr 16, 2024
cad7d94
Rollup merge of #123969 - oli-obk:define_opaque_types6, r=compiler-er…
matthiaskrgr Apr 16, 2024
cf79004
Rollup merge of #124007 - RalfJung:miri, r=RalfJung
matthiaskrgr Apr 16, 2024
25fd90c
Rollup merge of #124017 - oli-obk:define_opaque_types8, r=compiler-er…
matthiaskrgr Apr 16, 2024
864ab0c
Rollup merge of #124018 - RalfJung:dealloc-memory-kind, r=oli-obk
matthiaskrgr Apr 16, 2024
4971d9f
Rollup merge of #124024 - RalfJung:interpret-comment, r=oli-obk
matthiaskrgr Apr 16, 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
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3364,9 +3364,9 @@ dependencies = [

[[package]]
name = "rustc-build-sysroot"
version = "0.4.5"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a26170e1d79ea32f7ccec3188dd13cfc1f18c82764a9cbc1071667c0f865a4ea"
checksum = "a9bf37423495cd3a6a9ef8c75fc4566de0d26de0ab75f36f67a426e58df5768c"
dependencies = [
"anyhow",
"rustc_version",
Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_const_eval/src/interpret/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,6 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
/// allocation (because a copy had to be done to adjust things), machine memory will
/// cache the result. (This relies on `AllocMap::get_or` being able to add the
/// owned allocation to the map even when the map is shared.)
///
/// This must only fail if `alloc` contains provenance.
fn adjust_allocation<'b>(
ecx: &InterpCx<'mir, 'tcx, Self>,
id: AllocId,
Expand Down Expand Up @@ -427,6 +425,7 @@ pub trait Machine<'mir, 'tcx: 'mir>: Sized {
_prov: (AllocId, Self::ProvenanceExtra),
_size: Size,
_align: Align,
_kind: MemoryKind<Self::MemoryKind>,
) -> InterpResult<'tcx> {
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_const_eval/src/interpret/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
self.allocate_raw_ptr(alloc, kind)
}

/// This can fail only if `alloc` contains provenance.
pub fn allocate_raw_ptr(
&mut self,
alloc: Allocation,
Expand Down Expand Up @@ -355,6 +354,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
(alloc_id, prov),
size,
alloc.align,
kind,
)?;

// Don't forget to remember size and align of this now-dead allocation
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ declare_features! (
(unstable, more_qualified_paths, "1.54.0", Some(86935)),
/// Allows the `#[must_not_suspend]` attribute.
(unstable, must_not_suspend, "1.57.0", Some(83310)),
/// Make `mut` not reset the binding mode on edition >= 2024.
(incomplete, mut_preserve_binding_mode_2024, "CURRENT_RUSTC_VERSION", Some(123076)),
/// Allows `mut ref` and `mut ref mut` identifier patterns.
(incomplete, mut_ref, "CURRENT_RUSTC_VERSION", Some(123076)),
/// Allows using `#[naked]` on functions.
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_hir_typeck/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ hir_typeck_ctor_is_private = tuple struct constructor `{$def}` is private

hir_typeck_deref_is_empty = this expression `Deref`s to `{$deref_ty}` which implements `is_empty`

hir_typeck_dereferencing_mut_binding = dereferencing `mut` binding
.label = `mut` dereferences the type of this binding
.help = this will change in edition 2024

hir_typeck_expected_default_return_type = expected `()` because of default return type

hir_typeck_expected_return_type = expected `{$expected}` because of return type
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_hir_typeck/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,3 +632,11 @@ pub enum SuggestBoxingForReturnImplTrait {
ends: Vec<Span>,
},
}

#[derive(LintDiagnostic)]
#[diag(hir_typeck_dereferencing_mut_binding)]
pub struct DereferencingMutBinding {
#[label]
#[help]
pub span: Span,
}
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/src/method/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1696,7 +1696,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
if let ProbeResult::Match = result
&& self
.at(&ObligationCause::dummy(), self.param_env)
.sup(DefineOpaqueTypes::No, return_ty, xform_ret_ty)
.sup(DefineOpaqueTypes::Yes, return_ty, xform_ret_ty)
.is_err()
{
result = ProbeResult::BadReturnType;
Expand Down
23 changes: 19 additions & 4 deletions compiler/rustc_hir_typeck/src/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use rustc_hir::pat_util::EnumerateAndAdjustIterator;
use rustc_hir::{self as hir, BindingAnnotation, ByRef, HirId, Mutability, Pat, PatKind};
use rustc_infer::infer;
use rustc_infer::infer::type_variable::TypeVariableOrigin;
use rustc_lint as lint;
use rustc_middle::mir::interpret::ErrorHandled;
use rustc_middle::ty::{self, Adt, Ty, TypeVisitableExt};
use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
Expand Down Expand Up @@ -629,12 +630,26 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
expected: Ty<'tcx>,
pat_info: PatInfo<'tcx, '_>,
) -> Ty<'tcx> {
let PatInfo { binding_mode: def_bm, top_info: ti, .. } = pat_info;
let PatInfo { binding_mode: BindingAnnotation(def_br, _), top_info: ti, .. } = pat_info;

// Determine the binding mode...
let bm = match ba {
BindingAnnotation(ByRef::No, Mutability::Not) => def_bm,
_ => ba,
BindingAnnotation(ByRef::No, Mutability::Mut)
if !(pat.span.at_least_rust_2024()
&& self.tcx.features().mut_preserve_binding_mode_2024)
&& matches!(def_br, ByRef::Yes(_)) =>
{
// `mut x` resets the binding mode in edition <= 2021.
self.tcx.emit_node_span_lint(
lint::builtin::DEREFERENCING_MUT_BINDING,
pat.hir_id,
pat.span,
errors::DereferencingMutBinding { span: pat.span },
);
BindingAnnotation(ByRef::No, Mutability::Mut)
}
BindingAnnotation(ByRef::No, mutbl) => BindingAnnotation(def_br, mutbl),
BindingAnnotation(ByRef::Yes(_), _) => ba,
};
// ...and store it in a side table:
self.typeck_results.borrow_mut().pat_binding_modes_mut().insert(pat.hir_id, bm);
Expand Down Expand Up @@ -743,7 +758,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}

// Precondition: pat is a Ref(_) pattern
/// Precondition: pat is a `Ref(_)` pattern
fn borrow_pat_suggestion(&self, err: &mut Diag<'_>, pat: &Pat<'_>) {
let tcx = self.tcx;
if let PatKind::Ref(inner, mutbl) = pat.kind
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/at.rs
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ impl<'a, 'tcx> Trace<'a, 'tcx> {
{
let Trace { at, trace } = self;
debug_assert!(at.infcx.next_trait_solver());
let mut fields = at.infcx.combine_fields(trace, at.param_env, DefineOpaqueTypes::No);
let mut fields = at.infcx.combine_fields(trace, at.param_env, DefineOpaqueTypes::Yes);
fields
.equate(StructurallyRelateAliases::Yes)
.relate(a, b)
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_lint/src/context/diagnostics/check_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ pub(super) fn unexpected_cfg_name(
diag.note("see <https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg> for more information about checking conditional configuration");
} else {
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
diag.note("see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration");
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
}
}

Expand Down Expand Up @@ -272,6 +272,6 @@ pub(super) fn unexpected_cfg_value(
if !is_cfg_a_well_know_name {
diag.help(format!("to expect this configuration use `--check-cfg={inst}`"));
}
diag.note("see <https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html> for more information about checking conditional configuration");
diag.note("see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration");
}
}
37 changes: 37 additions & 0 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ declare_lint_pass! {
DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
DEPRECATED_IN_FUTURE,
DEPRECATED_WHERE_CLAUSE_LOCATION,
DEREFERENCING_MUT_BINDING,
DUPLICATE_MACRO_ATTRIBUTES,
ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT,
ELIDED_LIFETIMES_IN_PATHS,
Expand Down Expand Up @@ -1627,6 +1628,42 @@ declare_lint! {
"detect mut variables which don't need to be mutable"
}

declare_lint! {
/// The `dereferencing_mut_binding` lint detects a `mut x` pattern that resets the binding mode,
/// as this behavior will change in rust 2024.
///
/// ### Example
///
/// ```rust
/// # #![warn(dereferencing_mut_binding)]
/// let x = Some(123u32);
/// let _y = match &x {
/// Some(mut x) => {
/// x += 1;
/// x
/// }
/// None => 0,
/// };
/// ```
///
/// {{produces}}
///
/// ### Explanation
///
/// Without the `mut`, `x` would have type `&u32`. Pre-2024, adding `mut` makes `x` have type
/// `u32`, which was deemed surprising. After edition 2024, adding `mut` will not change the
/// type of `x`. This lint warns users of editions before 2024 to update their code.
pub DEREFERENCING_MUT_BINDING,
Allow,
"detects `mut x` bindings that change the type of `x`",
@feature_gate = sym::mut_preserve_binding_mode_2024;
// FIXME uncomment below upon stabilization
/*@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2024),
reference: "123076",
};*/
}

declare_lint! {
/// The `unconditional_recursion` lint detects functions that cannot
/// return without calling themselves.
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,7 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
opt::flag_s("h", "help", "Display this message"),
opt::multi_s("", "cfg", "Configure the compilation environment.
SPEC supports the syntax `NAME[=\"VALUE\"]`.", "SPEC"),
opt::multi("", "check-cfg", "Provide list of valid cfg options for checking", "SPEC"),
opt::multi_s("", "check-cfg", "Provide list of expected cfgs for checking", "SPEC"),
opt::multi_s(
"L",
"",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/config/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ impl CheckCfg {
// `tests/ui/check-cfg/well-known-values.rs` (in order to test the
// expected values of the new config) and bless the all directory.
//
// Don't forget to update `src/doc/unstable-book/src/compiler-flags/check-cfg.md`
// Don't forget to update `src/doc/rustc/src/check-cfg.md`
// in the unstable book as well!

ins!(sym::debug_assertions, no_values);
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,7 @@ symbols! {
multiple_supertrait_upcastable,
must_not_suspend,
must_use,
mut_preserve_binding_mode_2024,
mut_ref,
naked,
naked_functions,
Expand Down
4 changes: 0 additions & 4 deletions src/bootstrap/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ fn main() {
fn check_version(config: &Config) -> Option<String> {
let mut msg = String::new();

if config.changelog_seen.is_some() {
msg.push_str("WARNING: The use of `changelog-seen` is deprecated. Please refer to `change-id` option in `config.example.toml` instead.\n");
}

let latest_change_id = CONFIG_CHANGE_HISTORY.last().unwrap().change_id;
let warned_id_path = config.out.join("bootstrap").join(".last-warned-change-id");

Expand Down
7 changes: 6 additions & 1 deletion src/bootstrap/src/core/build_steps/llvm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ pub fn prebuilt_llvm_config(
builder: &Builder<'_>,
target: TargetSelection,
) -> Result<LlvmResult, Meta> {
// If we have llvm submodule initialized already, sync it.
builder.update_existing_submodule(&Path::new("src").join("llvm-project"));

builder.config.maybe_download_ci_llvm();

// If we're using a custom LLVM bail out here, but we can only use a
Expand All @@ -94,6 +97,9 @@ pub fn prebuilt_llvm_config(
}
}

// Initialize the llvm submodule if not initialized already.
builder.update_submodule(&Path::new("src").join("llvm-project"));

let root = "src/llvm-project/llvm";
let out_dir = builder.llvm_out(target);

Expand Down Expand Up @@ -280,7 +286,6 @@ impl Step for Llvm {
Err(m) => m,
};

builder.update_submodule(&Path::new("src").join("llvm-project"));
if builder.llvm_link_shared() && target.is_windows() {
panic!("shared linking to LLVM is not currently supported on {}", target.triple);
}
Expand Down
16 changes: 1 addition & 15 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ impl LldMode {
/// `config.example.toml`.
#[derive(Default, Clone)]
pub struct Config {
pub changelog_seen: Option<usize>, // FIXME: Deprecated field. Remove it at 2024.
pub change_id: Option<usize>,
pub bypass_bootstrap_lock: bool,
pub ccache: Option<String>,
Expand Down Expand Up @@ -605,7 +604,6 @@ impl Target {
#[derive(Deserialize, Default)]
#[serde(deny_unknown_fields, rename_all = "kebab-case")]
pub(crate) struct TomlConfig {
changelog_seen: Option<usize>, // FIXME: Deprecated field. Remove it at 2024.
#[serde(flatten)]
change_id: ChangeIdWrapper,
build: Option<Build>,
Expand Down Expand Up @@ -645,17 +643,7 @@ trait Merge {
impl Merge for TomlConfig {
fn merge(
&mut self,
TomlConfig {
build,
install,
llvm,
rust,
dist,
target,
profile: _,
changelog_seen,
change_id,
}: Self,
TomlConfig { build, install, llvm, rust, dist, target, profile: _, change_id }: Self,
replace: ReplaceOpt,
) {
fn do_merge<T: Merge>(x: &mut Option<T>, y: Option<T>, replace: ReplaceOpt) {
Expand All @@ -667,7 +655,6 @@ impl Merge for TomlConfig {
}
}
}
self.changelog_seen.merge(changelog_seen, replace);
self.change_id.inner.merge(change_id.inner, replace);
do_merge(&mut self.build, build, replace);
do_merge(&mut self.install, install, replace);
Expand Down Expand Up @@ -1400,7 +1387,6 @@ impl Config {
}
toml.merge(override_toml, ReplaceOpt::Override);

config.changelog_seen = toml.changelog_seen;
config.change_id = toml.change_id.inner;

let Build {
Expand Down
12 changes: 12 additions & 0 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,18 @@ impl Build {
}
}

/// Updates the given submodule only if it's initialized already; nothing happens otherwise.
pub fn update_existing_submodule(&self, submodule: &Path) {
// Avoid running git when there isn't a git checkout.
if !self.config.submodules(self.rust_info()) {
return;
}

if GitInfo::new(false, submodule).is_managed_git_subrepository() {
self.update_submodule(submodule);
}
}

/// Executes the entire build, as configured by the flags and configuration.
pub fn build(&mut self) {
unsafe {
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "`rust.split-debuginfo` has been moved to `target.<triple>.split-debuginfo` and its default value is determined for each target individually.",
},
ChangeInfo {
change_id: 123711,
severity: ChangeSeverity::Warning,
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.",
},
];
1 change: 1 addition & 0 deletions src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
- [Profile-guided Optimization](profile-guided-optimization.md)
- [Instrumentation-based Code Coverage](instrument-coverage.md)
- [Linker-plugin-based LTO](linker-plugin-lto.md)
- [Checking conditional configurations](check-cfg.md)
- [Exploit Mitigations](exploit-mitigations.md)
- [Symbol Mangling](symbol-mangling/index.md)
- [v0 Symbol Format](symbol-mangling/v0.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# `check-cfg`

The tracking issue for this feature is: [#82450](https://github.com/rust-lang/rust/issues/82450).

------------------------

This feature enables checking of conditional configuration.
# Checking conditional configurations

`rustc` accepts the `--check-cfg` option, which specifies whether to check conditions and how to
check them. The `--check-cfg` option takes a value, called the _check cfg specification_.
Expand Down
10 changes: 10 additions & 0 deletions src/doc/rustc/src/command-line-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ The value can either be a single identifier or two identifiers separated by `=`.
For examples, `--cfg 'verbose'` or `--cfg 'feature="serde"'`. These correspond
to `#[cfg(verbose)]` and `#[cfg(feature = "serde")]` respectively.

<a id="option-check-cfg"></a>
## `--check-cfg`: enables checking conditional configurations

This flag will enable checking conditional configurations.
Refer to the [Checking conditional configurations](check-cfg.md) of this book
for further details and explanation.

For examples, `--check-cfg 'cfg(verbose)'` or `--check-cfg 'cfg(feature, values("serde"))'`.
These correspond to `#[cfg(verbose)]` and `#[cfg(feature = "serde")]` respectively.

<a id="option-l-search-path"></a>
## `-L`: add a directory to the library search path

Expand Down
Loading
Loading