2020-09-23 21:51:56 +02:00
|
|
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
2022-03-14 13:28:34 +03:00
|
|
|
#![feature(decl_macro)]
|
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 15:46:42 -05:00
|
|
|
#![feature(drain_filter)]
|
2022-04-10 22:15:09 +03:00
|
|
|
#![feature(generators)]
|
2022-05-22 12:34:34 -07:00
|
|
|
#![feature(generic_associated_types)]
|
2022-04-21 23:47:39 +03:00
|
|
|
#![feature(iter_from_generator)]
|
2022-08-20 20:40:08 +02:00
|
|
|
#![feature(let_chains)]
|
2021-10-16 03:45:14 +02:00
|
|
|
#![feature(let_else)]
|
2020-08-20 14:34:40 -07:00
|
|
|
#![feature(once_cell)]
|
2016-10-03 09:49:39 -07:00
|
|
|
#![feature(proc_macro_internals)]
|
2022-04-09 18:59:21 +02:00
|
|
|
#![feature(macro_metavar_expr)]
|
2020-06-01 18:58:18 +01:00
|
|
|
#![feature(min_specialization)]
|
2022-04-10 15:39:12 +02:00
|
|
|
#![feature(slice_as_chunks)]
|
2022-05-23 19:50:29 -07:00
|
|
|
#![feature(trusted_len)]
|
2020-07-28 16:15:40 +02:00
|
|
|
#![feature(try_blocks)]
|
2020-03-17 11:45:02 -04:00
|
|
|
#![feature(never_type)]
|
2018-03-03 06:22:19 +01:00
|
|
|
#![recursion_limit = "256"]
|
2022-02-23 08:06:22 -05:00
|
|
|
#![allow(rustc::potential_query_instability)]
|
2018-03-03 06:22:19 +01:00
|
|
|
|
2016-10-03 09:49:39 -07:00
|
|
|
extern crate proc_macro;
|
2015-11-25 00:00:26 +02:00
|
|
|
|
2020-06-11 15:49:57 +01:00
|
|
|
#[macro_use]
|
|
|
|
extern crate rustc_macros;
|
2016-03-28 23:00:01 +02:00
|
|
|
#[macro_use]
|
2020-03-29 15:24:45 +02:00
|
|
|
extern crate rustc_middle;
|
2018-03-03 06:17:06 +01:00
|
|
|
#[macro_use]
|
2016-10-03 09:49:39 -07:00
|
|
|
extern crate rustc_data_structures;
|
2015-11-25 00:00:26 +02:00
|
|
|
|
2019-11-24 01:10:12 +03:00
|
|
|
pub use rmeta::{provide, provide_extern};
|
|
|
|
|
2019-05-23 20:29:01 +03:00
|
|
|
mod dependency_format;
|
2018-02-10 14:28:17 -08:00
|
|
|
mod foreign_modules;
|
2019-05-23 20:29:01 +03:00
|
|
|
mod native_libs;
|
2019-11-04 11:57:17 +03:00
|
|
|
mod rmeta;
|
2016-09-08 19:05:50 +03:00
|
|
|
|
2015-11-25 00:00:26 +02:00
|
|
|
pub mod creader;
|
2022-04-24 19:34:35 +09:00
|
|
|
pub mod fs;
|
2016-10-20 04:31:14 +00:00
|
|
|
pub mod locator;
|
2021-05-29 22:49:59 +02:00
|
|
|
|
2022-04-24 19:34:35 +09:00
|
|
|
pub use fs::{emit_metadata, METADATA_FILENAME};
|
2021-09-24 18:15:36 +02:00
|
|
|
pub use rmeta::{encode_metadata, EncodedMetadata, METADATA_HEADER};
|