about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-03-24Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`Vadim Petrochenkov-28/+16
2019-03-24Slightly more uniform treatment of struct and variant constructorsVadim Petrochenkov-7/+5
2019-03-24Auto merge of #58305 - scalexm:chalk-continued, r=nikomatsakisbors-34/+159
(WIP) Small fixes in chalkification Small fixes around region constraints and builtin impls. There are still some type inference errors, for example the following code errors out: ```rust fn main() { let mut x: Vec<i32> = Vec::new(); // ^^^^^^^^ cannot infer type for `std::vec::Vec<_>` } ``` but explicitly specifying `Vec::<i32>::new` works. With these few fixes, the following code now passes type-checking: ```rust fn main() { let mut x: Vec<i32> = Vec::<i32>::new(); x.push(5); println!("{:?}", x); } ``` I also fixed the implied bounds bug as discussed on Zulip and in https://github.com/rust-lang-nursery/chalk/pull/206 cc @tmandry r? @nikomatsakis
2019-03-24Remove `VariantDef::parent_did`Vadim Petrochenkov-137/+29
2019-03-24Remove methods is_struct/is_tuple/is_unit from VariantDataVadim Petrochenkov-59/+35
2019-03-24Separate variant id and variant constructor id.David Wood-207/+391
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-24Auto merge of #59199 - estebank:untrack-errors, r=eddybbors-3/+2
Remove `track_errors` from `check_match`, `typeck_item_bodies` and `register_plugins` In the spirit of continuing through errors in type checking (#39275), remove `track_errors` from a couple of locations in the codebase.
2019-03-24code review fixesSaleem Jaffer-7/+4
2019-03-23Auto merge of #59084 - estebank:diagnostic-spans, r=davidtwcobors-0/+13
Tweak some diagnostic spans
2019-03-23Fixes #59361Peter Hall-6/+6
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-1/+3
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-0/+11
2019-03-23Auto merge of #59068 - ljedrz:kill_off_NodeId_stragglers, r=Zoxcbors-23/+8
HirIdification: kill off NodeId stragglers The final stages of HirIdification (#57578). This PR, along with https://github.com/rust-lang/rust/pull/59042, should finalize the HirIdification process (at least the more straightforward bits). - replace `NodeId` with `HirId` in `trait_impls` - remove all `NodeId`s from `borrowck` - remove all `NodeId`s from `typeck` - remove all `NodeId`s from `mir` - remove `trait_auto_impl` (unused) I would be cool to also remove `NodeId` from `hir::def::Def`, `middle::privacy::AccessLevel` and `hir::ItemId`, but I don't know if this is feasible. I'll be happy to do more if I've missed anything.
2019-03-23adding mir::StaticKind enum for static and promotedSaleem Jaffer-26/+34
2019-03-23Auto merge of #59096 - ljedrz:HirIdify_AccessLevel, r=Zoxcbors-7/+6
middle: replace NodeId with HirId in AccessLevels Pushing the limits of HirIdification (#57578). Replaces `NodeId` with `HirId` in `middle::privacy::AccessLevels`. Actually this time I was more successful and cracked it; I probably tried to HirIdify too much at once when I attempted it last time ^^. r? @Zoxc
2019-03-22address review commentsEsteban Küber-3/+2
2019-03-23Auto merge of #58929 - estebank:elide-object, r=zackmdavisbors-11/+29
Elide object safety errors on non-existent trait function Fix #58734. r? @zackmdavis
2019-03-22Rollup merge of #59273 - llogiq:hir-docs, r=matthewjasperMazdak Farrokhzad-1/+12
some small HIR doc improvements
2019-03-22Rollup merge of #59266 - estebank:struct-parse-recovery, r=petrochenkovMazdak Farrokhzad-15/+20
Do not complain about non-existing fields after parse recovery When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it. Fix #57361.
2019-03-22Rollup merge of #59170 - varkor:const-generics-rustdoc, r=QuietMisdreavus,eddybMazdak Farrokhzad-2/+2
Add const generics to rustdoc Split out from #53645. This work is a collaborative effort with @yodaldevoid. The `FIXME`s are waiting on a refactor to `LazyConst`. I'll address these in a follow up, but I thought it would be better to implement the rest now to avoid bitrot. r? @QuietMisdreavus
2019-03-20expand the fixmeNiko Matsakis-1/+4
2019-03-20refactor so that `relate_ty_var` can accommodate vid on a or b sideNiko Matsakis-22/+130
2019-03-20nll_relate/mod.rs: rustfmtNiko Matsakis-25/+27
2019-03-20Fix a bug in chalk unification codescalexm-2/+14
2019-03-20Add eval_always to query macro and move a query overJohn Kåre Alsaker-13/+5
2019-03-20Add anon to query macro and move a query overJohn Kåre Alsaker-26/+16
2019-03-20Add no_force to query macro and move some queries overJohn Kåre Alsaker-54/+26
2019-03-20Add no_hash to query macro and move some queries overJohn Kåre Alsaker-68/+45
2019-03-20remove visit_static from librustc::mirSaleem Jaffer-17/+4
2019-03-20Add a -Z time option which prints only passes which runs onceJohn Kåre Alsaker-15/+19
2019-03-19review commentsEsteban Küber-1/+1
2019-03-19Update src/librustc/hir/mod.rsMazdak Farrokhzad-1/+1
Co-Authored-By: llogiq <bogusandre@gmail.com>
2019-03-18Rename typarams to param_namesvarkor-2/+2
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-03-18cleaner code as per reviewSaleem Jaffer-10/+0
2019-03-18promoted is still left in 2 placesSaleem Jaffer-22/+31
2019-03-18some small HIR doc improvementsAndre Bogus-1/+12
2019-03-18Add load_cached query modifier and keep dep node names consistent with query ↵John Kåre Alsaker-43/+32
names
2019-03-18Define queries using a proc macroJohn Kåre Alsaker-43/+90
2019-03-17Do not complain about non-existing fields after parse recoveryEsteban Küber-15/+20
When failing to parse struct-like enum variants, the ADT gets recorded as having no fields. Record that we have actually recovered during parsing of this variant to avoid complaing about non-existing fields when actually using it.
2019-03-17Auto merge of #58994 - oli-obk:deprecated_derive, r=petrochenkovbors-2/+20
Hide deprecation warnings inside derive expansions Fixes #58822
2019-03-17Make meta-item API compatible with `LocalInternedString::get` soundness fixVadim Petrochenkov-28/+14
2019-03-17Auto merge of #59178 - oli-obk:lazy_const, r=eddybbors-288/+156
Revert the `LazyConst` PR The introduction of `LazyConst` did not actually achieve the code simplicity improvements that were the main reason it was introduced. Especially in the presence of const generics, the differences between the "levels of evaluatedness" of a constant become less clear. As it can be seen by the changes in this PR, further simplifications were possible by folding `LazyConst` back into `ConstValue`. We have been able to keep all the advantages gained during the `LazyConst` refactoring (like `const_eval` not returning an interned value, thus making all the `match` code simpler and more performant). fixes https://github.com/rust-lang/rust/issues/59209 r? @eddyb @varkor
2019-03-16Don't report deprecation lints in derive expansionsOliver Scherer-2/+20
2019-03-16Fix rebaseVadim Petrochenkov-1/+1
2019-03-16Refactor away `NestedMetaItemKind`Vadim Petrochenkov-17/+15
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16Rename `MetaItem::ident` to `MetaItem::path`Vadim Petrochenkov-8/+8
2019-03-16syntax: Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-29/+35
2019-03-16Revert the `LazyConst` PROliver Scherer-288/+156
2019-03-16Rollup merge of #59201 - lambda:remove-repr-simd-isize-usize-restriction, ↵kennytm-1/+0
r=alexcrichton Remove restriction on isize/usize in repr(simd) As discussed in #55078, there's no known reason for this restriction. It's unlikely that repr(simd) will be stabilized in its current form, but might as well remove some restrictions on it. This removes the branch in `is_machine` which returns false for these types. `is_machine` is only used for the repr(simd) type validation check.
2019-03-16Rollup merge of #59169 - tmandry:allow-features-flag, r=cramertjkennytm-0/+19
Add `-Z allow_features=...` flag Adds a compiler option to allow only whitelisted features. For projects on nightly that want to prevent feature-creep (and maybe, someday, move off of nightly). Not being able to enforce this has been a problem on Fuchsia and at other big companies. This doesn't support filtering edition feature flags, but someone is welcome to add that if they need it.