about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2017-03-10Refactor out `ast::ItemKind::MacroDef`.Jeffrey Seyfried-1/+1
2017-03-03Auto merge of #39927 - nikomatsakis:incr-comp-skip-borrowck-2, r=eddybbors-1/+5
transition borrowck to visit all **bodies** and not item-likes This is a better structure for incremental compilation and also more compatible with the eventual borrowck mir. It also fixes #38520 as a drive-by fix. r? @eddyb
2017-02-28Make transmuting from fn item types to pointer-sized types a hard error.Eduard Burtescu-9/+39
2017-02-28move the `FreeRegionMap` into `TypeckTables`Niko Matsakis-1/+5
2017-02-25rustc_const_eval: always demand typeck_tables for evaluating constants.Eduard-Mihai Burtescu-93/+11
2017-02-25rustc_typeck: rework coherence to be almost completely on-demand.Eduard-Mihai Burtescu-2/+0
2017-02-25rustc_typeck: hook up collect and item/body check to on-demand.Eduard-Mihai Burtescu-4/+3
2017-02-25rustc: simplify tcx.closure_type(...) as it can copy the cached values.Eduard-Mihai Burtescu-4/+8
2017-02-25rustc: combine BareFnTy and ClosureTy into FnSig.Eduard-Mihai Burtescu-7/+7
2017-02-25rustc: introduce a query system for type information in ty::maps.Eduard Burtescu-74/+44
2017-02-25rustc: consolidate dep-tracked hashmaps in tcx.maps.Eduard-Mihai Burtescu-1/+1
2017-02-25rustc: store type parameter defaults outside of ty::Generics.Eduard-Mihai Burtescu-14/+5
2017-02-25Rollup merge of #40025 - est31:master, r=eddybEduard-Mihai Burtescu-0/+2
Implement non-capturing closure to fn coercion Implements non capturing closure coercion ([RFC 1558](https://github.com/rust-lang/rfcs/blob/master/text/1558-closure-to-fn-coercion.md)). cc tracking issue #39817
2017-02-23Implement non-capturing closure to fn coercionest31-0/+2
2017-02-18Properly implement labeled breaks in while conditionsTaylor Cramer-8/+16
2017-02-17Normalize labeled and unlabeled breaksTaylor Cramer-21/+4
2017-02-10Prefer switching on false for boolean switchesSimonas Kazlauskas-3/+0
This ends up not really mattering because we generate a plain conditional branch in LLVM either way.
2017-02-10Only SwitchInt over integers, not all constsSimonas Kazlauskas-0/+13
Also use a Cow to avoid full Vec for all SwitchInts
2017-02-10SwitchInt over SwitchSimonas Kazlauskas-0/+1
This removes another special case of Switch by replacing it with the more general SwitchInt. While this is more clunky currently, there’s no reason we can’t make it nice (and efficient) to use.
2017-02-09Auto merge of #39686 - frewsxcv:rollup, r=frewsxcvbors-1/+3
Rollup of 5 pull requests - Successful merges: #39595, #39601, #39602, #39615, #39647 - Failed merges:
2017-02-09Rollup merge of #39602 - estebank:fix-39544, r=eddybCorey Farwell-1/+3
Fix ICE when accessing mutably an immutable enum Fix #39544.
2017-02-09Auto merge of #39265 - est31:master, r=petrochenkovbors-13/+1
Stabilize static lifetime in statics Stabilize the "static_in_const" feature. Blockers before this PR can be merged: * [x] The [FCP with inclination to stabilize](https://github.com/rust-lang/rust/issues/35897#issuecomment-270441437) needs to be over. FCP lasts roughly three weeks, so will be over at Jan 25, aka this thursday. * [x] Documentation needs to be added (#37928) Closes #35897.
2017-02-08sanitizer supportJorge Aparicio-0/+2
2017-02-08Stabilize static in constest31-13/+1
Closes #35897.
2017-02-06Fix ICE when accessing mutably an immutable enumEsteban Küber-1/+3
2017-02-05make lifetimes that only appear in return type early-boundNiko Matsakis-20/+29
This is the full and proper fix for #32330. This also makes some effort to give a nice error message (as evidenced by the `ui` test), sending users over to the tracking issue for a full explanation.
2017-02-05Rollup merge of #39009 - canndrew:default-unit-warnings, r=nikomatsakisCorey Farwell-1/+1
Add warning for () to ! switch With feature(never_type) enabled diverging type variables will default to `!` instead of `()`. This can cause breakages where a trait is resolved on such a type. This PR emits a future-compatibility warning when it sees this happen.
2017-02-04Auto merge of #38426 - vadimcn:nobundle, r=alexcrichtonbors-1/+2
Implement kind="static-nobundle" (RFC 1717) This implements the "static-nobundle" library kind (last item from #37403). Rustc handles "static-nobundle" libs very similarly to dylibs, except that on Windows, uses of their symbols do not get marked with "dllimport". Which is the whole point of this feature.
2017-02-03Add warning for () to ! switchAndrew Cann-1/+1
2017-01-30Merge ty::TyBox into ty::TyAdtVadim Petrochenkov-1/+1
2017-01-28rustc: move object default lifetimes to resolve_lifetimes.Eduard-Mihai Burtescu-21/+328
2017-01-28rustc: always keep an explicit lifetime in trait objects.Eduard-Mihai Burtescu-2/+10
2017-01-28rustc: lower trait type paths as TyTraitObject.Eduard-Mihai Burtescu-33/+6
2017-01-28rustc: move most of lifetime elision to resolve_lifetimes.Eduard-Mihai Burtescu-10/+492
2017-01-28rustc: simplify scope-tracking in resolve_lifetime.Eduard-Mihai Burtescu-321/+219
2017-01-28rustc: clean up the style of middle::resolve_lifetime.Eduard-Mihai Burtescu-69/+99
2017-01-28rustc: always include elidable lifetimes in HIR types.Eduard-Mihai Burtescu-0/+6
2017-01-27Auto merge of #39139 - estebank:issue-38147, r=nikomatsakisbors-0/+57
Point to immutable arg/fields when trying to use as &mut Present the following output when trying to access an immutable borrow's field as mutable: ``` error[E0389]: cannot borrow data mutably in a `&` reference --> $DIR/issue-38147-1.rs:27:9 | 26 | fn f(&self) { | ----- use `&mut self` here to make mutable 27 | f.s.push('x'); | ^^^ assignment into an immutable reference ``` And the following when trying to access an immutable struct field as mutable: ``` error: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-3.rs:17:9 | 12 | s: &'a String | ------------- use `&'a mut String` here to make mutable ...| 16 | fn f(&self) { | ----- use `&mut self` here to make mutable 17 | self.s.push('x'); | ^^^^^^ cannot borrow as mutable ``` Fixes #38147.
2017-01-26Point to immutable arg/fields when trying to use as &mutEsteban Küber-0/+57
Point to immutable borrow arguments and fields when trying to use them as mutable borrows. Add label to primary span on "cannot borrow as mutable" errors. Present the following output when trying to access an immutable borrow's field as mutable: ``` error[E0389]: cannot borrow data mutably in a `&` reference --> $DIR/issue-38147-1.rs:27:9 | 26 | fn f(&self) { | ----- use `&mut self` here to make mutable 27 | f.s.push('x'); | ^^^ assignment into an immutable reference ``` And the following when trying to access an immutable struct field as mutable: ``` error: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-3.rs:17:9 | 12 | s: &'a String | ------------- use `&'a mut String` here to make mutable ...| 16 | fn f(&self) { | ----- use `&mut self` here to make mutable 17 | self.s.push('x'); | ^^^^^^ cannot borrow as mutable ```
2017-01-26Auto merge of #39066 - arielb1:lifetime-extension-test, r=nikomatsakisbors-19/+74
End temporary lifetimes being extended by `let X: &_` hints cc #39283 r? @nikomatsakis
2017-01-26rustc: don't call the HIR AST.Eduard-Mihai Burtescu-65/+65
2017-01-26rustc: rename TyCtxt's `map` field to `hir`.Eduard-Mihai Burtescu-62/+62
2017-01-25rename `Tables` to `TypeckTables`Niko Matsakis-7/+7
2017-01-25end temporary lifetimes being extended by `let X: &_` hintsAriel Ben-Yehuda-19/+74
Fixes #36082.
2017-01-19Implement the "static-nobundle" library kind (RFC 1717).Vadim Chugunov-1/+2
These are static libraries that are not bundled (as the name implies) into rlibs and staticlibs that rustc generates, and must be present when the final binary artifact is being linked.
2017-01-16AST/HIR: Replace Path with Type in WhereEqPredicateVadim Petrochenkov-6/+5
2017-01-09trans/metadata: Remove obsolete CrateStore::can_have_local_instance()Michael Woerister-8/+0
2017-01-09metadata: Add is_exported_symbol() method to CrateStore.Michael Woerister-0/+2
2017-01-06rustc: keep track of tables everywhere as if they were per-body.Eduard-Mihai Burtescu-150/+126
2017-01-05Auto merge of #38689 - pnkfelix:dont-check-stability-on-private-items, ↵bors-1/+36
r=nikomatsakis Dont check stability for items that are not pub to universe. Dont check stability for items that are not pub to universe. In other words, skip it for private and even `pub(restricted)` items, because stability checks are only relevant to things visible in other crates. Fix #38412.