summary refs log tree commit diff
path: root/src/test/ui/span
AgeCommit message (Collapse)AuthorLines
2018-11-17resolve: Avoid sentence breaks in diagnosticsVadim Petrochenkov-1/+1
2018-11-17resolve: More precise determinacy tracking during import/macro resolutionVadim Petrochenkov-6/+6
2018-10-21Auto merge of #55236 - petrochenkov:pfail, r=davidtwcobors-53/+0
Move parse-fail tests to UI cc https://github.com/rust-lang/rust/issues/53353 r? @davidtwco
2018-10-21Use new region infer errors for explaining borrowsMatthew Jasper-6/+3
This gives at least some explanation for why a borrow is expected to last for a certain free region. Also: * Reports E0373: "closure may outlive the current function" with NLL. * Special cases the case of returning a reference to (or value referencing) a local variable or temporary (E0515). * Special case assigning a reference to a local variable in a closure to a captured variable.
2018-10-21Move more parsing tests to ui/parserVadim Petrochenkov-53/+0
2018-10-07Identify borrows captured by trait objects.David Wood-1/+1
This commit enhances `LaterUseKind` detection to identify when a borrow is captured by a trait object which helps explain why there is a borrow error.
2018-10-05Updates to .stderr output in ui tests from earlier changes.Felix S. Klock II-36/+58
2018-10-03Clearer later use messages for callsMatthew Jasper-21/+15
Give a special message when the later use is from a call. Use the span of the callee instead of the whole expression. For conflicting borrow messages say that the later use is of the first borrow.
2018-10-02Auto merge of #54767 - pietroalbini:rollup, r=pietroalbinibors-1/+1
Rollup of 10 pull requests Successful merges: - #54269 (#53840: Consolidate pattern check errors) - #54458 (Allow both explicit and elided lifetimes in the same impl header) - #54603 (Add `crate::` to trait suggestions in Rust 2018.) - #54648 (Update Cargo's submodule) - #54680 (make run-pass tests with empty main just compile-pass tests) - #54687 (Use impl_header_lifetime_elision in libcore) - #54699 (Re-export `getopts` so custom drivers can reference it.) - #54702 (do not promote comparing function pointers) - #54728 (Renumber `proc_macro` tracking issues) - #54745 (make `CStr::from_bytes_with_nul_unchecked()` a const fn) Failed merges: r? @ghost
2018-10-01Extra proc macro gates are now at #54727Alex Crichton-1/+1
2018-09-28Test fixes for the change of error message for issue #54015Rusty Blitzerr-5/+5
2018-09-25Update E0714 to E0716 in tests outputMikhail Modin-14/+14
2018-09-25add "temporary value dropped while borrowed" errorMikhail Modin-22/+22
Issue #54131
2018-09-23Update tests for changes to drop accessMatthew Jasper-6/+20
2018-09-23Remove irrelevant message about drop orderMatthew Jasper-3/+0
When dropping a self-borrowing struct we shouldn't add a "values in a scope are dropped in the opposite order they are defined" message, since there is only one value being dropped.
2018-09-23Auto merge of #54310 - pnkfelix:issue-52059-report-borrow-drop-conflict, ↵bors-10/+11
r=nikomatsakis Report when borrow could cause `&mut` aliasing during Drop We were already issuing an error for the cases where this cropped up, so this is not fixing any soundness holes. The previous diagnostic just wasn't accurately describing the problem in the user's code. Fix #52059
2018-09-18Update NLL 3-point error message for fake reads in optimized let patternsRemy Rakic-21/+21
2018-09-18Updates to tests reflecting the diangostic changes in previous commit.Felix S. Klock II-10/+11
It is worth pointing out that the reason that so few diagnostics are effected is because of the filter I put in where it only goes down the new path if the borrowed place is *not* a prefix of the dropped place. (Without that filter, a *lot* of the tests would need this change, and it would probably be a net loss for the UX, since you'd see it even in cases like borrows of generic types where there is no explicit mention of `Drop`.)
2018-09-16Auto merge of #54157 - euclio:structured-suggestion, r=estebankbors-7/+7
use structured suggestion for "missing mut" label Fixes #54133 for both NLL and non-NLL. r? @estebank I'm not super happy with the existing wording here, since it's now a suggestion. I wonder if the message would work better as something like "help: make binding mutable: `mut foo`"? Also, are the `HELP` and `SUGGESTION` comments necessary?
2018-09-14Auto merge of #54088 - matthewjasper:use-reason-in-dlle-errors, r=pnkfelixbors-0/+13
[NLL] Suggest let binding Closes #49821 Also adds an alternative to `explain_why_borrow_contains_point` that allows changing error messages based on the reason that will be given. This will also be useful for #51026, #51169 and maybe further changes to does not live long enough messages.
2018-09-12use structured suggestion for "missing mut" labelAndy Russell-7/+7
Fixes #54133.
2018-09-10Feature gate non-builtin attributes in inner attribute positionVadim Petrochenkov-3/+14
2018-09-09Suggest a let binding to extend temporary lifetimes with NLLMatthew Jasper-0/+13
2018-08-28Auto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakisbors-11/+6
Use smaller span for adjustments on block expressions When returning a mutable reference don't use the entire body of the function as the span for the adjustments at the end. The error [in this case](https://github.com/rust-lang/rust/compare/master...matthewjasper:hair-spans?expand=1#diff-ecef8b1f15622fb48a803c9b61605c78) is worse, but neither error message is really what we want. I have some ideas on how to get a better error message that will have to wait for a future PR.
2018-08-27Also use smaller spans for unsize adjustmentsMatthew Jasper-11/+6
2018-08-20resolve: Consolidate error reporting for resolved macros in `fn ↵Vadim Petrochenkov-4/+4
resolve_macro_to_def`
2018-08-14Label definition of captured variables in errors.David Wood-0/+3
2018-08-06Auto merge of #52332 - ↵bors-6/+6
zackmdavis:dead_code_lint_should_say_2_electric_boogaloo, r=pnkfelix dead-code lint: say "constructed" for structs Respectively. This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been reported (more than once—at least #19140, #44083, and #44565) that the "never used" language was confusing for enum variants that were "used" as match patterns, so the wording was changed to say never "constructed" specifically for enum variants. More recently, the same issue was raised for structs (#52325). It seems consistent to say "constructed" here, too, for the same reasons. ~~While we're here, we can also use more specific word "called" for unused functions and methods. (We declined to do this in #46103, but the rationale given in the commit message doesn't actually make sense.)~~ This resolves #52325.
2018-08-03Update tests for new spans for nll errors involving closuresMatthew Jasper-24/+22
2018-08-03Auto merge of #52948 - davidtwco:issue-52633-later-loop-iteration, r=pnkfelixbors-5/+5
NLL: Better Diagnostic When "Later" means "A Future Loop Iteration" Part of #52663. r? @pnkfelix
2018-08-01minor fallout from the change.Felix S. Klock II-2/+0
(Presumably the place that borrow_check ends up reporting for the error about is no longer the root `Local` itself, and thus the note diagnostic here stops firing.)
2018-08-01Errors are more specific in cases where borrows are used in future ↵David Wood-5/+5
iterations of loops.
2018-08-01Rollup merge of #52904 - pnkfelix:issue-51167-sort-by-span, r=petrochenkovPietro Albini-55/+55
NLL: sort diagnostics by span Sorting the output diagnostics by span is a long planned revision to the NLL diagnostics that we hope will yield a less surprising user experience in some case. Once we got them buffered, it was trivial to implement. (The hard part is skimming the resulting changes to the diagnostics to make sure nothing broke... Note that I largely rubber-stamped the `#[rustc_regions]` output change.) Fix #51167
2018-07-31Update the `.nll.stderr` files under new sorted-by-span scheme.Felix S. Klock II-55/+55
2018-07-30Include lifetime in mutability suggestion in NLL messagesEsteban Küber-5/+5
2018-07-26Use better spans for dummy accesses used in matchesMatthew Jasper-5/+5
2018-07-26Rollup merge of #52617 - matthewjasper:remove-unused-code, r=nikomatsakisMark Rousskov-51/+51
Don't match on region kinds when reporting NLL errors First half (by number of tests affected) of the changes to "does not live long enough". Now that lexical MIR borrowck is gone, region kinds are always ReVar, so matching on them to change errors does nothing. Changes "borrowed value only lives until here" to "`x` is dropped here while still borrowed". r? @pnkfelix cc @nikomatsakis
2018-07-24Rollup merge of #52605 - estebank:str-plus-eq, r=oli-obkkennytm-6/+2
Do not suggest using `to_owned()` on `&str += &str` - Don't provide incorrect suggestion for `&str += &str` (fix #52410) - On `&str + String` suggest `&str.to_owned() + &String` as a single suggestion
2018-07-23Don't match on region kinds when reporting NLL errorsMatthew Jasper-51/+51
With NLL region kinds are always ReVar
2018-07-23Match errors using the callsite of macro expansionsFederico Poli-2/+5
2018-07-22Rollup merge of #52507 - estebank:infer-type, r=nikomatsakiskennytm-3/+3
Reword when `_` couldn't be inferred r? @nikomatsakis
2018-07-21Do not suggest using `to_owned()` on `&str += &str`Esteban Küber-6/+2
2018-07-21dead-code lint: say "constructed" for structsZack M. Davis-6/+6
This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been reported (more than once—at least #19140, #44083, and #44565) that the "never used" language was confusing for enum variants that were "used" as match patterns, so the wording was changed to say never "constructed" specifically for enum variants. More recently, the same issue was raised for structs (#52325). It seems consistent to say "constructed" here, too, for the same reasons. We considered using more specific word "called" for unused functions and methods (while we declined to do this in #46103, the rationale given in the commit message doesn't actually make sense), but it turns out that Cargo's test suite expects the "never used" message, and maybe we don't care enough even to make a Cargo PR over such a petty and subjective wording change. This resolves #52325.
2018-07-21Add specific message when moving from upvars in a non-FnOnce closureMatthew Jasper-2/+2
2018-07-20Update tests for new NLL mutability errorsMatthew Jasper-21/+21
2018-07-20Reword when `_` couldn't be inferredEsteban Küber-3/+3
2018-07-06Rollup merge of #52067 - csmoe:issue-51167, r=nikomatsakisMark Rousskov-28/+28
Visit the mir basic blocks in reverse-postfix order cc #51167 r? @nikomatsakis
2018-07-05update testcsmoe-28/+28
2018-07-01Make causal tracking lazySantiago Pastorino-22/+6
2018-06-23add `dyn` to display of dynamic (trait) type namesZack M. Davis-1/+1
The `dyn Trait` syntax was stabilized in 199ee327. Resolves #49277.