about summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2015-08-24split ReInfer into ReVar and ReSkolemizedAriel Ben-Yehuda-5/+5
this should reduce the size of ty::Region to 24 bytes (from 32), and they are treated differently in most cases anyway.
2015-08-24convert to use `is_local` instead of `== LOCAL_CRATE`Niko Matsakis-3/+3
2015-08-24fallout from moving def-idNiko Matsakis-6/+8
2015-08-18kill the old funky `can_reach` fnNiko Matsakis-43/+0
2015-08-14rustc: Allow changing the default allocatorAlex Crichton-4/+4
This commit is an implementation of [RFC 1183][rfc] which allows swapping out the default allocator on nightly Rust. No new stable surface area should be added as a part of this commit. [rfc]: https://github.com/rust-lang/rfcs/pull/1183 Two new attributes have been added to the compiler: * `#![needs_allocator]` - this is used by liballoc (and likely only liballoc) to indicate that it requires an allocator crate to be in scope. * `#![allocator]` - this is a indicator that the crate is an allocator which can satisfy the `needs_allocator` attribute above. The ABI of the allocator crate is defined to be a set of symbols that implement the standard Rust allocation/deallocation functions. The symbols are not currently checked for exhaustiveness or typechecked. There are also a number of restrictions on these crates: * An allocator crate cannot transitively depend on a crate that is flagged as needing an allocator (e.g. allocator crates can't depend on liballoc). * There can only be one explicitly linked allocator in a final image. * If no allocator is explicitly requested one will be injected on behalf of the compiler. Binaries and Rust dylibs will use jemalloc by default where available and staticlibs/other dylibs will use the system allocator by default. Two allocators are provided by the distribution by default, `alloc_system` and `alloc_jemalloc` which operate as advertised. Closes #27389
2015-08-14Auto merge of #27641 - nikomatsakis:soundness-rfc-1214, r=nrcbors-0/+5
This PR implements the majority of RFC 1214. In particular, it implements: - the new outlives relation - comprehensive WF checking For the most part, new code receives warnings, not errors, though 3 regressions were found via a crater run. There are some deviations from RFC 1214. Most notably: - we still consider implied bounds from fn ret; this intersects other soundness issues that I intend to address in detail in a follow-up RFC. Fixing this without breaking a lot of code probably requires rewriting compare-method somewhat (which is probably a good thing). - object types do not check trait bounds for fear of encountering `Self`; this was left as an unresolved question in RFC 1214, but ultimately feels inconsistent. Both of those two issues are highlighted in the tracking issue, https://github.com/rust-lang/rust/issues/27579. #27579 also includes a testing matrix with new tests that I wrote -- these probably duplicate some existing tests, I tried to check but wasn't quite sure what to look for. I tried to be thorough in testing the WF relation, at least, but would welcome suggestions for missing tests. r? @nrc (or perhaps someone else?)
2015-08-12Add two new kinds of predicates, WellFormed and ObjectSafe.Niko Matsakis-0/+5
2015-08-12Remove all unstable deprecated functionalityAlex Crichton-27/+15
This commit removes all unstable and deprecated functions in the standard library. A release was recently cut (1.3) which makes this a good time for some spring cleaning of the deprecated functions.
2015-08-10Stabilize the Duration APISteven Fackler-2/+2
This commit stabilizes the `std::time` module and the `Duration` type. `Duration::span` remains unstable, and the `Display` implementation for `Duration` has been removed as it is still being reworked and all trait implementations for stable types are de facto stable. This is a [breaking-change] to those using `Duration`'s `Display` implementation.
2015-08-07rename ADTDef to AdtDef etc.Ariel Ben-Yehuda-1/+1
2015-08-06introduce an ADTDef struct for struct/enum definitionsAriel Ben-Yehuda-6/+14
2015-07-27std: Deprecate a number of unstable featuresAlex Crichton-1/+2
Many of these have long since reached their stage of being obsolete, so this commit starts the removal process for all of them. The unstable features that were deprecated are: * cmp_partial * fs_time * hash_default * int_slice * iter_min_max * iter_reset_fuse * iter_to_vec * map_in_place * move_from * owned_ascii_ext * page_size * read_and_zero * scan_state * slice_chars * slice_position_elem * subslice_offset
2015-07-24Unify the upvar variables found in closures with the actual types of theNiko Matsakis-14/+24
upvars after analysis is done. Remove the `closure_upvars` helper and just consult this list of type variables directly.
2015-07-24Introduce ClosureSubsts rather than just having random fields in theNiko Matsakis-2/+5
TyClosure variant; thread this through wherever closure substitutions are expected, which leads to a net simplification. Simplify trans treatment of closures in particular.
2015-07-24introduce a Vec<Ty> to TyClosure for storing upvar typesNiko Matsakis-1/+1
2015-07-14Transition to the new object lifetime defaults, replacing the oldNiko Matsakis-4/+0
defaults completely.
2015-07-12Auto merge of #26895 - jroesch:modernize-typeck-names, r=nikomatsakisbors-2/+2
This PR modernizes some names in the type checker. The only remaining snake_case name in ty.rs is `ctxt` which should be resolved by @eddyb's pending refactor. We can bike shed over the names, it would just be nice to bring the type checker inline with modern Rust. r? @eddyb cc @nikomatsakis
2015-07-10Rename TypeWithMutability to TypeAndMutJared Roesch-2/+2
2015-07-08Remove snake_case names from ty.rsJared Roesch-2/+2
2015-07-08Report memory use in time-passes on WindowsPeter Atashian-5/+40
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-07-04rustc: simplify ty::MethodOrigin and avoid trait item indices.Eduard Burtescu-29/+0
2015-07-04rustc: remove unused MethodStaticClosure variant of MethodOrigin.Eduard Burtescu-3/+0
2015-07-03Fix some merge conflictsNiko Matsakis-9/+10
2015-07-03Add a boolean flag to ExistentialBounds tracking whether theNiko Matsakis-0/+4
region-bound is expected to change in Rust 1.3, but don't use it for anything in this commit. Note that this is not a "significant" part of the type (it's not part of the formal model) so we have to normalize this away or trans starts to get confused because two equal types wind up with distinct LLVM types.
2015-07-02Auto merge of #26722 - arielb1:log-deadlock, r=eddybbors-2/+9
These are RefCell deadlocks that cause the rustc task to die with the stderr lock held, causing a real deadlock. Fixes #26717. r? @eddyb
2015-07-02Report memory use in time-passesNick Cameron-2/+38
Reports the resident set size after each pass (linux-only).
2015-07-01Fix deadlocks with RUST_LOG=rustc::middle::tyAriel Ben-Yehuda-2/+9
These are RefCell deadlocks that cause the rustc task to die with the stderr lock held, causing a real deadlock. Fixes #26717.
2015-06-27Begin refactor type checking stateJared Roesch-1/+1
This first patch starts by moving around pieces of state related to type checking. The goal is to slowly unify the type checking state into a single typing context. This initial patch moves the ParameterEnvironment into the InferCtxt and moves shared tables from Inherited and ty::ctxt into their own struct Tables. This is the foundational work to refactoring the type checker to enable future evolution of the language and tooling.
2015-06-26rustc: switch most remaining middle::ty functions to methods.Eduard Burtescu-6/+6
2015-06-26rustc: move some functions in middle::ty working on Ty to methods.Eduard Burtescu-1/+1
2015-06-26rustc: combine type-flag-checking traits and fns and into one trait.Eduard Burtescu-3/+2
2015-06-23Remove the mostly unecessary ParamBounds structJared Roesch-33/+0
2015-06-19rustc: remove Repr and UserString.Eduard Burtescu-26/+4
2015-06-19rustc: replace Repr/UserString impls with Debug/Display ones.Eduard Burtescu-982/+476
2015-06-19Move AST Repr impls to Debug impls in libsyntax.Eduard Burtescu-42/+12
2015-06-19rustc: remove some unused UserString and Repr impls.Eduard Burtescu-26/+1
2015-06-19rustc: use the TLS type context in Repr and UserString.Eduard Burtescu-513/+571
2015-06-19rustc: leave only one free top-level function in ppaux, and private.Eduard Burtescu-352/+193
2015-06-19rustc: use Repr and UserString instead of ppaux::ty_to_string.Eduard Burtescu-13/+19
2015-06-19rustc: reduce ppaux's public footprint to 5 functions.Eduard Burtescu-103/+67
2015-06-12Split TyArray into TyArray and TySlice.Eli Friedman-6/+5
Arrays and slices are closely related, but not that closely; making the separation more explicit is generally more clear.
2015-06-12Cleanup: rename middle::ty::sty and its variants.Eli Friedman-26/+26
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-5/+5
2015-06-10Auto merge of #26141 - eddyb:ast_map, r=nikomatsakisbors-1/+1
Gets libsyntax one step closer to running on stable (see #24518). Closes #24757, erickt's previous attempt at this.
2015-06-10syntax: move ast_map to librustc.Eduard Burtescu-1/+1
2015-06-08Skip useless recursion in freshening and late-bound-region substitutioAriel Ben-Yehuda-2/+2
Before: 581.72user 4.75system 7:42.74elapsed 126%CPU (0avgtext+0avgdata 1176224maxresident)k llvm took 359.183 After: 550.63user 5.09system 7:20.28elapsed 126%CPU (0avgtext+0avgdata 1165516maxresident)k llvm took 354.801
2015-06-08review changes - only show closure ids in verbose modeNick Cameron-3/+14
2015-06-08Tidying up, fix some minor linkage bugs, use ty flags to avoid caching ↵Nick Cameron-5/+8
closure types.
2015-06-02Auto merge of #25868 - alexcrichton:issue-25505, r=brsonbors-12/+29
The compiler already has special support for fixing up verbatim paths with disks on Windows to something that can be correctly passed down to gcc, and this commit adds support for verbatim UNC paths as well. Closes #25505
2015-05-28rustc: Fixup verbatim UNC paths as well on WindowsAlex Crichton-12/+29
The compiler already has special support for fixing up verbatim paths with disks on Windows to something that can be correctly passed down to gcc, and this commit adds support for verbatim UNC paths as well. Closes #25505