Skip to main content

rustc_session/config/
cfg.rs

1//! cfg and check-cfg configuration
2//!
3//! This module contains the definition of [`Cfg`] and [`CheckCfg`]
4//! as well as the logic for creating the default configuration for a
5//! given [`Session`].
6//!
7//! It also contains the filling of the well known configs, which should
8//! ALWAYS be in sync with the default_configuration.
9//!
10//! ## Adding a new cfg
11//!
12//! Adding a new feature requires two new symbols one for the cfg itself
13//! and the second one for the unstable feature gate, those are defined in
14//! `rustc_span::symbol`.
15//!
16//! As well as the following points,
17//!  - Add the activation logic in [`default_configuration`]
18//!  - Add the cfg to [`CheckCfg::fill_well_known`] (and related files),
19//!    so that the compiler can know the cfg is expected
20//!  - Add the cfg in [`disallow_cfgs`] to disallow users from setting it via `--cfg`
21//!  - Add the feature gating in `compiler/rustc_feature/src/builtin_attrs.rs`
22
23use std::hash::Hash;
24use std::iter;
25
26use rustc_abi::Align;
27use rustc_ast::ast;
28use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
29use rustc_lint_defs::builtin::EXPLICIT_BUILTIN_CFGS_IN_FLAGS;
30use rustc_span::{Symbol, sym};
31use rustc_target::spec::{PanicStrategy, RelocModel, SanitizerSet, Target};
32
33use crate::config::{CrateType, FmtDebug};
34use crate::{Session, errors};
35
36/// The parsed `--cfg` options that define the compilation environment of the
37/// crate, used to drive conditional compilation.
38///
39/// An `FxIndexSet` is used to ensure deterministic ordering of error messages
40/// relating to `--cfg`.
41pub type Cfg = FxIndexSet<(Symbol, Option<Symbol>)>;
42
43/// The parsed `--check-cfg` options.
44#[derive(#[automatically_derived]
impl ::core::default::Default for CheckCfg {
    #[inline]
    fn default() -> CheckCfg {
        CheckCfg {
            exhaustive_names: ::core::default::Default::default(),
            exhaustive_values: ::core::default::Default::default(),
            expecteds: ::core::default::Default::default(),
            well_known_names: ::core::default::Default::default(),
        }
    }
}Default)]
45pub struct CheckCfg {
46    /// Is well known names activated
47    pub exhaustive_names: bool,
48    /// Is well known values activated
49    pub exhaustive_values: bool,
50    /// All the expected values for a config name
51    pub expecteds: FxHashMap<Symbol, ExpectedValues<Symbol>>,
52    /// Well known names (only used for diagnostics purposes)
53    pub well_known_names: FxHashSet<Symbol>,
54}
55
56pub enum ExpectedValues<T> {
57    Some(FxHashSet<Option<T>>),
58    Any,
59}
60
61impl<T: Eq + Hash> ExpectedValues<T> {
62    fn insert(&mut self, value: T) -> bool {
63        match self {
64            ExpectedValues::Some(expecteds) => expecteds.insert(Some(value)),
65            ExpectedValues::Any => false,
66        }
67    }
68
69    pub fn contains(&self, value: &Option<T>) -> bool {
70        match self {
71            ExpectedValues::Some(expecteds) => expecteds.contains(value),
72            ExpectedValues::Any => false,
73        }
74    }
75}
76
77impl<T: Eq + Hash> Extend<T> for ExpectedValues<T> {
78    fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
79        match self {
80            ExpectedValues::Some(expecteds) => expecteds.extend(iter.into_iter().map(Some)),
81            ExpectedValues::Any => {}
82        }
83    }
84}
85
86impl<'a, T: Eq + Hash + Copy + 'a> Extend<&'a T> for ExpectedValues<T> {
87    fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I) {
88        match self {
89            ExpectedValues::Some(expecteds) => expecteds.extend(iter.into_iter().map(|a| Some(*a))),
90            ExpectedValues::Any => {}
91        }
92    }
93}
94
95/// Disallow builtin cfgs from the CLI.
96pub(crate) fn disallow_cfgs(sess: &Session, user_cfgs: &Cfg) {
97    let disallow = |cfg: &(Symbol, Option<Symbol>), controlled_by| {
98        let cfg_name = cfg.0;
99        let cfg = if let Some(value) = cfg.1 {
100            ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}=\"{1}\"", cfg_name, value))
    })format!(r#"{}="{}""#, cfg_name, value)
101        } else {
102            ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}", cfg_name))
    })format!("{}", cfg_name)
