summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2016-11-04Long linesBrian Anderson-1/+2
2016-11-03Fix ICE when printing closures, and other similar typesMark-Simulacrum-3/+14
2016-11-03Fix ICE when attempting to get closure generics.Mark-Simulacrum-20/+37
2016-11-03normalize trait-ref in context of implNiko Matsakis-8/+8
The `specializes()` function was trying to normalize the impl trait in an empty environment. This could lead to inexplicable failures.
2016-11-03add a per-param-env cache to `impls_bound`Ariel Ben-Yehuda-26/+40
There used to be only a global cache, which led to uncached calls to trait selection when there were type parameters. I'm running a check that there are no adverse performance effects. Fixes #37106 (drop elaboration times are now ~half of borrow checking, so might still be worthy of optimization, but not critical).
2016-10-19Stabilise `?`Nick Cameron-25/+1
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
2016-10-19rustc: More fixes for arch-independent hashingAlex Crichton-5/+70
In another attempt to fix #36793 this commit attempts to head off any future problems by adding a custom `WidentUsizeHasher` which will widen any hashing of `isize` and `usize` to a `u64` as necessary. This obviates the need for a previous number of `as u64` annotations and will hopefully protect us against future problems here. Closes #36793 (hopefully)
2016-10-18normalize types every time HR regions are erasedAriel Ben-Yehuda-1/+14
Associated type normalization is inhibited by higher-ranked regions. Therefore, every time we erase them, we must re-normalize. I was meaning to introduce this change some time ago, but we used to erase regions in generic context, which broke this terribly (because you can't always normalize in a generic context). That seems to be gone now. Ensure this by having a `erase_late_bound_regions_and_normalize` function. Fixes #37109 (the missing call was in mir::block).
2016-10-11loosen assertion against proj in collectorNiko Matsakis-1/+10
The collector was asserting a total absence of projections, but some projections are expected, even in trans: in particular, projections containing higher-ranked regions, which we don't currently normalize.
2016-10-10std: Stabilize and deprecate APIs for 1.13Alex Crichton-14/+18
This commit is intended to be backported to the 1.13 branch, and works with the following APIs: Stabilized * `i32::checked_abs` * `i32::wrapping_abs` * `i32::overflowing_abs` * `RefCell::try_borrow` * `RefCell::try_borrow_mut` * `DefaultHasher` * `DefaultHasher::new` * `DefaultHasher::default` Deprecated * `BinaryHeap::push_pop` * `BinaryHeap::replace` * `SipHash13` * `SipHash24` * `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map` module Closes #28147 Closes #34767 Closes #35057 Closes #35070
2016-09-26Auto merge of #36764 - jonathandturner:rollup, r=jonathandturnerbors-2/+17
Rollup of 14 pull requests - Successful merges: #36563, #36574, #36586, #36662, #36663, #36669, #36676, #36721, #36723, #36727, #36729, #36742, #36754, #36756 - Failed merges:
2016-09-26Rollup merge of #36756 - alygin:e0512-new-format, r=jonathandturnerJonathan Turner-2/+7
New error format for E0512 Part of #35233, fixes #36107 r? @jonathandturner
2016-09-26Rollup merge of #36574 - japaric:link-arg, r=alexcrichtonJonathan Turner-0/+10
rustc: implement -C link-arg this flag lets you pass a _single_ argument to the linker but can be used _repeatedly_. For example, instead of using: ``` rustc -C link-args='-l bar' (..) ``` you could write ``` rustc -C link-arg='-l' -C link-arg='bar' (..) ``` This new flag can be used with RUSTFLAGS where `-C link-args` has problems with "nested" spaces: ``` RUSTFLAGS='-C link-args="-Tlayout.ld -nostartfiles"' ``` This passes three arguments to rustc: `-C` `link-args="-Tlayout.ld` and `-nostartfiles"` to `rustc`. That's not what we meant. But this does what we want: ``` RUSTFLAGS='-C link-arg=-Tlayout.ld -C link-arg=-nostartfiles` ``` cc rust-lang/rfcs#1509 r? @alexcrichton cc @Zoxc This needs a test. Any suggestion?
2016-09-26New error format for E0512Andrew Lygin-2/+7
2016-09-26appease tidyTim Neumann-1/+2
2016-09-26deduplicate inline is_nightly_build implementationsTim Neumann-4/+1
2016-09-26refactor away get_unstable_features_settingTim Neumann-19/+3
2016-09-26make is_nightly_build a method on UnstableFeaturesTim Neumann-4/+1
2016-09-26make emit_feature_err take a ParseSessTim Neumann-2/+2
2016-09-25Auto merge of #36151 - camlorn:struct_layout_optimization, r=eddybbors-17/+74
refactor to remove trans::adt and make rustc::ty::layout authoritative I asked on IRC about optimizing struct layout by reordering fields from most-aligned to least-aligned and somehow ended up getting talked into doing this. The goal here is to make `layout` authoritative and to remove `adt`. The former has been accomplished by reimplementing `represent_type_uncached` and the latter is in progress. @eddyb thought I should make the PR now. My plan is to reserve the actual optimization for a second PR, as this work is useful by itself.
2016-09-25Incorporate review comments.Austin Hicks-15/+4
2016-09-25Auto merge of #36616 - jseyfried:load_macros_in_resolve, r=nrcbors-1/+7
Load macros from `#[macro_use]` extern crates in `resolve` r? @nrc
2016-09-24Clean up matches that determine integers for specific alignment requirementsAustin Hicks-14/+23
2016-09-24Optimize struct_field_ptrAustin Hicks-0/+9
2016-09-24Completely kill `represent_type` and the `adt::Repr` type that goes with it.Austin Hicks-2/+52
2016-09-24Load macros from `#[macro_use]` extern crates in `resolve`.Jeffrey Seyfried-1/+7
2016-09-23Auto merge of #36684 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-2/+2
Rollup of 7 pull requests - Successful merges: #36018, #36498, #36500, #36559, #36566, #36578, #36664 - Failed merges:
2016-09-24Rollup merge of #36559 - grimreaper:eax/fix/r1, r=nikomatsakisGuillaume Gomez-2/+2
Fix a variety of minor issues CSS: - use integer values for font-size in CSS - use correct ordering of @import - "invisible" isn't a tag - presume its a class - "border-color" defines the complete border python: - use "not" instead of == "[]" for python - prefer triple quoted docstrings - prefer static functions where possible - prefer modern style classes where possible - remove semicolons; global: - remove duplicated words words
2016-09-23Auto merge of #36525 - jseyfried:load_crates_in_resolve, r=nikomatsakisbors-5/+5
Load extern crates in `resolve` This PR loads `extern crate`s in `resolve`'s `BuildReducedGraphVistor`. r? @nikomatsakis
2016-09-23Auto merge of #36649 - eddyb:selfish-idents, r=pnkfelixbors-1/+10
Don't let a type parameter named "Self" unchanged past HIR lowering. Fixes #36638 by rewriting `Self` type parameters (which are a parse error) to a `gensym("Self")`. Background: #35605 introduced code across rustc that determines `Self` by its keyword name. Reverting the sanity checks around that would inadvertently cause confusion between the true `Self` of a `trait` and other type parameters named `Self` (which have caused parse errors already). I do not like to use `gensym`, and we may do something different here in the future, but this should work.
2016-09-23Load extern crates in `resolve`.Jeffrey Seyfried-5/+5
2016-09-22Auto merge of #36573 - jseyfried:groundwork, r=nrcbors-21/+15
resolve: groundwork for building the module graph during expansion r? @nrc
2016-09-22Split up `DefCollector::root()`.Jeffrey Seyfried-21/+15
2016-09-22Don't let a type parameter named "Self" unchanged past HIR lowering.Eduard Burtescu-1/+10
2016-09-22Auto merge of #36261 - parched:soft-float, r=pnkfelixbors-1/+1
Fix documentation with 'soft-float' codegen option This option doesn't cause software FP routines to be called, it only changes the float ABI. Additionally, this option is ignored by all targets, except the ARM eabihf ones.
2016-09-21Auto merge of #36551 - eddyb:meta-games, r=nikomatsakisbors-2184/+768
Refactor away RBML from rustc_metadata. RBML and `ty{en,de}code` have had their long-overdue purge. Summary of changes: * Metadata is now a tree encoded in post-order and with relative backward references pointing to children nodes. With auto-deriving and type safety, this makes maintenance and adding new information to metadata painless and bug-free by default. It's also more compact and cache-friendly (cache misses should be proportional to the depth of the node being accessed, not the number of siblings as in EBML/RBML). * Metadata sizes have been reduced, for `libcore` it went down 16% (`8.38MB` -> `7.05MB`) and for `libstd` 14% (`3.53MB` -> `3.03MB`), while encoding more or less the same information * Specialization is used in the bundled `libserialize` (crates.io `rustc_serialize` remains unaffected) to customize the encoding (and more importantly, decoding) of various types, most notably those interned in the `TyCtxt`. Some of this abuses a soundness hole pending a fix (cc @aturon), but when that fix arrives, we'll move to macros 1.1 `#[derive]` and custom `TyCtxt`-aware serialization traits. * Enumerating children of modules from other crates is now orthogonal to describing those items via `Def` - this is a step towards bridging crate-local HIR and cross-crate metadata * `CrateNum` has been moved to `rustc` and both it and `NodeId` are now newtypes instead of `u32` aliases, for specializing their decoding. This is `[syntax-breaking]` (cc @Manishearth ). cc @rust-lang/compiler
2016-09-20rustc: allow less and handle fn pointers in the type hashing algorithm.Eduard Burtescu-6/+9
2016-09-20rustc_trans: simplify vtable and symbol handling.Eduard Burtescu-2/+121
2016-09-20rustc_resolve: bring back "struct called like a function" cross-crate.Eduard Burtescu-1/+3
2016-09-20rustc: don't hash the --extern crate name, but the original one, in DefPath.Eduard Burtescu-11/+11
2016-09-20serialize: allow specifying the default behavior for specializations.Eduard Burtescu-5/+15
2016-09-20rustc: don't recurse through nested items in decoded HIR fragments.Eduard Burtescu-10/+9
2016-09-20rustc_metadata: move opt_item_name to TyCtxt::item_name.Eduard Burtescu-10/+44
2016-09-20rustc_metadata: replace RBML with a simple and type-safe scheme.Eduard Burtescu-5/+8
2016-09-20rustc_metadata: split the Def description of a DefId from item_children.Eduard Burtescu-9/+4
2016-09-20rustc_metadata: move all encoding/decoding helpers to methods.Eduard Burtescu-3/+0
2016-09-20rustc_metadata: group information into less tags.Eduard Burtescu-40/+35
2016-09-20rustc: remove ImplOrTraitItemId and TraitDef's associated_type_names.Eduard Burtescu-70/+29
2016-09-20rustc_metadata: move more RBML tags to auto-serialization.Eduard Burtescu-265/+82
2016-09-20rustc_metadata: remove ty{en,de}code and move to auto-derived serialization.Eduard Burtescu-75/+141