-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #40160 - steveklabnik:rollup, r=steveklabnik
Rollup of 5 pull requests - Successful merges: #40142, #40144, #40150, #40151, #40153 - Failed merges:
- Loading branch information
Showing
6 changed files
with
168 additions
and
82 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,94 @@ | ||
[The Unstable Book](the-unstable-book.md) | ||
|
||
- [asm](asm.md) | ||
- [alloc_system](alloc-system.md) | ||
- [abi_msp430_interrupt](abi-msp430-interrupt.md) | ||
- [abi_ptx](abi-ptx.md) | ||
- [abi_sysv64](abi-sysv64.md) | ||
- [abi_unadjusted](abi-unadjusted.md) | ||
- [abi_vectorcall](abi-vectorcall.md) | ||
- [advanced_slice_patterns](advanced-slice-patterns.md) | ||
- [alloc_jemalloc](alloc-jemalloc.md) | ||
- [test](test.md) | ||
- [alloc_system](alloc-system.md) | ||
- [allocator](allocator.md) | ||
- [allow_internal_unstable](allow-internal-unstable.md) | ||
- [asm](asm.md) | ||
- [associated_consts](associated-consts.md) | ||
- [associated_type_defaults](associated-type-defaults.md) | ||
- [attr_literals](attr-literals.md) | ||
- [box_patterns](box-patterns.md) | ||
- [box_syntax](box-syntax.md) | ||
- [cfg_target_feature](cfg-target-feature.md) | ||
- [cfg_target_has_atomic](cfg-target-has-atomic.md) | ||
- [cfg_target_thread_local](cfg-target-thread-local.md) | ||
- [cfg_target_vendor](cfg-target-vendor.md) | ||
- [compiler_builtins](compiler-builtins.md) | ||
- [concat_idents](concat-idents.md) | ||
- [link_args](link-args.md) | ||
- [log_syntax](log-syntax.md) | ||
- [non_ascii_idents](non-ascii-idents.md) | ||
- [plugin_registrar](plugin-registrar.md) | ||
- [thread_local](thread-local.md) | ||
- [trace_macros](trace-macros.md) | ||
- [conservative_impl_trait](conservative-impl-trait.md) | ||
- [const_fn](const-fn.md) | ||
- [const_indexing](const-indexing.md) | ||
- [custom_attribute](custom-attribute.md) | ||
- [custom_derive](custom-derive.md) | ||
- [default_type_parameter_fallback](default-type-parameter-fallback.md) | ||
- [drop_types_in_const](drop-types-in-const.md) | ||
- [dropck_eyepatch](dropck-eyepatch.md) | ||
- [dropck_parametricity](dropck-parametricity.md) | ||
- [exclusive_range_pattern](exclusive-range-pattern.md) | ||
- [field_init_shorthand](field-init-shorthand.md) | ||
- [fundamental](fundamental.md) | ||
- [generic_param_attrs](generic-param-attrs.md) | ||
- [i128_type](i128-type.md) | ||
- [inclusive_range_syntax](inclusive-range-syntax.md) | ||
- [intrinsics](intrinsics.md) | ||
- [lang_items](lang-items.md) | ||
- [link_args](link-args.md) | ||
- [link_cfg](link-cfg.md) | ||
- [link_llvm_intrinsics](link-llvm-intrinsics.md) | ||
- [linkage](linkage.md) | ||
- [quote](quote.md) | ||
- [simd](simd.md) | ||
- [rustc_diagnostic_macros](rustc-diagnostic-macros.md) | ||
- [advanced_slice_patterns](advanced-slice-patterns.md) | ||
- [box_syntax](box-syntax.md) | ||
- [placement_in_syntax](placement-in-syntax.md) | ||
- [unboxed_closures](unboxed-closures.md) | ||
- [allocator](allocator.md) | ||
- [fundamental](fundamental.md) | ||
- [log_syntax](log-syntax.md) | ||
- [loop_break_value](loop-break-value.md) | ||
- [macro_reexport](macro-reexport.md) | ||
- [main](main.md) | ||
- [naked_functions](naked-functions.md) | ||
- [needs_allocator](needs-allocator.md) | ||
- [on_unimplemented](on-unimplemented.md) | ||
- [plugin](plugin.md) | ||
- [simd_ffi](simd-ffi.md) | ||
- [start](start.md) | ||
- [structural_match](structural-match.md) | ||
- [panic_runtime](panic-runtime.md) | ||
- [needs_panic_runtime](needs-panic-runtime.md) | ||
- [optin_builtin_traits](optin-builtin-traits.md) | ||
- [macro_reexport](macro-reexport.md) | ||
- [staged_api](staged-api.md) | ||
- [never_type](never-type.md) | ||
- [no_core](no-core.md) | ||
- [box_patterns](box-patterns.md) | ||
- [dropck_parametricity](dropck-parametricity.md) | ||
- [dropck_eyepatch](dropck-eyepatch.md) | ||
- [custom_attribute](custom-attribute.md) | ||
- [custom_derive](custom-derive.md) | ||
- [no_debug](no-debug.md) | ||
- [non_ascii_idents](non-ascii-idents.md) | ||
- [omit_gdb_pretty_printer_section](omit-gdb-pretty-printer-section.md) | ||
- [on_unimplemented](on-unimplemented.md) | ||
- [optin_builtin_traits](optin-builtin-traits.md) | ||
- [panic_runtime](panic-runtime.md) | ||
- [placement_in_syntax](placement-in-syntax.md) | ||
- [platform_intrinsics](platform-intrinsics.md) | ||
- [plugin](plugin.md) | ||
- [plugin_registrar](plugin-registrar.md) | ||
- [prelude_import](prelude-import.md) | ||
- [proc_macro](proc-macro.md) | ||
- [pub_restricted](pub-restricted.md) | ||
- [quote](quote.md) | ||
- [relaxed_adts](relaxed-adts.md) | ||
- [repr_simd](repr-simd.md) | ||
- [rustc_attrs](rustc-attrs.md) | ||
- [allow_internal_unstable](allow-internal-unstable.md) | ||
- [rustc_diagnostic_macros](rustc-diagnostic-macros.md) | ||
- [sanitizer_runtime](sanitizer-runtime.md) | ||
- [simd](simd.md) | ||
- [simd_ffi](simd-ffi.md) | ||
- [slice_patterns](slice-patterns.md) | ||
- [associated_consts](associated-consts.md) | ||
- [const_fn](const-fn.md) | ||
- [const_indexing](const-indexing.md) | ||
- [prelude_import](prelude-import.md) | ||
- [specialization](specialization.md) | ||
- [staged_api](staged-api.md) | ||
- [start](start.md) | ||
- [static_nobundle](static-nobundle.md) | ||
- [static_recursion](static-recursion.md) | ||
- [default_type_parameter_fallback](default-type-parameter-fallback.md) | ||
- [associated_type_defaults](associated-type-defaults.md) | ||
- [repr_simd](repr-simd.md) | ||
- [cfg_target_feature](cfg-target-feature.md) | ||
- [platform_intrinsics](platform-intrinsics.md) | ||
- [unwind_attributes](unwind-attributes.md) | ||
- [naked_functions](naked-functions.md) | ||
- [no_debug](no-debug.md) | ||
- [omit_gdb_pretty_printer_section](omit-gdb-pretty-printer-section.md) | ||
- [cfg_target_vendor](cfg-target-vendor.md) | ||
- [stmt_expr_attributes](stmt-expr-attributes.md) | ||
- [struct_field_attributes](struct-field-attributes.md) | ||
- [structural_match](structural-match.md) | ||
- [target_feature](target-feature.md) | ||
- [test](test.md) | ||
- [thread_local](thread-local.md) | ||
- [trace_macros](trace-macros.md) | ||
- [type_ascription](type-ascription.md) | ||
- [cfg_target_thread_local](cfg-target-thread-local.md) | ||
- [abi_vectorcall](abi-vectorcall.md) | ||
- [inclusive_range_syntax](inclusive-range-syntax.md) | ||
- [exclusive_range_pattern](exclusive-range-pattern.md) | ||
- [specialization](specialization.md) | ||
- [pub_restricted](pub-restricted.md) | ||
- [drop_types_in_const](drop-types-in-const.md) | ||
- [cfg_target_has_atomic](cfg-target-has-atomic.md) | ||
- [conservative_impl_trait](conservative-impl-trait.md) | ||
- [relaxed_adts](relaxed-adts.md) | ||
- [never_type](never-type.md) | ||
- [attr_literals](attr-literals.md) | ||
- [abi_sysv64](abi-sysv64.md) | ||
- [unboxed_closures](unboxed-closures.md) | ||
- [untagged_unions](untagged-unions.md) | ||
- [compiler_builtins](compiler-builtins.md) | ||
- [generic_param_attrs](generic-param-attrs.md) | ||
- [field_init_shorthand](field-init-shorthand.md) | ||
- [windows_subsystem](windows-subsystem.md) | ||
- [link_cfg](link-cfg.md) | ||
- [unwind_attributes](unwind-attributes.md) | ||
- [use_extern_macros](use-extern-macros.md) | ||
- [loop_break_value](loop-break-value.md) | ||
- [target_feature](target-feature.md) | ||
- [abi_ptx](abi-ptx.md) | ||
- [i128_type](i128-type.md) | ||
- [abi_unadjusted](abi-unadjusted.md) | ||
- [proc_macro](proc-macro.md) | ||
- [struct_field_attributes](struct-field-attributes.md) | ||
- [static_nobundle](static-nobundle.md) | ||
- [abi_msp430_interrupt](abi-msp430-interrupt.md) | ||
- [sanitizer_runtime](sanitizer-runtime.md) | ||
- [windows_subsystem](windows-subsystem.md) |
86 changes: 86 additions & 0 deletions
86
src/test/compile-fail/feature-gate-cfg-target-has-atomic.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![crate_type="rlib"] | ||
#![no_core] | ||
|
||
extern "rust-intrinsic" { | ||
fn atomic_xadd<T>(dst: *mut T, src: T) -> T; | ||
} | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
#[lang = "copy"] | ||
trait Copy {} | ||
|
||
#[cfg(target_has_atomic = "8")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_u8(x: *mut u8) { | ||
atomic_xadd(x, 1); | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "8")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_i8(x: *mut i8) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "16")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_u16(x: *mut u16) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "16")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_i16(x: *mut i16) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "32")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_u32(x: *mut u32) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "32")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_i32(x: *mut i32) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "64")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_u64(x: *mut u64) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "64")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_i64(x: *mut i64) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "ptr")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_usize(x: *mut usize) { | ||
atomic_xadd(x, 1); | ||
} | ||
#[cfg(target_has_atomic = "ptr")] | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
pub unsafe fn atomic_isize(x: *mut isize) { | ||
atomic_xadd(x, 1); | ||
} | ||
|
||
fn main() { | ||
cfg!(target_has_atomic = "8"); | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
cfg!(target_has_atomic = "16"); | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
cfg!(target_has_atomic = "32"); | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
cfg!(target_has_atomic = "64"); | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
cfg!(target_has_atomic = "ptr"); | ||
//~^ ERROR `cfg(target_has_atomic)` is experimental and subject to change (see issue #32976) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters