summary refs log tree commit diff
path: root/src/librustc/middle/dataflow.rs
AgeCommit message (Collapse)AuthorLines
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-1/+1
2016-12-28rustc: always print nested nodes where a HIR map is available.Eduard-Mihai Burtescu-14/+8
2016-12-28rustc: move function arguments into hir::Body.Eduard-Mihai Burtescu-11/+15
2016-12-28rustc: separate bodies for static/(associated)const and embedded constants.Eduard-Mihai Burtescu-4/+4
2016-11-29revamp `Visitor` with a single method for controlling nested visitsNiko Matsakis-1/+3
2016-11-29Split nested_visit_mode function off from nested_visit_mapFlorian Diebold-0/+2
... and make the latter mandatory to implement.
2016-11-10rustc: use an Expr instead of a Block for function bodies.Eduard Burtescu-4/+4
2016-09-20rustc_metadata: go only through rustc_serialize in astencode.Eduard Burtescu-2/+2
2016-07-03prefer `if let` to match with `None => {}` arm in some placesZack M. Davis-3/+2
This is a spiritual succesor to #34268/8531d581, in which we replaced a number of matches of None to the unit value with `if let` conditionals where it was judged that this made for clearer/simpler code (as would be recommended by Manishearth/rust-clippy's `single_match` lint). The same rationale applies to matches of None to the empty block.
2016-05-16fix bug in `debug!` output from `rustc::middle::dataflow`Felix S. Klock II-2/+2
(bug was cut/pasted into `rustc_borrowck::bitslice`, so I fixed it there as well.)
2016-05-11rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.Eduard Burtescu-2/+2
2016-05-11rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.Eduard Burtescu-2/+2
2016-04-06syntax: dismantle ast_util.Eduard Burtescu-2/+1
2016-04-06rustc: move rustc_front to rustc::hir.Eduard Burtescu-3/+3
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-3/+3
2016-03-22try! -> ?Jorge Aparicio-6/+6
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-21scaffolding for borrowck on MIR.Felix S. Klock II-1/+1
emit (via debug!) scary message from `fn borrowck_mir` until basic prototype is in place. Gather children of move paths and set their kill bits in dataflow. (Each node has a link to the child that is first among its siblings.) Hooked in libgraphviz based rendering, including of borrowck dataflow state. doing this well required some refactoring of the code, so I cleaned it up more generally (adding comments to explain what its trying to do and how it is doing it). Update: this newer version addresses most review comments (at least the ones that were largely mechanical changes), but I left the more interesting revisions to separate followup commits (in this same PR).
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-3/+3
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-2/+2
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-01-25librustc/middle/dataflow.rs: Debug to STDERRAdrian Heine-2/+1
In 95d904625b4d45af80b4e40d51a3a0fde1abaa8a output was accidentally moved from STDERR to STDOUT. This commit also changes the order of debug output. Previously, it was: ``` /* id 22: … */ { … } DEBUG:rustc::middle::dataflow: ``` Now, it is: ``` DEBUG:rustc::middle::dataflow: /* id 22: … */ { … } ```
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-6/+10
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2015-11-24Use the EntryOrExit variants qualified.Ms2ger-5/+3
2015-11-18Port a bunch of code new-visitor; all of these ports wereNiko Matsakis-5/+5
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-09-23Remove random Idents outside of libsyntaxVadim Petrochenkov-1/+1
2015-09-16Use ast attributes every where (remove HIR attributes).Nick Cameron-0/+1
This could be a [breaking-change] if your lint or syntax extension (is that even possible?) uses HIR attributes or literals.
2015-09-03Add an intital HIR and lowering stepNick Cameron-8/+11
2015-07-09Use vec![elt; n] where possibleUlrik Sverdrup-7/+6
The common pattern `iter::repeat(elt).take(n).collect::<Vec<_>>()` is exactly equivalent to `vec![elt; n]`, do this replacement in the whole tree. (Actually, vec![] is smart enough to only call clone n - 1 times, while the former solution would call clone n times, and this fact is virtually irrelevant in practice.)
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-04-17Port to using the newer graph, which offers iterators instead of theNiko Matsakis-3/+2
older `each` method, but is otherwise identical.
2015-04-15Dataflow changes and associated borrowck fix.Felix S. Klock II-17/+63
Revise rustc::middle::dataflow: one must select kill-kind when calling add_kill. The current kill-kinds are (1.) kills associated with ends-of-scopes and (2.) kills associated with the actual action of the expression/pattern. Then, use this to fix borrowck analysis so that it will not treat a break that pops through an assignment `x = { ... break; ... }` as a kill of the "moved-out" bit for `x`. Fix #24267. (incorporated review feedback.)
2015-04-03Auto merge of #23832 - petrochenkov:usize, r=aturonbors-4/+4
These constants are small and can fit even in `u8`, but semantically they have type `usize` because they denote sizes and are almost always used in `usize` context. The change of their type to `u32` during the integer audit led only to the large amount of `as usize` noise (see the second commit, which removes this noise). This is a minor [breaking-change] to an unstable interface. r? @aturon
2015-04-01rollup merge of #23860: nikomatsakis/copy-requires-cloneAlex Crichton-1/+1
Conflicts: src/test/compile-fail/coherence-impls-copy.rs
2015-04-01Fallout out rustcNiko Matsakis-1/+1
2015-04-01Pretty print ids for assoc itemsNick Cameron-1/+1
2015-03-30Remove unnecessary `as usize`Vadim Petrochenkov-4/+4
2015-03-27rollup merge of #23741: alexcrichton/remove-int-uintAlex Crichton-28/+28
Conflicts: src/librustc/middle/ty.rs src/librustc_trans/trans/adt.rs src/librustc_typeck/check/mod.rs src/libserialize/json.rs src/test/run-pass/spawn-fn.rs
2015-03-27default => or_insert per RFCAlexis Beingessner-2/+2
2015-03-26update everything to use Entry defaultsAlexis-12/+2
2015-03-26Mass rename uint/int to usize/isizeAlex Crichton-28/+28
Now that support has been removed, all lingering use cases are renamed.
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-5/+7
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-03-02core: Audit num module for int/uintBrian Anderson-5/+5
* count_ones/zeros, trailing_ones/zeros return u32, not usize * rotate_left/right take u32, not usize * RADIX, MANTISSA_DIGITS, DIGITS, BITS, BYTES are u32, not usize Doesn't touch pow because there's another PR for it. [breaking-change]
2015-02-22Add support for mapping a single ast-node to multiple cfg-nodes.James Miller-39/+67
This is necessary for e.g. supporting the cfgs we plan to construct for match under aatch's plan. (Factoring of aatch CFG code, Part 3.)
2015-02-22Distinguish between AST and various Dummy nodes in CFG.James Miller-3/+3
(Factoring of aatch CFG code, Part 1.)
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-1/+1
where possible.
2015-02-18rollup merge of #22502: nikomatsakis/deprecate-bracket-bracketAlex Crichton-2/+2
Conflicts: src/libcollections/slice.rs src/libcollections/str.rs src/librustc/middle/lang_items.rs src/librustc_back/rpath.rs src/librustc_typeck/check/regionck.rs src/libstd/ffi/os_str.rs src/libsyntax/diagnostic.rs src/libsyntax/parse/parser.rs src/libsyntax/util/interner.rs src/test/run-pass/regions-refcell.rs
2015-02-18Replace all uses of `&foo[]` with `&foo[..]` en masse.Niko Matsakis-2/+2
2015-02-18Remove usage of .map(|&foo| foo)Kevin Butler-2/+2
2015-02-11rustc: Fix a number of stability lint holesAlex Crichton-11/+11
There are a number of holes that the stability lint did not previously cover, including: * Types * Bounds on type parameters on functions and impls * Where clauses * Imports * Patterns (structs and enums) These holes have all been fixed by overriding the `visit_path` function on the AST visitor instead of a few specialized cases. This change also necessitated a few stability changes: * The `collections::fmt` module is now stable (it was already supposed to be). * The `thread_local::imp::Key` type is now stable (it was already supposed to be). * The `std::rt::{begin_unwind, begin_unwind_fmt}` functions are now stable. These are required via the `panic!` macro. * The `std::old_io::stdio::{println, println_args}` functions are now stable. These are required by the `print!` and `println!` macros. * The `ops::{FnOnce, FnMut, Fn}` traits are now `#[stable]`. This is required to make bounds with these traits stable. Note that manual implementations of these traits are still gated by default, this stability only allows bounds such as `F: FnOnce()`. Additionally, the compiler now has special logic to ignore its own generated `__test` module for the `--test` harness in terms of stability. Closes #8962 Closes #16360 Closes #20327 [breaking-change]
2015-02-05cleanup: replace `as[_mut]_slice()` calls with deref coercionsJorge Aparicio-4/+4
2015-02-02`for x in xs.iter_mut()` -> `for x in &mut xs`Jorge Aparicio-1/+1
Also `for x in option.iter_mut()` -> `if let Some(ref mut x) = option`