about summary refs log tree commit diff
path: root/src/librustc/mir
AgeCommit message (Collapse)AuthorLines
2019-02-16Reintroduce the invariant comment for clarityOliver Scherer-0/+1
2019-02-16Reuse the `Pointer` type instead of passing reassembling it at many use sitesOliver Scherer-3/+2
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-1/+1
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-61/+62
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-1/+1
2019-02-12Rollup merge of #58313 - matthewjasper:use-question-in-macros, r=oli-obkMazdak Farrokhzad-230/+220
Use `?` in librustc macros
2019-02-10rustc: doc commentsAlexander Regueiro-61/+62
2019-02-10Rollup merge of #58324 - RalfJung:fn-ptr-eq, r=oli-obkGuillaume Gomez-8/+23
miri: give non-generic functions a stable address This makes Miri correctly handle format string parameters despite https://github.com/rust-lang/rust/issues/58320. Matching Miri PR: https://github.com/solson/miri/pull/626 r? @oli-obk
2019-02-09Use ? in librustc macrosMatthew Jasper-230/+220
2019-02-09miri: give non-generic functions a stable addressRalf Jung-8/+23
2019-02-09Auto merge of #58207 - nnethercote:intern_lazy_const, r=oli-obkbors-1/+1
Make `intern_lazy_const` actually intern its argument. Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-06Make `intern_lazy_const` actually intern its argument.Nicholas Nethercote-1/+1
Currently it just unconditionally allocates it in the arena. For a "Clean Check" build of the the `packed-simd` benchmark, this change reduces both the `max-rss` and `faults` counts by 59%; it slightly (~3%) increases the instruction counts but the `wall-time` is unchanged. For the same builds of a few other benchmarks, `max-rss` and `faults` drop by 1--5%, but instruction counts and `wall-time` changes are in the noise. Fixes #57432, fixes #57829.
2019-02-05move librustc to 2018Mark Mansi-60/+60
2019-01-30Swap the names of `LocalValue` and `LocalState`Oliver Scherer-1/+1
2019-01-27`ConstValue::ScalarPair` only needs to represent slicesOliver Scherer-31/+23
2019-01-27Add some size assertions for const eval typesOliver Scherer-0/+8
2019-01-19Handle lifetime annotations in unreachable codeMatthew Jasper-7/+10
We equate the type in the annotation with the inferred type first so that we have a fully inferred type to perform the well-formedness check on.
2019-01-19Use a struct for user type annotationsMatthew Jasper-8/+11
2019-01-19Rename UserTypeAnnotation -> UserTypeMatthew Jasper-3/+3
2019-01-05Rollup merge of #57314 - wiktorkuchta:master, r=Centrilkennytm-1/+1
Fix repeated word typos Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo ](https://github.com/e-maxx-eng/e-maxx-eng/pull/389) Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakiskennytm-22/+0
Remove some unused code Closes #57096
2019-01-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-01`<&'tcx ty::Const as Deref>::deref`Oliver Scherer-5/+5
2019-01-01Add `unwrap_usize` to `LazyConst`, tooOliver Scherer-1/+1
2019-01-01Move the `Unevaluated` constant arm upwards in the type structureOliver Scherer-15/+17
2018-12-30Stop duplicating projections of type annotation.David Wood-0/+75
This commit changes how type annotations are handled in bindings during MIR building. Instead of building up a `PatternTypeProjections` with the `CanonicalUserTypeAnnotation` and projections, the `CanonicalUserTypeAnnotation` is stored in the `canonical_user_type_annotations` map at the start and the (equivalent) `UserTypeProjections` is built up with the new index and same projections. This has the effect of deduplicating type annotations as instead of type annotations being added to the `canonical_user_type_annotations` map multiple times at the end after being duplicated (which happens in building up `PatternTypeProjections`), it is instead added once.
2018-12-30Refactor `UserTypeAnnotation`.David Wood-42/+32
This commit refactors the `UserTypeAnnotation` type to be referred to by an index within `UserTypeProjection`. `UserTypeAnnotation` is instead kept in an `IndexVec` within the `Mir` struct. Further, instead of `UserTypeAnnotation` containing canonicalized types, it now contains normal types and the entire `UserTypeAnnotation` is canonicalized. To support this, the type was moved from the `rustc::mir` module to `rustc::ty` module.
2018-12-29Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkovbors-1/+1
Implement RFC 2338, "Type alias enum variants" This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following. ```rust #![feature(type_alias_enum_variants)] enum Foo { Bar(i32), Baz { i: i32 }, } type Alias = Foo; fn main() { let t = Alias::Bar(0); let t = Alias::Baz { i: 0 }; match t { Alias::Bar(_i) => {} Alias::Baz { i: _i } => {} } } ``` Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern. Fixes issues #56199 and #56611. N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible. ```rust Option::<u8>::None; // OK Option::None::<u8>; // OK, but lint in near future (hard error next edition?) Alias::<u8>::None; // OK Alias::None::<u8>; // Error ``` I do not know if this will need an FCP, but let's start one if so.
2018-12-29Remove unused types from rustc::mir::interpretMatthew Jasper-22/+0
The types are no longer used with the change to stacked borrows for validation.
2018-12-27Auto merge of #57129 - RalfJung:check-bounds, r=oli-obkbors-1/+1
make Alloc::check_bounds_ptr private; you should use Memory::check_bounds_ptr instead r? @oli-obk
2018-12-26Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.Alexander Regueiro-1/+1
2018-12-26make Alloc::check_bounds_ptr private; you should use ↵Ralf Jung-1/+1
Memory::check_bounds_ptr instead
2018-12-25Remove licensesMark Rousskov-100/+0
2018-12-23stabilize min_const_unsafe_fn in 1.33.Mazdak Farrokhzad-3/+0
2018-12-20Auto merge of #56741 - RalfJung:retag-to-raw, r=oli-obkbors-36/+30
treat ref-to-raw cast like a reborrow: do a special kind of retag r? @oli-obk Cc @nikomatsakis
2018-12-18Auto merge of #56160 - oli-obk:const_fn_let, r=nikomatsakisbors-0/+15
Fix various aspects around `let` bindings inside const functions * forbid `let` bindings in const contexts that use short circuiting operators * harden analysis code against derefs of mutable references Initially this PR was about stabilizing `let` bindings, but too many flaws were exposed that need some more testing on nightly
2018-12-18treat ref-to-raw cast like a reborrow: do a special kind of retagRalf Jung-36/+30
2018-12-15Rollup merge of #56718 - RalfJung:use-libbacktrace-printing, r=alexcrichtonPietro Albini-40/+4
Use libbacktrace pretty-printing r? @alexcrichton
2018-12-13Auto merge of #56461 - oli-obk:alloc_ids, r=RalfJungbors-49/+71
Some cleanups around `AllocId` management r? @eddyb cc @RalfJung
2018-12-12Correct documentation about `FakeRead`Oliver Scherer-1/+2
2018-12-11miri: use backtrace crate printing instead of rolling our ownRalf Jung-40/+4
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-14/+14
2018-12-07Auto merge of #56502 - Zoxc:hir-func, r=eddybbors-6/+6
Use a function to access the Hir map to be able to turn it into a query later r? @eddyb
2018-12-07Introduce constraint category for yields.David Wood-0/+1
This commit adds a new `ConstraintCategory` for yield points - this allows for differentiation between a normal return and a yield in the diagnostics.
2018-12-07Rollup merge of #56516 - frewsxcv:frewsxcv-eq, r=Mark-Simulacrumkennytm-1/+1
Replace usages of `..i + 1` ranges with `..=i`. Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-6/+6
2018-12-06Auto merge of #55635 - oli-obk:min_const_unsafe_fn, r=nikomatsakisbors-3/+6
Allow calling `const unsafe fn` in `const fn` behind a feature gate cc #55607 r? @Centril
2018-12-04Replace usages of `..i + 1` ranges with `..=i`.Corey Farwell-1/+1
2018-12-04Automatically generate imports for newtype_index `Deserialize` implsOliver Scherer-1/+1
2018-12-04Emit feature gate suggestionOliver Scherer-3/+5