about summary refs log tree commit diff
path: root/src/librustc/middle/mem_categorization.rs
AgeCommit message (Collapse)AuthorLines
2019-04-27Auto merge of #59540 - Zoxc:the-arena-2, r=michaelwoeristerbors-3/+2
Use arenas to avoid Lrc in queries #1 Based on https://github.com/rust-lang/rust/pull/59536.
2019-04-25Update rvalue_promotable_mapJohn Kåre Alsaker-3/+2
2019-04-25Introduce hir::ExprKind::Use and employ in for loop desugaring.Mazdak Farrokhzad-1/+1
Here, ExprKind::Use(P<Expr>) tweaks the drop order to act the same way as '{ let _tmp = expr; _tmp }' does.
2019-04-21Remove mutability from `Def::Static`Vadim Petrochenkov-2/+5
2019-04-20Auto merge of #59987 - saleemjaffer:refactor_adjust_castkinds, r=oli-obkbors-6/+2
Refactor Adjust and CastKind fixes rust-lang#59588
2019-04-16refactor Adjustment to use new PointerCast enumSaleem Jaffer-6/+2
2019-04-14HirIdify hir::Defljedrz-3/+5
2019-04-01Allow closure to unsafe fn coercionTaiki Endo-1/+1
2019-03-24Re-order fields in `Def::Ctor`.David Wood-3/+3
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-4/+4
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24Remove `VariantDef::parent_did`Vadim Petrochenkov-1/+1
2019-03-24Separate variant id and variant constructor id.David Wood-9/+14
This commit makes two changes - separating the `NodeId` that identifies an enum variant from the `NodeId` that identifies the variant's constructor; and no longer creating a `NodeId` for `Struct`-style enum variants and structs. Separation of the variant id and variant constructor id will allow the rest of RFC 2008 to be implemented by lowering the visibility of the variant's constructor without lowering the visbility of the variant itself. No longer creating a `NodeId` for `Struct`-style enum variants and structs mostly simplifies logic as previously this `NodeId` wasn't used. There were various cases where the `NodeId` wouldn't be used unless there was an unit or tuple struct or enum variant but not all uses of this `NodeId` had that condition, by removing this `NodeId`, this must be explicitly dealt with. This change mostly applied cleanly, but there were one or two cases in name resolution and one case in type check where the existing logic required a id for `Struct`-style enum variants and structs.
2019-03-15rustc: remove TyCtxt::parent_def_id in favor of TyCtxt::parent.Eduard-Mihai Burtescu-3/+3
2019-03-15rustc: remove fmt::{Debug,Display} from ty::TyKind.Eduard-Mihai Burtescu-7/+10
2019-03-02hir: remove NodeId from Pat and FieldPatljedrz-9/+9
2019-02-24hir: remove NodeId from Exprljedrz-4/+4
2019-02-20Rollup merge of #58562 - dlrobertson:fix_nits, r=alexregkennytm-4/+4
Fix style nits Fix style nits discovered in reading code. r? @alexreg
2019-02-18Fix style nitsDan Robertson-4/+4
Fix style nits discovered in reading code.
2019-02-15Take Const into account in HIRvarkor-1/+1
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-13Rollup merge of #58137 - ljedrz:cleanup_node_id_to_type, r=estebankMazdak Farrokhzad-2/+2
Cleanup: rename node_id_to_type(_opt) Renames `node_id_to_type(_opt)` to `hir_id_to_type(_opt)`; this makes it clear we are dealing with HIR nodes and their IDs here. In addition, a drive-by commit removing `ty::item_path::hir_path_str` (as requested by @eddyb).
2019-02-10rustc: doc commentsAlexander Regueiro-8/+8
2019-02-09cleanup: rename node_id_to_type(_opt)ljedrz-2/+2
2019-02-05move librustc to 2018Mark Mansi-14/+14
2019-01-02rename `type_moves_by_default` to `type_is_copy_modulo_regions`Niko Matsakis-7/+8
2018-12-27AST/HIR: Introduce `ExprKind::Err` for better error recovery in the front-endVadim Petrochenkov-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-4/+4
2018-12-06Use a function to access the Hir map to be able to turn it into a query laterJohn Kåre Alsaker-8/+8
2018-11-14capture_disjoint_fields(rust-lang#53488)Blitzerr-1/+1
Refactoring out the HirId of the UpvarId in another struct.
2018-11-12Use IndexVec instead of `usize` in librustcOliver Scherer-1/+3
2018-10-17AST-borrowck: add separate mem category for thread-locals, as they are not ↵Felix S. Klock II-8/+21
quite rvalues (and of course they are not quite statics either). Namely, they *do* have a restricted region (like rvalues), but they also cannot be moved out of (like statics).
2018-10-06rustc/middle: whitespace & formatting fixesljedrz-226/+216
2018-10-06rustc/middle: use Cow<'static, str> where applicableljedrz-17/+18
2018-09-29don't elide lifetimes in paths in librustc/Zack M. Davis-7/+8
This seemed like a good way to kick the tires on the elided-lifetimes-in-paths lint (#52069)—seems to work! This was also pretty tedious—it sure would be nice if `cargo fix` worked on this codebase (#53896)!
2018-09-13introduce SelfCtorF001-2/+2
2018-08-27Rename hir::map::NodeKind to hir::Nodevarkor-2/+2
2018-08-27Remove path prefixes from NodeKindvarkor-2/+2
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-1/+1
2018-08-22Remove Ty prefix from ↵varkor-12/+12
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-07-28Don't format!() string literalsljedrz-4/+4
2018-07-16ExprKindcsmoe-16/+16
2018-07-11use the adjusted type for cat_pattern in tuple patternsAriel Ben-Yehuda-1/+1
This looks like a typo introduced in #51686. Fixes #52213.
2018-07-01add FIXMEs pleading for post-@ edit of commentary on mem_categorizationZack M. Davis-8/+14
(The present author fears not being knowledgeable enough to rewrite the comments unilaterally; merely calling it out is a lazy half-measure, but at least doesn't actively make things worse the way an ill-informed rewrite would.)
2018-07-01use HirId in middle::mem_categorization::cmt_, and consequences of thatZack M. Davis-44/+43
For the HirIdification initiative #50928.
2018-06-28Auto merge of #51444 - estebank:impl-static, r=nikomatsakisbors-1/+1
Suggestion for 'static impl Trait return When encountering a named or anonymous sup requirement (for example, `&'a self`) and a `'static` impl Trait return type, suggest adding the `'_` lifetime constraing to the return type. Fix #43719, #51282. ``` error: cannot infer an appropriate lifetime --> $DIR/static-return-lifetime-infered.rs:17:16 | LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> { | ----------------------- this return type evaluates to the `'static` lifetime... LL | self.x.iter().map(|a| a.0) | ------ ^^^^ | | | ...but this borrow... | note: ...can't outlive the anonymous lifetime #1 defined on the method body at 16:5 --> $DIR/static-return-lifetime-infered.rs:16:5 | LL | / fn iter_values_anon(&self) -> impl Iterator<Item=u32> { LL | | self.x.iter().map(|a| a.0) LL | | } | |_____^ help: you can add a constraint to the return type to make it last less than `'static` and match the anonymous lifetime #1 defined on the method body at 16:5 | LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
2018-06-23Rename ExprAgain to ExprContinuevarkor-1/+1
2018-06-21use `pat_ty_adjusted` from `expr_use_visitor` to type of argumentsNiko Matsakis-1/+1
2018-06-21rename `pat_ty` to `pat_ty_adjusted` for clarityNiko Matsakis-4/+4
2018-06-08Suggestion for 'static impl Trait returnEsteban Küber-1/+1
When encountering a named or anonymous sup requirement (for example, `&'a self`) and a `'static` impl Trait return type, suggest adding the `'_` lifetime constraing to the return type.
2018-06-01also check `let` arms and nested patterns for mutable borrowsNiko Matsakis-0/+16