summary refs log tree commit diff
path: root/src/librustc/util
AgeCommit message (Collapse)AuthorLines
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
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