summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
2016-02-03std: Stabilize custom hasher support in HashMapAlex Crichton-3/+2
This commit implements the stabilization of the custom hasher support intended for 1.7 but left out due to some last-minute questions that needed some decisions. A summary of the actions done in this PR are: Stable * `std::hash::BuildHasher` * `BuildHasher::Hasher` * `BuildHasher::build_hasher` * `std::hash::BuildHasherDefault` * `HashMap::with_hasher` * `HashMap::with_capacity_and_hasher` * `HashSet::with_hasher` * `HashSet::with_capacity_and_hasher` * `std::collections::hash_map::RandomState` * `RandomState::new` Deprecated * `std::collections::hash_state` * `std::collections::hash_state::HashState` - this trait was also moved into `std::hash` with a reexport here to ensure that we can have a blanket impl to prevent immediate breakage on nightly. Note that this is unstable in both location. * `HashMap::with_hash_state` - renamed * `HashMap::with_capacity_and_hash_state` - renamed * `HashSet::with_hash_state` - renamed * `HashSet::with_capacity_and_hash_state` - renamed Closes #27713
2016-01-07Rename fold_subitems_with to super_fold_withJeffrey Seyfried-3/+2
2016-01-07Refactor away extension traits RegionEscape and HasTypeFlagsJeffrey Seyfried-2/+1
2016-01-07Create a visitor for `TypeFoldable`s and use it to implement RegionEscape ↵Jeffrey Seyfried-0/+4
and HasTypeFlags (fixes #20298)
2016-01-05Refactor compiler to make use of dep-tracking-maps. Also, in cases whereNiko Matsakis-39/+31
we were using interior mutability (RefCells, TyIvar), add some reads/writes.
2015-12-28Rename ExplicitSelfCategory's variants and stop re-exporting them.Ms2ger-5/+5
2015-12-28rewrite the method-receiver matching codeAriel Ben-Yehuda-2/+1
the old code was *so terrible*.
2015-12-21Register new snapshotsAlex Crichton-1/+0
Lots of cruft to remove!
2015-12-17Remove unused importsJeffrey Seyfried-5/+2
2015-12-14[breaking-change] move ast_util functions to methodsfaineance-4/+4
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-10/+4
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-26Add suggestion of similar macro names to `macro undefined` error messageFlorian Hartwig-63/+0
2015-11-23Avoid some code duplication around getting names of numeric types.Michael Woerister-46/+4
2015-11-18Port a bunch of code new-visitor; all of these ports wereNiko Matsakis-6/+6
straightforward uses of `visit_all_items`. In some cases I had to remove empty `visit_item` calls that were just to suppress visiting nested items.
2015-11-09std: Migrate to the new libcAlex Crichton-9/+14
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-10-01Convert DefId to use DefIndex, which is an index into a list ofNiko Matsakis-1/+1
paths, and construct paths for all definitions. Also, stop rewriting DefIds for closures, and instead just load the closure data from the original def-id, which may be in another crate.
2015-10-01build up a set of node-ids that we can construct def-ids fromNiko Matsakis-2/+2
2015-10-01Rename `node_id` to `var_id` and limit to the cases that are actually usedNiko Matsakis-1/+1
2015-10-01move direct accesses of `node` to go through `as_local_node_id`, unlessNiko Matsakis-10/+10
they are being used as an opaque "position identifier"
2015-10-01move job of creating local-def-ids to ast-map (with a few stragglers)Niko Matsakis-3/+3
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-7/+8
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-14split ty::util and ty::adjustmentAriel Ben-Yehuda-5/+5
2015-09-14split ty.rs into smaller partsAriel Ben-Yehuda-3/+152
2015-09-14move middle::ty and related modules to middle/ty/Ariel Ben-Yehuda-3/+3
2015-09-06move fnv hashing support into librustc_data_structuresNiko Matsakis-37/+2
2015-09-03Add an intital HIR and lowering stepNick Cameron-17/+59
2015-08-30fix compilation with RUST_LOG=rustc::middle::traitsAriel Ben-Yehuda-2/+27
2015-08-25use the parameter environment when checking dtorsAriel Ben-Yehuda-1/+1
This makes it more uniform. No functional changes.
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