Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use structured suggestion for "missing mut" label #54157

Merged
merged 1 commit into from
Sep 16, 2018

Conversation

euclio
Copy link
Contributor

@euclio euclio commented Sep 12, 2018

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?

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 12, 2018
Copy link
Contributor

@estebank estebank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, are the HELP and SUGGESTION comments necessary?

They are. Test files' annotation with ERROR is always mandatory, and if there are any NOTE/HELP annotation, all of them need to be added. These comments are a way of making sure that the important messages being tested are looked at, while the stderr files let us see and catch any visual regressions that wouldn't be noticed if we only looked at the raw text.


r=me with the nits resolved

let_span,
format!("consider changing this to `mut {}`", snippet),
"consider changing this to",
format!("mut {}", snippet),
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super happy with the existing wording here, since it's now a suggestion.

What about "make this binding mutable":

LL |     let x: isize;
   |         - help: make this binding mutable: `mut x`
LL |     x = 1;
   |     ----- first assignment to `x`

@@ -1299,9 +1299,10 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
snippet
);
} else {
db.span_label(
db.span_suggestion(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use span_suggestion_with_applicability and Applicability::MachineApplicable, so that rustfix and VScode can apply this automagically.

decl.source_info.span,
format!("consider changing this to `mut {}`", name),
"consider changing this to",
format!("mut {}", name),
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use span_suggestion_with_applicability and Applicability::MachineApplicable, so that rustfix and VScode can apply this automagically.

@estebank estebank added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 12, 2018
@euclio euclio force-pushed the structured-suggestion branch from c173cdb to d871b8a Compare September 12, 2018 21:17
@euclio
Copy link
Contributor Author

euclio commented Sep 12, 2018

Addressed nits.

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Sep 12, 2018

📌 Commit d871b8a has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 12, 2018
@bors
Copy link
Contributor

bors commented Sep 15, 2018

⌛ Testing commit d871b8a with merge b7f9284df0619182adfbb9d855232c730d64db17...

@bors
Copy link
Contributor

bors commented Sep 15, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 15, 2018
@rust-highfive
Copy link
Collaborator

The job dist-mipsel-linux of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:003a82ef:start=1536993300124009086,finish=1536993300128852153,duration=4843067
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:205d1120
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:049c7555
travis_time:start:049c7555
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0322e954
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@kennytm
Copy link
Member

kennytm commented Sep 15, 2018

@bors retry travis-ci/travis-ci#9696

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 15, 2018
@bors
Copy link
Contributor

bors commented Sep 16, 2018

⌛ Testing commit d871b8a with merge 32dc5a0...

bors added a commit that referenced this pull request Sep 16, 2018
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?
@bors
Copy link
Contributor

bors commented Sep 16, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: estebank
Pushing 32dc5a0 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants