2020-09-23 19:51:56 +00:00
|
|
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
2019-07-18 21:24:58 +00:00
|
|
|
#![feature(crate_visibility_modifier)]
|
Keep last redundant linker flag, not first
When a library (L1) is passed to the linker multiple times, this is
sometimes purposeful: there might be several other libraries in the
linker command (L2 and L3) that all depend on L1. You'd end up with a
(simplified) linker command that looks like:
-l2 -l1 -l3 -l1
With the previous behavior, when rustc encountered a redundant library,
it would keep the first instance, and remove the later ones, resulting
in:
-l2 -l1 -l3
This can cause a linker error, because on some platforms (e.g. Linux),
the linker will only include symbols from L1 that are needed *at the
point it's referenced in the command line*. So if L3 depends on
additional symbols from L1, which aren't needed by L2, the linker won't
know to include them, and you'll end up with "undefined symbols" errors.
A better behavior is to keep the *last* instance of the library:
-l2 -l3 -l1
This ensures that all "downstream" libraries have been included in the
linker command before the "upstream" library is referenced.
Fixes rust-lang#47989
2018-12-20 20:46:42 +00:00
|
|
|
#![feature(drain_filter)]
|
2019-04-11 07:22:02 +00:00
|
|
|
#![feature(in_band_lifetimes)]
|
2018-09-26 21:26:46 +00:00
|
|
|
#![feature(nll)]
|
2020-08-20 21:34:40 +00:00
|
|
|
#![feature(once_cell)]
|
2016-10-03 16:49:39 +00:00
|
|
|
#![feature(proc_macro_internals)]
|
2020-06-01 17:58:18 +00:00
|
|
|
#![feature(min_specialization)]
|
2020-07-28 14:15:40 +00:00
|
|
|
#![feature(try_blocks)]
|
2020-03-17 15:45:02 +00:00
|
|
|
#![feature(never_type)]
|
2019-12-22 22:42:04 +00:00
|
|
|
#![recursion_limit = "256"]
|
2018-03-03 05:22:19 +00:00
|
|
|
|
2016-10-03 16:49:39 +00:00
|
|
|
extern crate proc_macro;
|
2015-11-24 22:00:26 +00:00
|
|
|
|
2020-06-11 14:49:57 +00:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rustc_macros;
|
2016-03-28 21:00:01 +00:00
|
|
|
#[macro_use]
|
2020-03-29 13:24:45 +00:00
|
|
|
extern crate rustc_middle;
|
2018-03-03 05:17:06 +00:00
|
|
|
#[macro_use]
|
2016-10-03 16:49:39 +00:00
|
|
|
extern crate rustc_data_structures;
|
2015-11-24 22:00:26 +00:00
|
|
|
|
2019-11-23 22:10:12 +00:00
|
|
|
pub use rmeta::{provide, provide_extern};
|
|
|
|
|
2019-05-23 17:29:01 +00:00
|
|
|
mod dependency_format;
|
2018-02-10 22:28:17 +00:00
|
|
|
mod foreign_modules;
|
2019-05-23 17:29:01 +00:00
|
|
|
mod native_libs;
|
2019-11-04 08:57:17 +00:00
|
|
|
mod rmeta;
|
2016-09-08 16:05:50 +00:00
|
|
|
|
2015-11-24 22:00:26 +00:00
|
|
|
pub mod creader;
|
2017-11-23 16:07:18 +00:00
|
|
|
pub mod dynamic_lib;
|
2016-10-20 04:31:14 +00:00
|
|
|
pub mod locator;
|
2021-05-29 20:49:59 +00:00
|
|
|
|
2020-11-14 00:59:00 +00:00
|
|
|
pub use rmeta::encode_metadata;
|
2021-05-29 20:49:59 +00:00
|
|
|
pub use rmeta::METADATA_HEADER;
|