about summary refs log tree commit diff
path: root/src/librustc_allocator
AgeCommit message (Collapse)AuthorLines
2019-07-24Merge `rustc_allocator` into `libsyntax_ext`Vadim Petrochenkov-361/+0
2019-07-22normalize use of backticks in compiler messages for librustc_allocatorSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532
2019-07-19libsyntax: Remove `Mark` into `ExpnId`Vadim Petrochenkov-2/+2
2019-07-11hygiene: Introduce a helper method for creating new expansionsVadim Petrochenkov-8/+4
Creating a fresh expansion and immediately generating a span from it is the most common scenario. Also avoid allocating `allow_internal_unstable` lists for derive markers repeatedly. And rename `ExpnInfo::with_unstable` to `ExpnInfo::allow_unstable`, seems to be a better fitting name.
2019-07-11hygiene: Reuse `MacroKind` in `ExpnKind`Vadim Petrochenkov-2/+2
Orthogonality and reuse are good.
2019-07-11Rename some things in `syntax_pos/hygiene`Vadim Petrochenkov-2/+3
More consistent with other naming: ExpnFormat -> ExpnKind ExpnKind::name -> ExpnKind::descr DesugaringKind::name -> DesugaringKind::descr Shorter, no tautology: CompilerDesugaring -> Desugaring CompilerDesugaringKind -> DesugaringKind
2019-07-07rustc: Remove `dylib` crate type from most rustc cratesAlex Crichton-1/+0
Now that procedural macros no longer link transitively to libsyntax, this shouldn't be needed any more! This commit is an experiment in removing all dynamic libraries from rustc except for librustc_driver itself. Let's see how far we can get with that!
2019-06-24Enable internal lints in bootstrapflip1995-1/+0
2019-06-18syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`Vadim Petrochenkov-14/+7
2019-06-18syntax: Factor out common fields from `SyntaxExtension` variantsVadim Petrochenkov-1/+1
2019-06-11Add deny(unused_lifetimes) to all the crates that have deny(internal).Eduard-Mihai Burtescu-0/+1
2019-05-27Avoid unnecessary internings.Nicholas Nethercote-4/+2
Most involving `Symbol::intern` on string literals.
2019-05-22Restore the old behavior of the rustdoc keyword check + Fix rebaseVadim Petrochenkov-3/+2
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-2/+2
2019-05-20Remove `Symbol::gensym()`.Nicholas Nethercote-1/+1
2019-05-17Avoid unnecessary interning in `Ident::from_str()` calls.Nicholas Nethercote-6/+7
A lot of these static symbols are pre-interned.
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-2/+2
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-03Deny internal lints on non conflicting cratesflip1995-0/+1
- libarena - librustc_allocator - librustc_borrowck - librustc_codegen_ssa - librustc_codegen_utils - librustc_driver - librustc_errors - librustc_incremental - librustc_metadata - librustc_passes - librustc_privacy - librustc_resolve - librustc_save_analysis - librustc_target - librustc_traits - libsyntax - libsyntax_ext - libsyntax_pos
2019-02-12Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkovbors-1/+3
Require a list of features in `#[allow_internal_unstable]` The blanket-permission slip is not great and will likely give us trouble some point down the road.
2019-02-11Use `Rc<[Symbol]>` instead of `Vec<Symbol>` to reduce # of allocsOliver Scherer-2/+2
2019-02-11Require a list of features to allow in `allow_internal_unstable`Oliver Scherer-1/+3
2019-02-10Revert removed #![feature(nll)]Taiki Endo-0/+1
2019-02-06librustc_allocator => 2018Taiki Endo-15/+7
2019-02-06Overhaul `syntax::fold::Folder`.Nicholas Nethercote-14/+13
This commit changes `syntax::fold::Folder` from a functional style (where most methods take a `T` and produce a new `T`) to a more imperative style (where most methods take and modify a `&mut T`), and renames it `syntax::mut_visit::MutVisitor`. The first benefit is speed. The functional style does not require any reallocations, due to the use of `P::map` and `MoveMap::move_{,flat_}map`. However, every field in the AST must be overwritten; even those fields that are unchanged are overwritten with the same value. This causes a lot of unnecessary memory writes. The imperative style reduces instruction counts by 1--3% across a wide range of workloads, particularly incremental workloads. The second benefit is conciseness; the imperative style is usually more concise. E.g. compare the old functional style: ``` fn fold_abc(&mut self, abc: ABC) { ABC { a: fold_a(abc.a), b: fold_b(abc.b), c: abc.c, } } ``` with the imperative style: ``` fn visit_abc(&mut self, ABC { a, b, c: _ }: &mut ABC) { visit_a(a); visit_b(b); } ``` (The reductions get larger in more complex examples.) Overall, the patch removes over 200 lines of code -- even though the new code has more comments -- and a lot of the remaining lines have fewer characters. Some notes: - The old style used methods called `fold_*`. The new style mostly uses methods called `visit_*`, but there are a few methods that map a `T` to something other than a `T`, which are called `flat_map_*` (`T` maps to multiple `T`s) or `filter_map_*` (`T` maps to 0 or 1 `T`s). - `move_map.rs`/`MoveMap`/`move_map`/`move_flat_map` are renamed `map_in_place.rs`/`MapInPlace`/`map_in_place`/`flat_map_in_place` to reflect their slightly changed signatures. - Although this commit renames the `fold` module as `mut_visit`, it keeps it in the `fold.rs` file, so as not to confuse git. The next commit will rename the file.
2018-12-25Remove licensesMark Rousskov-20/+0
2018-12-10Upgrade `smallvec` to 0.6.7 and use the new `may_dangle` feature.Nicholas Nethercote-1/+1
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-26Remove OneVectorljedrz-7/+3
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-26rustc: Continue to tweak "std internal symbols"Alex Crichton-7/+1
In investigating [an issue][1] with `panic_implementation` defined in an executable that's optimized I once again got to rethinking a bit about the `rustc_std_internal_symbol` attribute as well as weak lang items. We've sort of been non-stop tweaking these items ever since their inception, and this continues to the trend. The crux of the bug was that in the reachability we have a [different branch][2] for non-library builds which meant that weak lang items (and std internal symbols) weren't considered reachable, causing them to get eliminiated by ThinLTO passes. The fix was to basically tweak that branch to consider these symbols to ensure that they're propagated all the way to the linker. Along the way I've attempted to erode the distinction between std internal symbols and weak lang items by having weak lang items automatically configure fields of `CodegenFnAttrs`. That way most code no longer even considers weak lang items and they're simply considered normal functions with attributes about the ABI. In the end this fixes the final comment of #51342 [1]: https://github.com/rust-lang/rust/issues/51342#issuecomment-414368019 [2]: https://github.com/rust-lang/rust/blob/35bf1ae25799a4e62131159f052e0a3cbd27c960/src/librustc/middle/reachable.rs#L225-L238
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23Use optimized SmallVec implementationIgor Gutorov-3/+6
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-13Move SmallVec and ThinVec out of libsyntaxljedrz-7/+9
2018-08-09[nll] librustc_allocator: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-07rustc: Tweak visibility of some lang itemsAlex Crichton-6/+1
This commit tweaks the linker-level visibility of some lang items that rustc uses and defines. Notably this means that `#[panic_implementation]` and `#[alloc_error_handler]` functions are never marked as `internal`. It's up to the linker to eliminate these, not rustc. Additionally `#[global_allocator]` generated symbols are no longer forced to `Default` visibility (fully exported), but rather they're relaxed to `Hidden` visibility). This symbols are *not* needed across DLL boundaries, only as a local implementation detail of the compiler-injected allocator symbols, so `Hidden` should suffice. Closes #51342 Closes #52795
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-1/+0
2018-07-11Deny bare trait objects in in src/librustc_allocatorljedrz-3/+4
2018-06-27Implement `#[macro_export(local_inner_macros)]`Vadim Petrochenkov-0/+1
2018-06-24used debug, not infomark-3/+3
2018-06-24enable fold_macMark Mansi-1/+6
2018-06-24Prohibit global_allocator in submodules for nowMark Mansi-40/+81
- we need to figure out hygiene first - change the test to check that the prohibition works with a good error msg - leaves some comments and debugging code - leaves some of our supposed fixes
2018-06-24Attempt to fix hygiene for global_allocatorMark Mansi-20/+27
2018-06-23hygiene: Merge `NameAndSpan` into `ExpnInfo`Vadim Petrochenkov-8/+6
2018-06-21Parse async fn header.Without Boats-6/+6
This is gated on edition 2018 & the `async_await` feature gate. The parser will accept `async fn` and `async unsafe fn` as fn items. Along the same lines as `const fn`, only `async unsafe fn` is permitted, not `unsafe async fn`.The parser will not accept `async` functions as trait methods. To do a little code clean up, four fields of the function type struct have been merged into the new `FnHeader` struct: constness, asyncness, unsafety, and ABI. Also, a small bug in HIR printing is fixed: it previously printed `const unsafe fn` as `unsafe const fn`, which is grammatically incorrect.
2018-06-11Remove alloc::Opaque and use *mut u8 as pointer type for GlobalAllocMike Hommey-14/+1
2018-05-17Add edition to expansion infoVadim Petrochenkov-1/+2
2018-04-26rustc_target: move in syntax::abi and flip dependency.Irina Popa-1/+3