rust/src/test/run-make-fulldeps
Alex Crichton d7d7045374 rustc: Allow #[no_mangle] anywhere in a crate
This commit updates the compiler to allow the `#[no_mangle]` (and
`#[export_name]` attributes) to be located anywhere within a crate.
These attributes are unconditionally processed, causing the compiler to
always generate an exported symbol with the appropriate name.

After some discussion on #54135 it was found that not a great reason
this hasn't been allowed already, and it seems to match the behavior
that many expect! Previously the compiler would only export a
`#[no_mangle]` symbol if it were *publicly reachable*, meaning that it
itself is `pub` and it's otherwise publicly reachable from the root of
the crate. This new definition is that `#[no_mangle]` *is always
reachable*, no matter where it is in a crate or whether it has `pub` or
not.

This should make it much easier to declare an exported symbol with a
known and unique name, even when it's an internal implementation detail
of the crate itself. Note that these symbols will persist beyond LTO as
well, always making their way to the linker.

Along the way this commit removes the `private_no_mangle_functions` lint
(also for statics) as there's no longer any need to lint these
situations. Furthermore a good number of tests were updated now that
symbol visibility has been changed.

Closes #54135
2018-10-06 13:57:30 -07:00
..
a-b-a-linker-guard
alloc-extern-crates
allow-non-lint-warnings-cmdline
allow-warnings-cmdline-stability Fix stage 2 tests 2018-08-05 15:54:49 +01:00
archive-duplicate-names
atomic-lock-free
bare-outfile
c-dynamic-dylib
c-dynamic-rlib
c-link-to-rust-dylib
c-link-to-rust-staticlib
c-static-dylib
c-static-rlib
cat-and-grep-sanity-check
cdylib
cdylib-fewer-symbols
codegen-options-parsing Allow for opting out of ThinLTO and clean up LTO related cli flag handling. 2018-09-05 12:52:17 +02:00
compile-stdin
compiler-lookup-paths
compiler-lookup-paths-2
compiler-rt-works-on-mingw
crate-data-smoke
crate-name-priority
cross-lang-lto Fix some run-make tests after object file naming has changed. 2018-08-15 13:47:39 +02:00
cross-lang-lto-upstream-rlibs Address review comments for #53031 and fix some merge fallout. 2018-08-08 13:40:23 +02:00
debug-assertions
dep-info
dep-info-doesnt-run-much
dep-info-spaces
duplicate-output-flavors
dylib-chain
emit
emit-stack-sizes don't run the test on macOS 2018-09-26 16:22:52 +02:00
error-found-staticlib-instead-crate
error-writing-dependencies
exit-code fix exit-code test so the lint fires again 2018-08-04 22:20:45 -05:00
extern-diff-internal-name
extern-flag-disambiguates
extern-flag-fun
extern-flag-rename-transitive rustc: Register crates under their real names 2018-07-25 18:04:19 -07:00
extern-fn-generic
extern-fn-mangle
extern-fn-reachable rustc: Allow #[no_mangle] anywhere in a crate 2018-10-06 13:57:30 -07:00
extern-fn-struct-passing-abi
extern-fn-with-extern-types
extern-fn-with-packed-struct
extern-fn-with-union
extern-multiple-copies
extern-multiple-copies2
extern-overrides-distribution
extern-prelude Stabilize crate_in_paths, extern_absolute_paths and extern_prelude on all editions. 2018-09-22 09:26:40 +03:00
extra-filename-with-temp-outputs Fix some run-make tests after object file naming has changed. 2018-08-15 13:47:39 +02:00
fpic
hir-tree Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
hotplug_codegen_backend Normalize variants of CrateType to standard style 2018-08-04 06:53:15 -06:00
include_bytes_deps
inline-always-many-cgu
interdependent-c-libraries
intrinsic-unreachable
invalid-library
invalid-staticlib
issue-7349
issue-11908
issue-14500
issue-14698
issue-15460
issue-18943
issue-19371 mv (mod) codemap source_map 2018-08-19 23:01:00 +02:00
issue-20626
issue-22131
issue-24445
issue-25581
issue-26006
issue-26092
issue-28595
issue-28766
issue-30063
issue-33329
issue-35164
issue-36710
issue-37839
issue-37893
issue-38237
issue-40535
issue-46239
issue-51671 stabilize #[panic_handler] 2018-09-07 13:27:30 +02:00
issue-53964 crates that provide a panic_handler are exempt from unused_extern_crates 2018-09-06 21:24:33 +02:00
issues-41478-43796
libs-and-bins
libs-through-symlinks
libtest-json Fix tests for json formatting 2018-08-31 16:30:05 -05:00
link-arg
link-cfg
link-path-order Fix stage 2 tests 2018-08-05 15:54:49 +01:00
linkage-attr-on-static
linker-output-non-utf8
llvm-pass bump minimum LLVM version to 5.0 2018-07-09 11:35:52 +02:00
long-linker-command-lines
long-linker-command-lines-cmd-exe
longjmp-across-rust
ls-metadata
lto-no-link-whole-rlib
lto-readonly-lib
lto-smoke Allow for opting out of ThinLTO and clean up LTO related cli flag handling. 2018-09-05 12:52:17 +02:00
lto-smoke-c
manual-crate-name
manual-link
many-crates-but-no-match
metadata-flag-frobs-symbols
min-global-align
mismatching-target-triples
missing-crate-dependency
mixing-deps
mixing-formats
mixing-libs
msvc-opt-minsize
multiple-emits
no-builtins-lto
no-duplicate-libs
no-integrated-as
no-intermediate-extras
obey-crate-type-flag
output-filename-conflicts-with-directory
output-filename-overwrites-input
output-type-permutations
output-with-hyphens
panic-impl-transitive stabilize #[panic_handler] 2018-09-07 13:27:30 +02:00
pgo-gen Upgrade to LLVM's master branch (LLVM 7) 2018-07-10 13:43:01 -07:00
pgo-gen-lto Upgrade to LLVM's master branch (LLVM 7) 2018-07-10 13:43:01 -07:00
prefer-dylib
prefer-rlib
pretty-expanded
pretty-expanded-hygiene
pretty-print-path-suffix
pretty-print-to-file
print-cfg
print-target-list
profile
prune-link-args
relocation-model
relro-levels
reproducible-build
resolve-rename
rlib-chain
rustc-macro-dep-files
rustdoc-error-lines Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
rustdoc-output-path
sanitizer-address
sanitizer-cdylib-link Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
sanitizer-dylib-link Fix typos found by codespell. 2018-08-19 17:41:28 +02:00
sanitizer-invalid-cratetype
sanitizer-invalid-target
sanitizer-leak
sanitizer-memory
sanitizer-staticlib-link
save-analysis
save-analysis-fail
save-analysis-rfc2126 rustc_resolve: don't allow ::crate_name to bypass extern_prelude. 2018-09-15 22:48:10 +03:00
sepcomp-cci-copies
sepcomp-inlining
sepcomp-separate
simd-ffi
simple-dylib
simple-rlib
stable-symbol-names
static-dylib-by-default
static-nobundle
static-unwinding
staticlib-blank-lib
std-core-cycle
stdin-non-utf8
suspicious-library
symbol-visibility
symbols-include-type-name
symlinked-extern
symlinked-libraries
symlinked-rlib
sysroot-crates-are-unstable
target-cpu-native Fix warnings about the native target-cpu 2018-08-28 13:32:11 -07:00
target-specs Don't silently ignore invalid data in target spec 2018-07-13 10:14:16 -07:00
target-without-atomic-cas update run-pass test 2018-07-05 20:18:19 -05:00
test-harness
treat-err-as-bug
type-mismatch-same-crate-name
use-extern-for-plugins
use-suggestions-rust-2018 add test for the suggestion from prelude 2018-08-27 14:12:31 +00:00
used stabilize #[used] 2018-09-09 15:43:28 +02:00
version
volatile-intrinsics Add unaligned volatile intrinsics 2018-07-14 23:28:39 +01:00
weird-output-filenames
windows-spawn
windows-subsystem
tools.mk