about summary refs log tree commit diff
path: root/src/test/ui/union
AgeCommit message (Collapse)AuthorLines
2019-04-22update tests for migrate mode by defaultMatthew Jasper-111/+44
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-5/+5
2019-03-11Update NLL testsVadim Petrochenkov-6/+6
2019-03-11Update testsVadim Petrochenkov-49/+49
2019-01-24Fix --compare-mode=nll testsEsteban Küber-6/+6
2019-01-13Rollup merge of #57102 - davidtwco:issue-57100, r=nikomatsakisMazdak Farrokhzad-10/+16
NLL: Add union justifications to conflicting borrows. Fixes #57100. This PR adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``. r? @pnkfelix
2019-01-06Auto merge of #57291 - euclio:method-call-suggestion, r=estebankbors-4/+3
use structured suggestion for method calls Furthermore, don't suggest calling the method if it is part of a place expression, as this is invalid syntax. I'm thinking it might be worth putting a label on the method assignment span like "this is a method" and removing the span from the "methods are immutable" text so it isn't reported twice. The suggestions in `src/test/ui/did_you_mean/issue-40396.stderr` are suboptimal. I could check if the containing expression is `BinOp`, but I'm not sure if that's general enough. Any ideas? r? @estebank
2019-01-04Improve diagnostic labels and add note.David Wood-4/+10
This commit improves diagnostic labels to mention which field a borrow overlaps with and adds a note explaining that the fields overlap.
2019-01-03use structured suggestion for method callsAndy Russell-4/+3
Furthermore, don't suggest calling the method if it is part of a place expression, as this is invalid syntax.
2019-01-01Fix broken links to second edition TRPL.Corey Farwell-5/+5
Fixes https://github.com/rust-lang/rust/issues/57104.
2018-12-31use structured suggestions for nonexistent fieldsAndy Russell-5/+9
2018-12-26Add union justifications to conflicting borrows.David Wood-9/+9
This commit adds justifications to error messages for conflicting borrows of union fields. Where previously an error message would say ``cannot borrow `u.b` as mutable..``, it now says ``cannot borrow `u` (via `u.b`) as mutable..``.
2018-12-25Remove licensesMark Rousskov-260/+70
2018-11-04Update test to force error under NLL.David Wood-26/+65
In each of the three cases in this test, there is a mutable borrow of some field of the union and then a shared borrow of some other field immediately following. Under NLL, the mutable borrow is killed straight away as it isn't used later - therefore not causing a conflict with the shared borrow. This commit adds a use of the first mutable borrow to force the intended errors to appear under NLL.
2018-10-16updates to expected output for other ui tests.Felix S. Klock II-3/+3
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+767
2018-08-10Rollup merge of #53082 - felixrabe:fix-doc-link-again, r=GuillaumeGomezkennytm-3/+3
Fix doc link (again) Similar to #52404. The link for comparison: - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken) - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed) - https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed) - https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed) This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX): rg -l dynamically-sized-types-and-sized and then replacing all relevant occurrences via: find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \ s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm (Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux (GNU sed) as well, but not tested.)
2018-08-07Place unions, pointer casts and pointer derefs behind extra feature gatesOliver Schneider-0/+1
2018-08-05Fix doc link (again)Felix Rabe-3/+3
Similar to #52404. The link for comparison: - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (broken) - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, stable 2nd ed) - https://doc.rust-lang.org/nightly/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2nd ed) - https://doc.rust-lang.org/nightly/book/2018-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait (correct, nightly 2018 ed) This commit is the result of (first) searching via ripgrep (0.8.1 -SIMD -AVX): rg -l dynamically-sized-types-and-sized and then replacing all relevant occurrences via: find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \ s/dynamically-sized-types-and-sized/dynamically-sized-types-and-the-sized-trait/g find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm (Note: Tested on on macOS 10.13 (BSD). `sed -i.bak` should work on Linux (GNU sed) as well, but not tested.)
2018-07-17Fix doc linkFelix Rabe-3/+3
The link for comparison: - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken) - https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed) This commit is the result of (first) searching via: find src -type f -print0 | xargs -0 fgrep -l dynamically-sized-types--sized and then replacing all relevant occurrences via: find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \ s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm (Note: Commands run on macOS 10.13 (BSD). `sed -i.bak` should work on GNU/Linux as well, but not tested.)
2018-07-10Fix typo in error message E0277Rémy Rakic-6/+6
2018-06-19Update message for `!Sized` typesEsteban Küber-9/+9
2018-06-19Add link to book for `Sized` errorsEsteban Küber-0/+3
2018-06-19Add message to `rustc_on_unimplemented` attributes in coreEsteban Küber-11/+14
2018-05-16Remove empty filesJane Lusby-0/+0
2018-05-10Fix tuple struct field spansEsteban Küber-1/+1
2018-04-13Rename must-compile-successfully into compile-passGuillaume Gomez-1/+1
2018-03-19Reduce diagnostic verbosity by removing labelsEsteban Küber-1/+1
2018-03-14update testsGuillaume Gomez-6/+6
2018-03-08Regenerate testsOliver Schneider-17/+0
2018-03-08Produce instead of pointersOliver Schneider-5/+4
2018-02-26Fix rebaseVadim Petrochenkov-2/+2
2018-02-26Update UI testsVadim Petrochenkov-25/+25
2018-02-26Auto merge of #48337 - GuillaumeGomez:rustc-explain, r=estebankbors-0/+7
Rustc explain Fixes #48041. To make the review easier, I separated tests update to code update. Also, I used this script to generate new ui tests stderr: ```python from os import listdir from os.path import isdir, isfile, join PATH = "src/test/ui" def do_something(path): files = [join(path, f) for f in listdir(path)] for f in files: if isdir(f): do_something(f) continue if not isfile(f) or not f.endswith(".stderr"): continue x = open(f, "r") content = x.read().strip() if "error[E" not in content: continue errors = dict() for y in content.splitlines(): if y.startswith("error[E"): errors[y[6:11]] = True errors = sorted(errors.keys()) if len(errors) < 1: print("weird... {}".format(f)) continue if len(errors) > 1: content += "\n\nYou've got a few errors: {}".format(", ".join(errors)) content += "\nIf you want more information on an error, try using \"rustc --explain {}\"".format(errors[0]) else: content += "\n\nIf you want more information on this error, try using \"rustc --explain {}\"".format(errors[0]) content += "\n" x = open(f, "w") x.write(content) do_something(PATH) ```
2018-02-25Update ui testsGuillaume Gomez-0/+7
2018-02-19Update tests.Jeffrey Seyfried-2/+2
2017-12-14Fix rebaseVadim Petrochenkov-0/+8
Update docs for custom normalization of test output
2017-12-14Remove NOTE/HELP annotations from UI testsVadim Petrochenkov-29/+22
2017-12-14Move compile-fail tests with NOTE/HELP annotations to UIVadim Petrochenkov-0/+374