about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-03-25Auto merge of #59240 - euclio:struct-field-span, r=oli-obkbors-15/+15
use the identifier span for missing struct field
2019-03-25compiletest: make path normalization smarterAndy Russell-154/+247
2019-03-24Deduplicate code for path suggestionEsteban Küber-64/+43
2019-03-24Provide suggestion when using field access instead of pathEsteban Küber-0/+32
When trying to access an associated constant as if it were a field of an instance, provide a suggestion for the correct syntax.
2019-03-24doc: use correct body font URLsNikhil Benesch-3/+3
The CSS for the docs homepage (docs.rust-lang.org) was using the wrong URL for the body font, resulting in the fallback serif font being used, instead of the desired Source Serif Pro fonts.
2019-03-25Auto merge of #59195 - estebank:for-loop-move, r=petrochenkovbors-1/+74
When moving out of a for loop head, suggest borrowing it When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ``` Fix #25534.
2019-03-24Auto merge of #59382 - davidtwco:rfc-2008-refactoring, r=petrochenkovbors-780/+859
Separate `DefId`s for variants and their constructors Part of #44109. Split off from #59376. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov
2019-03-24Add nll testEsteban Küber-0/+24
2019-03-24When moving out of a for loop head, suggest borrowing itEsteban Küber-1/+50
When encountering code like the following, suggest borrowing the for loop head to avoid moving it into the for loop pattern: ``` fn main() { let a = vec![1, 2, 3]; for i in &a { for j in a { println!("{} * {} = {}", i, j, i * j); } } } ```
2019-03-24Re-order fields in `Def::Ctor`.David Wood-39/+38
This commit moves the `DefId` field of `Def::Ctor` to be the first field.
2019-03-24Move `CtorOf` into `hir::def`.David Wood-56/+55
This commit moves the definition of `CtorOf` from `rustc::hir` to `rustc::hir::def` and adds imports wherever it is used.
2019-03-24Auto merge of #59397 - kennytm:rollup, r=kennytmbors-74/+233
Rollup of 7 pull requests Successful merges: - #59213 (Track changes to robots.txt) - #59239 (Remove inline assembly from hint::spin_loop) - #59251 (Use a valid name for graphviz graphs) - #59296 (Do not encode gensymed imports in metadata) - #59328 (Implement specialized nth_back() for Box and Windows.) - #59355 (Fix ICE with const generic param in struct) - #59377 (Correct minimum system LLVM version in tests)
2019-03-24Remove `CtorOf` from `Node::Ctor`.David Wood-48/+61
This commit removes `CtorOf` from `Node::Ctor` as the parent of the constructor can be determined by looking at the node's parent in the few places where knowing this is necessary.
2019-03-24bootstrap: build compiler-builtins with -Z emit-stack-sizesJorge Aparicio-0/+24
2019-03-24make asm diagnostic instruction optionalAndy Russell-2/+29
`DiagnosticInfoInlineAsm::getInstruction` may return a null pointer, so the instruction shouldn't be blindly unwrapped.
2019-03-24Add a way to track Rustfix UI test coveragePhilipp Hansch-1/+66
This came out of the first Rustfix WG meeting. One of the goals is to enable Rustfix tests for all UI tests that trigger lints with `MachineApplicable` suggestions. In order to do that we first want to create a tracking issue that lists all files with missing `// run-rustfix` headers. This PR adds a `--rustfix-coverage` flag to `./x.py` and compiletest to list the files with the missing headers in `/tmp/rustfix_missing_coverage.txt`. From that file we can create the tracking issue and at some point also enforce the `// run-rustfix` flag on UI tests with `MachineApplicable` lints.
2019-03-24Revert changes to creation of fictive constructors for struct variantsVadim Petrochenkov-62/+29
2019-03-24replace redundant note in deprecation warningAndy Russell-6/+72
2019-03-24Merge `DefPathData::VariantCtor` and `DefPathData::StructCtor`Vadim Petrochenkov-38/+26
2019-03-24Rollup merge of #59377 - smaeul:patch/system-llvm, r=nikickennytm-15/+17
Correct minimum system LLVM version in tests Since commit 9452a8dfa3ba, the new debug info format is only generated for LLVM 8 and newer versions. However, the tests still assume that LLVM 7 will use the new debug info format. Fix the tests (and a comment in the code) to match the actual version check.
2019-03-24Slightly more uniform treatment of struct and variant constructorsVadim Petrochenkov-18/+14
2019-03-24Auto merge of #58305 - scalexm:chalk-continued, r=nikomatsakisbors-696/+946
(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-202/+72
2019-03-24Rollup merge of #59355 - varkor:const-param-struct-ice, r=petrochenkovkennytm-9/+37
Fix ICE with const generic param in struct Fixes https://github.com/rust-lang/rust/issues/59340. r? @petrochenkov
2019-03-24Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcmkennytm-0/+30
Implement specialized nth_back() for Box and Windows. Hi there, this is my first pull request to rust :-) I started implementing some specializations for DoubleEndedIterator::nth_back() and these are the first two. The problem has been discussed in #54054 and nth_back() is tracked in #56995. I'm stuck with the next implementation so I though I do a PR for the ones I'm confident with to get some feedback.
2019-03-24Rollup merge of #59296 - petrochenkov:stdup, r=estebankkennytm-4/+20
Do not encode gensymed imports in metadata (Unless they are underscore `_` imports which are re-gensymed on crate loading, see https://github.com/rust-lang/rust/pull/56392.) We cannot encode gensymed imports properly in metadata and if we encode them improperly, we can get erroneous name conflicts downstream. Gensymed imports are produced by the compiler, so we control their set, and can be sure that none of them needs being encoded for use from other crates. A workaround that fixes https://github.com/rust-lang/rust/issues/59243.
2019-03-24Rollup merge of #59251 - matthewjasper:fix-graphviz, r=petrochenkovkennytm-40/+85
Use a valid name for graphviz graphs Hiridification has broken graphviz output because `HirId` has a more complex display implemetation than `NodeId`. Since the id was just used to generate a distinct identifier, we just pull out the various constituent indexed.
2019-03-24Remove methods is_struct/is_tuple/is_unit from VariantDataVadim Petrochenkov-181/+130
2019-03-24Separate variant id and variant constructor id.David Wood-520/+818
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-24Rollup merge of #59239 - gnzlbg:fix_spin_loop, r=nagisakennytm-6/+25
Remove inline assembly from hint::spin_loop This PR removes the inline assembly which was not required since these instructions are available in core::arch, and extends support of the spin_loop hint to arm targets with the v6 feature which also support the yield instruction.
2019-03-24Rollup merge of #59213 - kornelski:robots, r=Mark-Simulacrumkennytm-0/+19
Track changes to robots.txt Currently `robots.txt` of doc.rust-lang.org is not part of any repo, so there's [no way to contribute any changes to it](https://internals.rust-lang.org/t/deadlock-about-fixing-outdated-documentation-links-in-search-engines/9374), such as needed for #44894 and countless dupes of this issue. I propose adding it to this repo. I'm not in control of the infrastructure, so I can't help to automate deployment of it, but even just having the file under source control is IMHO a step forward.
2019-03-24Auto merge of #59199 - estebank:untrack-errors, r=eddybbors-50/+45
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-115/+81
2019-03-23Make `ptr::eq` documentation mention smart-pointer behaviorChris Gregory-0/+4
Resolves #59214
2019-03-23Auto merge of #59084 - estebank:diagnostic-spans, r=davidtwcobors-546/+496
Tweak some diagnostic spans
2019-03-23Fix span after rebaseEsteban Küber-10/+5
2019-03-23Fixes #59361Peter Hall-6/+6
2019-03-23Fix rebaseEsteban Küber-1/+1
2019-03-23Mark duplicate import removal suggestion tool onlyEsteban Küber-11/+1
2019-03-23Deduplicate const eval error spans for better outputEsteban Küber-29/+15
2019-03-23Hide obvious suggestion from cli outputEsteban Küber-22/+10
2019-03-23Tweak unnecessary import suggestionEsteban Küber-45/+25
2019-03-23Tweak unsupported negative trait bounds messageEsteban Küber-38/+55
2019-03-23Swap primary/secondary spans for E0458Esteban Küber-6/+7
2019-03-23Swap const evaluation lint spans to point at problem in primary spanEsteban Küber-304/+358
2019-03-23Tweak spans for E0599Esteban Küber-133/+72
2019-03-23Auto merge of #59068 - ljedrz:kill_off_NodeId_stragglers, r=Zoxcbors-75/+43
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-166/+238
2019-03-23syntax: Remove warning for unnecessary path disambiguatorsVadim Petrochenkov-79/+20
2019-03-23Add testGuillaume Gomez-27/+25