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

Contexually dependent error message for E0424 when value is assigned to "self" #56572

Merged
merged 1 commit into from
Dec 14, 2018
Merged

Contexually dependent error message for E0424 when value is assigned to "self" #56572

merged 1 commit into from
Dec 14, 2018

Conversation

kevgrasso
Copy link
Contributor

This is an improvement for pull request #54495 referencing issue #54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report:

let self = "self";
    ^^^^ `self` value is a keyword and may not be bound to variables or shadowed

instead of

let self = "self";
    ^^^^ `self` value is a keyword only available in methods with `self` parameter

If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 6, 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.

Fix indentation of the new code.

It seems like you might have had some rebasing issues. Can you rebase your changes as a single commit against latest master?

After fixing that, r=me.

@estebank estebank assigned estebank and unassigned nikomatsakis Dec 7, 2018
@estebank
Copy link
Contributor

estebank commented Dec 7, 2018

r? @estebank

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 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:17d98bb9:start=1544317390948378159,finish=1544317445314993435,duration=54366615276
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---

[00:03:09] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3199: trailing whitespace
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3205: trailing whitespace
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3206: line longer than 100 chars
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3207: line longer than 100 chars
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3208: line longer than 100 chars
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3209: line longer than 100 chars
[00:03:09] tidy error: /checkout/src/librustc_resolve/lib.rs:3210: trailing whitespace
[00:03:11] some tidy checks failed
[00:03:11] 
[00:03:11] 
[00:03:11] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:11] 
[00:03:11] 
[00:03:11] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:11] Build completed unsuccessfully in 0:00:53
[00:03:11] Build completed unsuccessfully in 0:00:53
[00:03:11] make: *** [tidy] Error 1
[00:03:11] Makefile:79: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1035f456
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Dec  9 01:07:25 UTC 2018
---
travis_time:end:181121f4:start=1544317645780872921,finish=1544317645785414302,duration=4541381
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:1c873459
$ 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 --batch -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:178c3167
travis_time:start:178c3167
$ 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:00257db2
$ 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)

@estebank
Copy link
Contributor

Hi @kevgrasso! You still seem to have so clean up your commit history.

@kevgrasso
Copy link
Contributor Author

r= @estebank

I think I got it done. My teachers didn't know how do this so I had some trouble figuring it out.

@estebank
Copy link
Contributor

estebank commented Dec 10, 2018

I think you still might have to remove three commits (adbf5dc, 51fd050 and 209e625). You can do that by doing git rebase -I HEAD^^^^ (interactive rebase 4 commits back) and then on the editor that will open remove those three and only leave yours (it should be the last one). After doing that you can (but don't need to) do git checkout master && git pull (get the latest changes from rust in your master branch) git checkout let_self_err_dev (get back on your branch) and finally git rebase master (replay the changes in your local branch on top of master).

Also, https://git-scm.com/book/en/v2/Git-Branching-Rebasing and https://sethrobertson.github.io/GitFixUm/fixup.html are good resources (even though a bit more convoluted than I'd like).

Also, thank you for your patience, git wrangling can be very difficult at times.

@kevgrasso
Copy link
Contributor Author

r= @estebank
Okay I'm pretty sure this is good now. Thank you for the help.

@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 11, 2018

📌 Commit 5586c04 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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 11, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 11, 2018
Contexually dependent error message for E0424 when value is assigned to "self"

This is an improvement for pull request rust-lang#54495 referencing issue rust-lang#54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report:
```
let self = "self";
    ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
```
instead of
```
let self = "self";
    ^^^^ `self` value is a keyword only available in methods with `self` parameter
```
If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
kennytm added a commit to kennytm/rust that referenced this pull request Dec 12, 2018
Contexually dependent error message for E0424 when value is assigned to "self"

This is an improvement for pull request rust-lang#54495 referencing issue rust-lang#54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report:
```
let self = "self";
    ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
```
instead of
```
let self = "self";
    ^^^^ `self` value is a keyword only available in methods with `self` parameter
```
If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 12, 2018
Contexually dependent error message for E0424 when value is assigned to "self"

This is an improvement for pull request rust-lang#54495 referencing issue rust-lang#54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report:
```
let self = "self";
    ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
```
instead of
```
let self = "self";
    ^^^^ `self` value is a keyword only available in methods with `self` parameter
```
If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
@pietroalbini
Copy link
Member

@bors r-

Please remove the clippy submodule update.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 13, 2018
@pietroalbini
Copy link
Member

@bors rollup-

@kevgrasso
Copy link
Contributor Author

Whoops, sorry about that. I dunno how that got in there. I think that's fixed now.

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Dec 14, 2018

📌 Commit 9de6bee 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 Dec 14, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Dec 14, 2018
Contexually dependent error message for E0424 when value is assigned to "self"

This is an improvement for pull request rust-lang#54495 referencing issue rust-lang#54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report:
```
let self = "self";
    ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
```
instead of
```
let self = "self";
    ^^^^ `self` value is a keyword only available in methods with `self` parameter
```
If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
@bors
Copy link
Contributor

bors commented Dec 14, 2018

⌛ Testing commit 9de6bee with merge 96d1334...

bors added a commit that referenced this pull request Dec 14, 2018
Contexually dependent error message for E0424 when value is assigned to "self"

This is an improvement for pull request #54495 referencing issue #54369. If the "self" keyword is assigned a value as though it were a valid identifier, it will now report:
```
let self = "self";
    ^^^^ `self` value is a keyword and may not be bound to variables or shadowed
```
instead of
```
let self = "self";
    ^^^^ `self` value is a keyword only available in methods with `self` parameter
```
If anyone has a better idea for what the error should be I'd be happy to modify it appropriately.
@bors
Copy link
Contributor

bors commented Dec 14, 2018

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

@bors bors merged commit 9de6bee into rust-lang:master Dec 14, 2018
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.

None yet

6 participants