103        };
104        sess.psess.opt_span_buffer_lint(
105            EXPLICIT_BUILTIN_CFGS_IN_FLAGS,
106            None,
107            ast::CRATE_NODE_ID,
108            errors::UnexpectedBuiltinCfg { cfg, cfg_name, controlled_by }.into(),
109        )
110    };
111
112    // We want to restrict setting builtin cfgs that will produce incoherent behavior
113    // between the cfg and the rustc cli flag that sets it.
114    //
115    // The tests are in tests/ui/cfg/disallowed-cli-cfgs.rs.
116
117    // By-default all builtin cfgs are disallowed, only those are allowed:
118    //  - test: as it makes sense to the have the `test` cfg active without the builtin
119    //          test harness. See Cargo `harness = false` config.
120    //
121    // Cargo `--cfg test`: https://github.com/rust-lang/cargo/blob/bc89bffa5987d4af8f71011c7557119b39e44a65/src/cargo/core/compiler/mod.rs#L1124
122
123    for cfg in user_cfgs {
124        match cfg {
125            (sym::overflow_checks, None) => disallow(cfg, "-C overflow-checks"),
126            (sym::debug_assertions, None) => disallow(cfg, "-C debug-assertions"),
127            (sym::ub_checks, None) => disallow(cfg, "-Z ub-checks"),
128            (sym::contract_checks, None) => disallow(cfg, "-Z contract-checks"),
129            (sym::sanitize, None | Some(_)) => disallow(cfg, "-Z sanitizer"),
130            (
131                sym::sanitizer_cfi_generalize_pointers | sym::sanitizer_cfi_normalize_integers,
132                None | Some(_),
133            ) => disallow(cfg, "-Z sanitizer=cfi"),
134            (sym::proc_macro, None) => disallow(cfg, "--crate-type proc-macro"),
135            (sym::panic, Some(sym::abort | sym::unwind | sym::immediate_abort)) => {
136                disallow(cfg, "-C panic")
137            }
138            (sym::target_feature, Some(_)) => disallow(cfg, "-C target-feature"),
139            (sym::unix, None)
140            | (sym::windows, None)
141            | (sym::relocation_model, Some(_))
142            | (sym::target_abi, None | Some(_))
143            | (sym::target_arch, Some(_))
144            | (sym::target_endian, Some(_))
145            | (sym::target_env, None | Some(_))
146            | (sym::target_family, Some(_))
147            | (sym::target_object_format, Some(_))
148            | (sym::target_os, Some(_))
149            | (sym::target_pointer_width, Some(_))
150            | (sym::target_vendor, None | Some(_))
151            | (sym::target_has_atomic, Some(_))
152            | (sym::target_has_atomic_equal_alignment, Some(_))
153            | (sym::target_has_atomic_load_store, Some(_))
154            | (sym::target_has_reliable_f16, None | Some(_))
155            | (sym::target_has_reliable_f16_math, None | Some(_))
156            | (sym::target_has_reliable_f128, None | Some(_))
157            | (sym::target_has_reliable_f128_math, None | Some(_))
158            | (sym::target_thread_local, None) => disallow(cfg, "--target"),
159            (sym::fmt_debug, None | Some(_)) => disallow(cfg, "-Z fmt-debug"),
160            (sym::emscripten_wasm_eh, None | Some(_)) => disallow(cfg, "-Z emscripten_wasm_eh"),
161            _ => {}
162        }
163    }
164}
165
166/// Generate the default configs for a given session
167pub(crate) fn default_configuration(sess: &Session) -> Cfg {
168    let mut ret = Cfg::default();
169
170    macro_rules! ins_none {
171        ($key:expr) => {
172            ret.insert(($key, None));
173        };
174    }
175    macro_rules! ins_str {
176        ($key:expr, $val_str:expr) => {
177            ret.insert(($key, Some(Symbol::intern($val_str))));
178        };
179    }
180    macro_rules! ins_sym {
181        ($key:expr, $val_sym:expr) => {
182            ret.insert(($key, Some($val_sym)));
183        };
184    }
185
186    // Symbols are inserted in alphabetical order as much as possible.
187    // The exceptions are where control flow forces things out of order.
188    //
189    // Run `rustc --print cfg` to see the configuration in practice.
190    //
191    // NOTE: These insertions should be kept in sync with
192    // `CheckCfg::fill_well_known` below.
193
194    if sess.opts.debug_assertions {
195        ret.insert((sym::debug_assertions, None));ins_none!(sym::debug_assertions);
196    }
197
198    if sess.is_nightly_build() {
199        match sess.opts.unstable_opts.fmt_debug {
200            FmtDebug::Full => {
201                ret.insert((sym::fmt_debug, Some(sym::full)));ins_sym!(sym::fmt_debug, sym::full);
202            }
203            FmtDebug::Shallow => {
204                ret.insert((sym::fmt_debug, Some(sym::shallow)));ins_sym!(sym::fmt_debug, sym::shallow);
205            }
206            FmtDebug::None => {
207                ret.insert((sym::fmt_debug, Some(sym::none)));ins_sym!(sym::fmt_debug, sym::none);
208            }
209        }
210    }
211
212    if sess.overflow_checks() {
213        ret.insert((sym::overflow_checks, None));ins_none!(sym::overflow_checks);
214    }
215
216    // We insert a cfg for the name of session's panic strategy.
217    // Since the ImmediateAbort strategy is new, it also sets cfg(panic="abort"), so that code
218    // which is trying to detect whether unwinding is enabled by checking for cfg(panic="abort")
219    // does not need to be updated.
220    ret.insert((sym::panic, Some(sess.panic_strategy().desc_symbol())));ins_sym!(sym::panic, sess.panic_strategy().desc_symbol());
221    if sess.panic_strategy() == PanicStrategy::ImmediateAbort {
222        ret.insert((sym::panic, Some(PanicStrategy::Abort.desc_symbol())));ins_sym!(sym::panic, PanicStrategy::Abort.desc_symbol());
223    }
224
225    // JUSTIFICATION: before wrapper fn is available
226    #[allow(rustc::bad_opt_access)]
227    if sess.opts.crate_types.contains(&CrateType::ProcMacro) {
228        ret.insert((sym::proc_macro, None));ins_none!(sym::proc_macro);
229    }
230
231    if sess.is_nightly_build() {
232        ret.insert((sym::relocation_model,
        Some(sess.target.relocation_model.desc_symbol())));ins_sym!(sym::relocation_model, sess.target.relocation_model.desc_symbol());
233    }
234
235    for mut s in sess.sanitizers() {
236        // KASAN is still ASAN under the hood, so it uses the same attribute.
237        if s == SanitizerSet::KERNELADDRESS {
238            s = SanitizerSet::ADDRESS;
239        }
240        // KHWASAN is still HWASAN under the hood, so it uses the same attribute.
241        if s == SanitizerSet::KERNELHWADDRESS {
242            s = SanitizerSet::HWADDRESS;
243        }
244        ret.insert((sym::sanitize, Some(Symbol::intern(&s.to_string()))));ins_str!(sym::sanitize, &s.to_string());
245    }
246
247    if sess.is_sanitizer_cfi_generalize_pointers_enabled() {
248        ret.insert((sym::sanitizer_cfi_generalize_pointers, None));ins_none!(sym::sanitizer_cfi_generalize_pointers);
249    }
250    if sess.is_sanitizer_cfi_normalize_integers_enabled() {
251        ret.insert((sym::sanitizer_cfi_normalize_integers, None));ins_none!(sym::sanitizer_cfi_normalize_integers);
252    }
253
254    ret.insert((sym::target_abi, Some(sess.target.cfg_abi.desc_symbol())));ins_sym!(sym::target_abi, sess.target.cfg_abi.desc_symbol());
255    ret.insert((sym::target_arch, Some(sess.target.arch.desc_symbol())));ins_sym!(sym::target_arch, sess.target.arch.desc_symbol());
256    ret.insert((sym::target_endian, Some(sess.target.endian.desc_symbol())));ins_sym!(sym::target_endian, sess.target.endian.desc_symbol());
257    ret.insert((sym::target_env, Some(sess.target.env.desc_symbol())));ins_sym!(sym::target_env, sess.target.env.desc_symbol());
258    ret.insert((sym::target_object_format,
        Some(sess.target.options.binary_format.desc_symbol())));ins_sym!(sym::target_object_format, sess.target.options.binary_format.desc_symbol());
259
260    for family in sess.target.families.as_ref() {
261        ret.insert((sym::target_family, Some(Symbol::intern(family))));ins_str!(sym::target_family, family);
262        if family == "windows" {
263            ret.insert((sym::windows, None));ins_none!(sym::windows);
264        } else if family == "unix" {
265            ret.insert((sym::unix, None));ins_none!(sym::unix);
266        }
267    }
268
269    // `target_has_atomic*`
270    let layout = sess.target.parse_data_layout().unwrap_or_else(|err| {
271        sess.dcx().emit_fatal(err);
272    });
273    let mut has_atomic = false;
274    for (i, align) in [
275        (8, layout.i8_align),
276        (16, layout.i16_align),
277        (32, layout.i32_align),
278        (64, layout.i64_align),
279        (128, layout.i128_align),
280    ] {
281        if i >= sess.target.min_atomic_width() && i <= sess.target.max_atomic_width() {
282            if !has_atomic {
283                has_atomic = true;
284                if sess.is_nightly_build() {
285                    if sess.target.atomic_cas {
286                        ret.insert((sym::target_has_atomic, None));ins_none!(sym::target_has_atomic);
287                    }
288                    ret.insert((sym::target_has_atomic_load_store, None));ins_none!(sym::target_has_atomic_load_store);
289                }
290            }
291            let mut insert_atomic = |sym, align: Align| {
292                if sess.target.atomic_cas {
293                    ret.insert((sym::target_has_atomic, Some(sym)));ins_sym!(sym::target_has_atomic, sym);
294                }
295                if align.bits() == i {
296                    ret.insert((sym::target_has_atomic_equal_alignment, Some(sym)));ins_sym!(sym::target_has_atomic_equal_alignment, sym);
297                }
298                ret.insert((sym::target_has_atomic_load_store, Some(sym)));ins_sym!(sym::target_has_atomic_load_store, sym);
299            };
300            insert_atomic(sym::integer(i), align);
301            if sess.target.pointer_width as u64 == i {
302                insert_atomic(sym::ptr, layout.pointer_align().abi);
303            }
304        }
305    }
306
307    ret.insert((sym::target_os, Some(sess.target.os.desc_symbol())));ins_sym!(sym::target_os, sess.target.os.desc_symbol());
308    ret.insert((sym::target_pointer_width,
        Some(sym::integer(sess.target.pointer_width))));ins_sym!(sym::target_pointer_width, sym::integer(sess.target.pointer_width));
309
310    if sess.opts.unstable_opts.has_thread_local.unwrap_or(sess.target.has_thread_local) {
311        ret.insert((sym::target_thread_local, None));ins_none!(sym::target_thread_local);
312    }
313
314    ret.insert((sym::target_vendor, Some(sess.target.vendor_symbol())));ins_sym!(sym::target_vendor, sess.target.vendor_symbol());
315
316    // If the user wants a test runner, then add the test cfg.
317    if sess.is_test_crate() {
318        ret.insert((sym::test, None));ins_none!(sym::test);
319    }
320
321    if sess.ub_checks() {
322        ret.insert((sym::ub_checks, None));ins_none!(sym::ub_checks);
323    }
324
325    // Nightly-only implementation detail for the `panic_unwind` and `unwind` crates.
326    if sess.is_nightly_build() && sess.opts.unstable_opts.emscripten_wasm_eh {
327        ret.insert((sym::emscripten_wasm_eh, None));ins_none!(sym::emscripten_wasm_eh);
328    }
329
330    if sess.contract_checks() {
331        ret.insert((sym::contract_checks, None));ins_none!(sym::contract_checks);
332    }
333
334    ret
335}
336
337impl CheckCfg {
338    /// Fill the current [`CheckCfg`] with all the well known cfgs
339    pub fn fill_well_known(&mut self, current_target: &Target) {
340        if !self.exhaustive_values && !self.exhaustive_names {
341            return;
342        }
343
344        // for `#[cfg(foo)]` (i.e. cfg value is none)
345        let no_values = || {
346            let mut values = FxHashSet::default();
347            values.insert(None);
348            ExpectedValues::Some(values)
349        };
350
351        // preparation for inserting some values
352        let empty_values = || {
353            let values = FxHashSet::default();
354            ExpectedValues::Some(values)
355        };
356
357        macro_rules! ins {
358            ($name:expr, $values:expr) => {{
359                self.well_known_names.insert($name);
360                self.expecteds.entry($name).or_insert_with($values)
361            }};
362        }
363
364        // Symbols are inserted in alphabetical order as much as possible.
365        // The exceptions are where control flow forces things out of order.
366        //
367        // NOTE: This should be kept in sync with `default_configuration`.
368        // Note that symbols inserted conditionally in `default_configuration`
369        // are inserted unconditionally here.
370        //
371        // One exception is the `test` cfg which is consider to be a "user-space"
372        // cfg, despite being also set by in `default_configuration` above.
373        // It allows the build system to "deny" using the config by not marking it
374        // as expected (e.g. `lib.test = false` for Cargo).
375        //
376        // When adding a new config here you should also update
377        // `tests/ui/check-cfg/well-known-values.rs` (in order to test the
378        // expected values of the new config) and bless the all directory.
379        //
380        // Don't forget to update `src/doc/rustc/src/check-cfg.md`
381        // in the unstable book as well!
382
383        {
    self.well_known_names.insert(sym::debug_assertions);
    self.expecteds.entry(sym::debug_assertions).or_insert_with(no_values)
};ins!(sym::debug_assertions, no_values);
384
385        {
    self.well_known_names.insert(sym::fmt_debug);
    self.expecteds.entry(sym::fmt_debug).or_insert_with(empty_values)
}ins!(sym::fmt_debug, empty_values).extend(FmtDebug::all());
386
387        // These four are never set by rustc, but we set them anyway; they
388        // should not trigger the lint because `cargo clippy`, `cargo doc`,
389        // `cargo test`, `cargo miri run` and `cargo fmt` (respectively)
390        // can set them.
391        {
    self.well_known_names.insert(sym::clippy);
    self.expecteds.entry(sym::clippy).or_insert_with(no_values)
};ins!(sym::clippy, no_values);
392        {
    self.well_known_names.insert(sym::doc);
    self.expecteds.entry(sym::doc).or_insert_with(no_values)
};ins!(sym::doc, no_values);
393        {
    self.well_known_names.insert(sym::doctest);
    self.expecteds.entry(sym::doctest).or_insert_with(no_values)
};ins!(sym::doctest, no_values);
394        {
    self.well_known_names.insert(sym::miri);
    self.expecteds.entry(sym::miri).or_insert_with(no_values)
};ins!(sym::miri, no_values);
395        {
    self.well_known_names.insert(sym::rustfmt);
    self.expecteds.entry(sym::rustfmt).or_insert_with(no_values)
};ins!(sym::rustfmt, no_values);
396
397        {
    self.well_known_names.insert(sym::overflow_checks);
    self.expecteds.entry(sym::overflow_checks).or_insert_with(no_values)
};ins!(sym::overflow_checks, no_values);
398
399        {
    self.well_known_names.insert(sym::panic);
    self.expecteds.entry(sym::panic).or_insert_with(empty_values)
}ins!(sym::panic, empty_values)
400            .extend(PanicStrategy::ALL.iter().map(PanicStrategy::desc_symbol));
401
402        {
    self.well_known_names.insert(sym::proc_macro);
    self.expecteds.entry(sym::proc_macro).or_insert_with(no_values)
};ins!(sym::proc_macro, no_values);
403
404        {
    self.well_known_names.insert(sym::relocation_model);
    self.expecteds.entry(sym::relocation_model).or_insert_with(empty_values)
}ins!(sym::relocation_model, empty_values)
405            .extend(RelocModel::ALL.iter().map(RelocModel::desc_symbol));
406
407        let sanitize_values = SanitizerSet::all()
408            .into_iter()
409            .map(|sanitizer| Symbol::intern(sanitizer.as_str().unwrap()));
410        {
    self.well_known_names.insert(sym::sanitize);
    self.expecteds.entry(sym::sanitize).or_insert_with(empty_values)
}ins!(sym::sanitize, empty_values).extend(sanitize_values);
411
412        {
    self.well_known_names.insert(sym::sanitizer_cfi_generalize_pointers);
    self.expecteds.entry(sym::sanitizer_cfi_generalize_pointers).or_insert_with(no_values)
};ins!(sym::sanitizer_cfi_generalize_pointers, no_values);
413        {
    self.well_known_names.insert(sym::sanitizer_cfi_normalize_integers);
    self.expecteds.entry(sym::sanitizer_cfi_normalize_integers).or_insert_with(no_values)
};ins!(sym::sanitizer_cfi_normalize_integers, no_values);
414
415        {
    self.well_known_names.insert(sym::target_feature);
    self.expecteds.entry(sym::target_feature).or_insert_with(empty_values)
}ins!(sym::target_feature, empty_values).extend(
416            rustc_target::target_features::all_rust_features()
417                .filter(|(_, s)| s.in_cfg())
418                .map(|(f, _s)| f)
419                .chain(rustc_target::target_features::RUSTC_SPECIFIC_FEATURES.iter().cloned())
420                .map(Symbol::intern),
421        );
422
423        // sym::target_*
424        {
425            const VALUES: [&Symbol; 9] = [
426                &sym::target_abi,
427                &sym::target_arch,
428                &sym::target_endian,
429                &sym::target_env,
430                &sym::target_family,
431                &sym::target_object_format,
432                &sym::target_os,
433                &sym::target_pointer_width,
434                &sym::target_vendor,
435            ];
436
437            // Initialize (if not already initialized)
438            for &e in VALUES {
439                if !self.exhaustive_values {
440                    {
    self.well_known_names.insert(e);
    self.expecteds.entry(e).or_insert_with(|| ExpectedValues::Any)
};ins!(e, || ExpectedValues::Any);
441                } else {
442                    {
    self.well_known_names.insert(e);
    self.expecteds.entry(e).or_insert_with(empty_values)
};ins!(e, empty_values);
443                }
444            }
445
446            if self.exhaustive_values {
447                // Get all values map at once otherwise it would be costly.
448                // (8 values * 220 targets ~= 1760 times, at the time of writing this comment).
449                let [
450                    Some(values_target_abi),
451                    Some(values_target_arch),
452                    Some(values_target_endian),
453                    Some(values_target_env),
454                    Some(values_target_family),
455                    Some(values_target_object_format),
456                    Some(values_target_os),
457                    Some(values_target_pointer_width),
458                    Some(values_target_vendor),
459                ] = self.expecteds.get_disjoint_mut(VALUES)
460                else {
461                    {
    ::core::panicking::panic_fmt(format_args!("unable to get all the check-cfg values buckets"));
};panic!("unable to get all the check-cfg values buckets");
462                };
463
464                for target in Target::builtins().chain(iter::once(current_target.clone())) {
465                    values_target_abi.insert(target.options.cfg_abi.desc_symbol());
466                    values_target_arch.insert(target.arch.desc_symbol());
467                    values_target_endian.insert(target.options.endian.desc_symbol());
468                    values_target_env.insert(target.options.env.desc_symbol());
469                    values_target_family.extend(
470                        target.options.families.iter().map(|family| Symbol::intern(family)),
471                    );
472                    values_target_object_format.insert(target.options.binary_format.desc_symbol());
473                    values_target_os.insert(target.options.os.desc_symbol());
474                    values_target_pointer_width.insert(sym::integer(target.pointer_width));
475                    values_target_vendor.insert(target.vendor_symbol());
476                }
477            }
478        }
479
480        let atomic_values = &[
481            sym::ptr,
482            sym::integer(8usize),
483            sym::integer(16usize),
484            sym::integer(32usize),
485            sym::integer(64usize),
486            sym::integer(128usize),
487        ];
488        for sym in [
489            sym::target_has_atomic,
490            sym::target_has_atomic_equal_alignment,
491            sym::target_has_atomic_load_store,
492        ] {
493            {
    self.well_known_names.insert(sym);
    self.expecteds.entry(sym).or_insert_with(no_values)
}ins!(sym, no_values).extend(atomic_values);
494        }
495
496        {
    self.well_known_names.insert(sym::target_thread_local);
    self.expecteds.entry(sym::target_thread_local).or_insert_with(no_values)
};ins!(sym::target_thread_local, no_values);
497
498        {
    self.well_known_names.insert(sym::ub_checks);
    self.expecteds.entry(sym::ub_checks).or_insert_with(no_values)
};ins!(sym::ub_checks, no_values);
499        {
    self.well_known_names.insert(sym::contract_checks);
    self.expecteds.entry(sym::contract_checks).or_insert_with(no_values)
};ins!(sym::contract_checks, no_values);
500
501        {
    self.well_known_names.insert(sym::unix);
    self.expecteds.entry(sym::unix).or_insert_with(no_values)
};ins!(sym::unix, no_values);
502        {
    self.well_known_names.insert(sym::windows);
    self.expecteds.entry(sym::windows).or_insert_with(no_values)
};ins!(sym::windows, no_values);
503    }
504}