about summary refs log tree commit diff
path: root/src/librustc/middle/cfg/construct.rs
AgeCommit message (Collapse)AuthorLines
2016-03-27rustc: move cfg, infer, traits and ty from middle to top-level.Eduard Burtescu-596/+0
2016-03-17hir, mir: Separate HIR expressions / MIR operands from InlineAsm.Eduard Burtescu-13/+4
2016-03-06Auto merge of #30884 - durka:inclusive-ranges, r=aturonbors-6/+0
This PR implements [RFC 1192](https://github.com/rust-lang/rfcs/blob/master/text/1192-inclusive-ranges.md), which is triple-dot syntax for inclusive range expressions. The new stuff is behind two feature gates (one for the syntax and one for the std::ops types). This replaces the deprecated functionality in std::iter. Along the way I simplified the desugaring for all ranges. This is my first contribution to rust which changes more than one character outside of a test or comment, so please review carefully! Some of the individual commit messages have more of my notes. Also thanks for putting up with my dumb questions in #rust-internals. - For implementing `std::ops::RangeInclusive`, I took @Stebalien's suggestion from https://github.com/rust-lang/rfcs/pull/1192#issuecomment-137864421. It seemed to me to make the implementation easier and increase type safety. If that stands, the RFC should be amended to avoid confusion. - I also kind of like @glaebhoerl's [idea](https://github.com/rust-lang/rfcs/pull/1254#issuecomment-147815299), which is unified inclusive/exclusive range syntax something like `x>..=y`. We can experiment with this while everything is behind a feature gate. - There are a couple of FIXMEs left (see the last commit). I didn't know what to do about `RangeArgument` and I haven't added `Index` impls yet. Those should be discussed/finished before merging. cc @Gankro since you [complained](https://www.reddit.com/r/rust/comments/3xkfro/what_happened_to_inclusive_ranges/cy5j0yq) cc #27777 #30877 rust-lang/rust#1192 rust-lang/rfcs#1254 relevant to #28237 (tracking issue)
2016-03-03Rename middle::ty::ctxt to TyCtxtJeffrey Seyfried-3/+3
2016-02-27fallout from removing hir::ExprRangeAlex Burka-6/+0
A whole bunch of stuff gets folded into struct handling! Plus, removes an ugly hack from trans and accidentally fixes a bug with constructing ranges from references (see later commits with tests).
2016-02-16Split PatKind::Enum into PatKind::TupleStruct and PatKind::PathVadim Petrochenkov-2/+3
2016-02-14Rename hir::Pat_ and its variantsVadim Petrochenkov-14/+14
2016-02-12Autoderef in librustcJonas Schievink-24/+24
2016-01-20Rename Def's variants and don't reexport themVadim Petrochenkov-2/+2
2015-12-16Implement type ascription.Eduard Burtescu-0/+1
2015-12-14Auto merge of #29735 - Amanieu:asm_indirect_constraint, r=pnkfelixbors-2/+1
This PR reverts #29543 and instead implements proper support for "=*m" and "+*m" indirect output operands. This provides a framework on top of which support for plain memory operands ("m", "=m" and "+m") can be implemented. This also fixes the liveness analysis pass not handling read/write operands correctly.
2015-12-07Remove some unnecessary indirection from HIR structuresVadim Petrochenkov-1/+1
2015-12-05Use a struct instead of a tuple for inline asm output operandsAmanieu d'Antras-2/+1
2015-12-05Add proper support for indirect output constraints in inline asmAmanieu d'Antras-1/+1
2015-11-04Remove use of RefCell<DefMap> in the simpler parts of pat_utilJonathan S-1/+1
2015-10-31Remove PatWildMultiVadim Petrochenkov-1/+1
2015-09-26Auto merge of #28642 - petrochenkov:name3, r=nrcbors-3/+3
This PR removes random remaining `Ident`s outside of libsyntax and performs general cleanup In particular, interfaces of `Name` and `Ident` are tidied up, `Name`s and `Ident`s being small `Copy` aggregates are always passed to functions by value, and `Ident`s are never used as keys in maps, because `Ident` comparisons are tricky. Although this PR closes https://github.com/rust-lang/rust/issues/6993 there's still work related to it: - `Name` can be made `NonZero` to compress numerous `Option<Name>`s and `Option<Ident>`s but it requires const unsafe functions. - Implementation of `PartialEq` on `Ident` should be eliminated and replaced with explicit hygienic, non-hygienic or member-wise comparisons. - Finally, large parts of AST can potentially be converted to `Name`s in the same way as HIR to clearly separate identifiers used in hygienic and non-hygienic contexts. r? @nrc
2015-09-24Remove the deprecated box(PLACE) syntax.Eduard Burtescu-2/+1
2015-09-23Remove random Idents outside of libsyntaxVadim Petrochenkov-3/+3
2015-09-17Remove hir::ExprParenNick Cameron-1/+0
2015-09-03Use proper span for break and continue labelsSimonas Kazlauskas-2/+2
Fixes #28109
2015-09-03Add an intital HIR and lowering stepNick Cameron-96/+76
2015-08-24Use a Vec instead of an HashMap for the scope hierarchyAriel Ben-Yehuda-5/+3
This increases regionck performance greatly - type-checking on librustc decreased from 9.1s to 8.1s. Because of Amdahl's law, total performance is improved only by about 1.5% (LLVM wizards, this is your opportunity to shine!). before: 576.91user 4.26system 7:42.36elapsed 125%CPU (0avgtext+0avgdata 1142192maxresident)k after: 566.50user 4.84system 7:36.84elapsed 125%CPU (0avgtext+0avgdata 1124304maxresident)k I am somewhat worried really need to find out why we have this Red Queen's Race going on here. Originally I suspected it may be a problem from RFC1214's warnings, but it seems to be an effect from other changes. However, the increase seems to be mostly in LLVM's time, so I guess it's the LLVM wizards' problem.
2015-07-07use is_method_call rather than directly accessing the method_mapAriel Ben-Yehuda-7/+2
2015-06-27Begin refactor type checking stateJared Roesch-2/+2
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-1/+1
2015-06-26rustc: move some functions in middle::ty working on Ty to methods.Eduard Burtescu-3/+3
2015-06-10Removed many pointless calls to *iter() and iter_mut()Joshua Landau-1/+1
2015-04-23Get associated consts working in match patterns.Sean Patrick Santos-0/+1
2015-04-17Port to using the newer graph, which offers iterators instead of theNiko Matsakis-1/+1
older `each` method, but is otherwise identical.
2015-04-01Fallout out rustcNiko Matsakis-1/+1
2015-02-24Implement `<T>::method` UFCS expression syntax.Eduard Burtescu-2/+1
2015-02-24rustc: combine partial_def_map and last_private_map into def_map.Eduard Burtescu-23/+15
2015-02-22revise handling of match expressions so that arms branch to next arm.James Miller-56/+104
Update the graphviz tests accordingly. Fixes #22073. (Includes regression test for the issue.) (Factoring of aatch CFG code, Part 4.)
2015-02-22remove the `exit_map` field, it is unnecessary.James Miller-11/+2
(Factoring of aatch CFG code, Part 2.)
2015-02-22Distinguish between AST and various Dummy nodes in CFG.James Miller-34/+39
(Factoring of aatch CFG code, Part 1.)
2015-02-20Remove remaining uses of `[]`. This time I tried to use deref coercions ↵Niko Matsakis-3/+3
where possible.
2015-02-02`for x in xs.iter()` -> `for x in &xs`Jorge Aparicio-5/+5
2015-01-30remove dead codeJorge Aparicio-1/+1
2015-01-30implement for loop desugaringJorge Aparicio-36/+1
2015-01-25Add the span of the operator itself to ast::BinOp.Huon Wilson-1/+1
2015-01-21Fallout from stabilization.Aaron Turon-1/+1
2015-01-18Fix typedef/module name conflicts in the compilerAlex Crichton-1/+1
2015-01-15syntax: add fully qualified UFCS expressions.Eduard Burtescu-1/+2
2015-01-07use slicing sugarJorge Aparicio-5/+5
2015-01-06rollup merge of #20645: nikomatsakis/rustbook-iceAlex Crichton-1/+1
Conflicts: src/librustc/middle/mem_categorization.rs src/librustc/middle/ty.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/foreign.rs src/librustc_typeck/check/mod.rs
2015-01-06rollup merge of #20481: seanmonstar/fmt-show-stringAlex Crichton-3/+3
Conflicts: src/compiletest/runtest.rs src/libcore/fmt/mod.rs src/libfmt_macros/lib.rs src/libregex/parse.rs src/librustc/middle/cfg/construct.rs src/librustc/middle/dataflow.rs src/librustc/middle/infer/higher_ranked/mod.rs src/librustc/middle/ty.rs src/librustc_back/archive.rs src/librustc_borrowck/borrowck/fragments.rs src/librustc_borrowck/borrowck/gather_loans/mod.rs src/librustc_resolve/lib.rs src/librustc_trans/back/link.rs src/librustc_trans/save/mod.rs src/librustc_trans/trans/base.rs src/librustc_trans/trans/callee.rs src/librustc_trans/trans/common.rs src/librustc_trans/trans/consts.rs src/librustc_trans/trans/controlflow.rs src/librustc_trans/trans/debuginfo.rs src/librustc_trans/trans/expr.rs src/librustc_trans/trans/monomorphize.rs src/librustc_typeck/astconv.rs src/librustc_typeck/check/method/mod.rs src/librustc_typeck/check/mod.rs src/librustc_typeck/check/regionck.rs src/librustc_typeck/collect.rs src/libsyntax/ext/format.rs src/libsyntax/ext/source_util.rs src/libsyntax/ext/tt/transcribe.rs src/libsyntax/parse/mod.rs src/libsyntax/parse/token.rs src/test/run-pass/issue-8898.rs
2015-01-06core: split into fmt::Show and fmt::StringSean McArthur-3/+3
fmt::Show is for debugging, and can and should be implemented for all public types. This trait is used with `{:?}` syntax. There still exists #[derive(Show)]. fmt::String is for types that faithfully be represented as a String. Because of this, there is no way to derive fmt::String, all implementations must be purposeful. It is used by the default format syntax, `{}`. This will break most instances of `{}`, since that now requires the type to impl fmt::String. In most cases, replacing `{}` with `{:?}` is the correct fix. Types that were being printed specifically for users should receive a fmt::String implementation to fix this. Part of #20013 [breaking-change]
2015-01-07Replace full slice notation with index callsNick Cameron-3/+3
2015-01-06Fix ICE that @steveklabnik encountered in rust-ice. The problems turned out ↵Niko Matsakis-1/+1
to be that were being very loose with bound regions in trans (we were basically just ignoring and flattening binders). Since binders are significant to subtyping and hence to trait selection, this can cause a lot of problems. So this patch makes us treat them more strictly -- for example, we propagate binders, and avoid skipping past the `Binder` by writing `foo.0`. Fixes #20644.