about summary refs log tree commit diff
path: root/compiler/rustc_session/src/utils.rs
AgeCommit message (Collapse)AuthorLines
2023-03-23Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholkMatthias Krüger-1/+2
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize` This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.
2023-03-19The name of NativeLib will be presentedyukang-1/+8
2023-03-16Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`John Kåre Alsaker-1/+2
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-10-19Get rid of native_library projection queriesnils-0/+11
They don't seem particularly useful as I don't expect native libraries to change frequently.
2022-07-26Lib kind -l link-arg:Daniil Belov-1/+4
arbitrary link argument like -C link-arg, but respecting relative order to other `-l` options, unstable
2022-05-22rustc_parse: Move AST -> TokenStream conversion logic to `rustc_ast`Vadim Petrochenkov-58/+0
2022-05-18use `CursorRef` more, to not to clone `Tree`sklensy-1/+1
2022-04-28rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`Vadim Petrochenkov-2/+2
2022-04-19incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.Michael Woerister-4/+2
2022-04-02ast_lowering: Stop wrapping `ident` matchers into groupsVadim Petrochenkov-0/+3
The lowered forms goes to metadata, for example during encoding of macro definitions
2022-03-30Stabilize native library modifier syntax and the `whole-archive` modifier ↵Vadim Petrochenkov-0/+20
specifically
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-2/+2
Signed-off-by: codehorseman <cricis@yeah.net>
2021-05-05Implement RFC 2951: Native link modifiersLuqman Aden-8/+25
This commit implements both the native linking modifiers infrastructure as well as an initial attempt at the individual modifiers from the RFC. It also introduces a feature flag for the general syntax along with individual feature flags for each modifier.
2021-04-11Implement token-based handling of attributes during expansionAaron Hill-0/+55
This PR modifies the macro expansion infrastructure to handle attributes in a fully token-based manner. As a result: * Derives macros no longer lose spans when their input is modified by eager cfg-expansion. This is accomplished by performing eager cfg-expansion on the token stream that we pass to the derive proc-macro * Inner attributes now preserve spans in all cases, including when we have multiple inner attributes in a row. This is accomplished through the following changes: * New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced. These are very similar to a normal `TokenTree`, but they also track the position of attributes and attribute targets within the stream. They are built when we collect tokens during parsing. An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when we invoke a macro. * Token capturing and `LazyTokenStream` are modified to work with `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which is created during the parsing of a nested AST node to make the 'outer' AST node aware of the attributes and attribute target stored deeper in the token stream. * When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-01-29Pre-canoncalize ExternLocation::ExactPathsRyan Levick-0/+23
2020-08-30mv compiler to compiler/mark-0/+32