about summary refs log tree commit diff
path: root/src/librustc_borrowck
AgeCommit message (Collapse)AuthorLines
2018-09-17Fill in suggestions Applicability according to @estebankVitaly _Vi Shukela-2/+7
Also fix some formatting along the way.
2018-09-17Fix tidy's too long lines.Vitaly _Vi Shukela-10/+10
2018-09-17Fix style according to review comments.Vitaly _Vi Shukela-9/+18
2018-09-16Fixup inaccurate rebaseVitaly _Vi Shukela-1/+1
2018-09-16Remove usages of span_suggestion without ApplicabilityVitaly _Vi Shukela-8/+14
Use Applicability::Unspecified for all of them instead.
2018-09-15Make rustc::middle::region::Scope's fields publicMarshall Bowers-5/+18
2018-09-12use structured suggestion for "missing mut" labelAndy Russell-3/+5
Fixes #54133.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-08-27Rename hir::map::NodeKind to hir::Nodevarkor-13/+13
2018-08-27Remove path prefixes from NodeKindvarkor-9/+11
2018-08-27Remove Node* prefix from AnnNodevarkor-6/+6
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-11/+11
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-5/+5
or "".into()
2018-08-22Auto merge of #53607 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-5/+13
Rollup of 10 pull requests Successful merges: - #53418 (Mark some suggestions as MachineApplicable) - #53431 (Moved some feature gate ui tests to correct location) - #53442 (Update version of rls-data used with save-analysis) - #53504 (Set applicability for more suggestions.) - #53541 (Fix missing impl trait display as ret type) - #53544 (Point at the trait argument when using unboxed closure) - #53558 (Normalize source line and column numbers.) - #53562 (Lament the invincibility of the Turbofish) - #53574 (Suggest direct raw-pointer dereference) - #53585 (Remove super old comment on function that parses items) Failed merges: - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.) - #53563 (use String::new() instead of String::from(""), "".to_string(), "".to_owned() or "".into()) r? @ghost
2018-08-22Rollup merge of #53504 - ekse:suggestions-applicability-2, r=estebankGuillaume Gomez-4/+7
Set applicability for more suggestions. Converts a couple more calls to `span_suggestion_with_applicability` (#50723). To be on the safe side, I marked suggestions that depend on the intent of the user or that are potentially lossy conversions as MaybeIncorrect. r? @estebank
2018-08-22Rollup merge of #53418 - ekse:suggestions-applicability, r=estebankGuillaume Gomez-1/+6
Mark some suggestions as MachineApplicable I think the following suggestions should be safe to mark as `MachineApplicable`. r? @estebank
2018-08-22Remove unnecessary TyKind::svarkor-1/+1
2018-08-22Remove Ty prefix from ↵varkor-8/+8
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-22Rename ty::TyVariants to ty::TyKindvarkor-1/+1
2018-08-20Set applicability for more suggestions.Sébastien Duquette-4/+7
2018-08-19mv codemap() source_map()Donato Sciarra-10/+10
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-4/+4
2018-08-15Mark some suggestions as MachineApplicableSébastien Duquette-1/+6
2018-08-15Suggest match ergonomics, not `ref`/`ref mut`ashtneoi-1/+1
2018-08-15Auto merge of #52928 - Mark-Simulacrum:borrowck-cleanup, r=cramertjbors-76/+709
(old) borrowck cleanup Primarily moves dataflow code based on CFG to borrowck; this is mostly so we don't forget to delete it once it becomes unused after we fully move to MIR borrowck.
2018-08-09Auto merge of #52788 - LukasKalbertodt:improve-index-mut-error, r=estebankbors-0/+23
Add help message for missing `IndexMut` impl Code: ```rust let mut map = HashMap::new(); map.insert("peter", 23); map["peter"] = 27; ``` Before: ``` error[E0594]: cannot assign to immutable indexed content --> src/main.rs:7:5 | 7 | map["peter"] = 27; | ^^^^^^^^^^^^^^^^^ cannot borrow as mutable ``` With this change (just the `help` was added): ``` error[E0594]: cannot assign to immutable indexed content --> index-error.rs:7:5 | 7 | map["peter"] = 27; | ^^^^^^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for std::collections::HashMap<&str, i32> ``` --- Yesterday I did some pair programming with a Rust-beginner. We created a type and implemented `Index` for it. Trying to modify the value returned by the index operation returns in a rather vague error that was not very clear for the Rust beginner. So I tried to improve the situation. ## Notes/questions for reviewers: - Is the formulation OK like that? I'm fine with changing it. - Can we be absolutely sure that `IndexMut` is actually not implemented in the case my `help` message is added? I'm fairly sure myself, but there could be some cases I didn't think of. Also, I don't know the compiler very well, so I don't know what exactly certain enum variants are used for. - It would be nice to test if `IndexMut` is in fact not implemented for the type, but I couldn't figure out how to check that. If you think that additional check would be beneficial, could you tell me how to check if a trait is implemented? - Do you think I should change the error message instead of only adding an additional help message?
2018-08-09librustc_borrowck: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-07Make `IndexMut` note apply to more casesLukas Kalbertodt-22/+22
Previously it was only emitted for assigments, which was an unnecessary restriction. Now it doesn't care where the mutability comes from. This commit also adds `` quotes around the printed type.
2018-08-05Remove unnecessary feature attributes that sneaked invarkor-1/+0
2018-07-31Remove dead codeMark Rousskov-67/+16
2018-07-31Move dataflow to borrowckMark Rousskov-9/+693
No one else uses it.
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-1/+1
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-1/+1
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-28Don't format!() string literalsljedrz-1/+1
2018-07-28Add help message for missing `IndexMut` implLukas Kalbertodt-0/+23
Before this change it simply says "cannot assign to immutable indexed content". This might be confusing for Rust beginners, as implementing two traits for "one operator" is not intuitive.
2018-07-28Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakiskennytm-2/+2
Use a slice where a vector is not necessary
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-1/+0
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27Use slices where a vector is not necessaryljedrz-2/+2
2018-07-27Prefer to_string() to format!()ljedrz-1/+1
2018-07-26Add `-Z borrowck=migrate` flag, use it to link NLL up to AST-borrowck.Felix S. Klock II-1/+1
2018-07-26Add flag indicating whether AST `borrowck` query signalled any error.Felix S. Klock II-4/+36
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-1/+0
2018-07-16TyKindcsmoe-2/+2
2018-07-16ExprKindcsmoe-4/+4
2018-07-13Auto merge of #52352 - kennytm:rollup, r=kennytmbors-0/+1
Rollup of 17 pull requests Successful merges: - #51962 (Provide llvm-strip in llvm-tools component) - #52003 (Implement `Option::replace` in the core library) - #52156 (Update std::ascii::ASCIIExt deprecation notes) - #52280 (llvm-tools-preview: fix build-manifest) - #52290 (Deny bare trait objects in src/librustc_save_analysis) - #52293 (Deny bare trait objects in librustc_typeck) - #52299 (Deny bare trait objects in src/libserialize) - #52300 (Deny bare trait objects in librustc_target and libtest) - #52302 (Deny bare trait objects in the rest of rust) - #52310 (Backport 1.27.1 release notes to master) - #52315 (Resolve FIXME(#27942)) - #52316 (task: remove wrong comments about non-existent LocalWake trait) - #52322 (Update llvm-rebuild-trigger in light of LLVM 7 upgrade) - #52330 (Don't silently ignore invalid data in target spec) - #52333 (CI: Enable core dump on Linux, and print their stack trace on segfault. ) - #52346 (Fix typo in improper_ctypes suggestion) - #52350 (Bump bootstrap compiler to 1.28.0-beta.10) Failed merges: r? @ghost
2018-07-12Factor out suggest_ref_mut; use it in rustc_borrowckashtneoi-8/+5
Also teach rustc_borrowck not to show useless help messages like "use a mutable reference instead: `x`".
2018-07-12span_suggestioncsmoe-2/+3
2018-07-12replace refcsmoe-4/+9