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

Rollup of 14 pull requests #63318

Closed
wants to merge 35 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Aug 6, 2019

Successful merges:

Failed merges:

r? @ghost

timvermeulen and others added 30 commits July 9, 2019 23:38
…dation step

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
…ebank"

This reverts commit df21a6f, reversing
changes made to cc16d04.
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-Authored-By: Aleksey Kladov <aleksey.kladov@gmail.com>
This is just needless indirection.
This is one of the behaviors we no longer allow in NLL. Since it can
lead to undefined behavior, I think it's definitely worth making it a
hard error without waiting to turn off migration mode (rust-lang#58781).

Closes rust-lang#60450.

My ulterior motive here is making it impossible to leave variables
partially initialized across a yield (see discussion at rust-lang#63035), so
tests are included for that.
Also, the move was done nearly a year ago
…scottmcm

Implement DoubleEndedIterator for iter::{StepBy, Peekable, Take}

Now that `DoubleEndedIterator::nth_back` has landed, `StepBy` and `Take` can have an efficient `DoubleEndedIterator` implementation. I don't know if there was any particular reason for `Peekable` not having a `DoubleEndedIterator` implementation, but it's quite trivial and I don't see any drawbacks to having it.

I'm not very happy about the implementation of `Peekable::try_rfold`, but I didn't see another way to only take the value out of `self.peeked` in case `self.iter.try_rfold` didn't exit early.

I only added `Peekable::rfold` (in addition to `try_rfold`) because its `Iterator` implementation has both `fold` and `try_fold` (and for similar reasons I added `Take::try_rfold` but not `Take::rfold`). Do we have any guidelines on whether we want both? If we do want both, maybe we should investigate which iterator adaptors override `try_fold` but not `fold` and add the missing implementations. At the moment I think that it's better to always have iterator adaptors implement both, because some iterators have a simpler `fold` implementation than their `try_fold` implementation.

The tests that I added may not be sufficient because they're all just existing tests where `next`/`nth`/`fold`/`try_fold` are replaced by their DEI counterparts, but I do think all paths are covered. Is there anything in particular that I should probably also test?
Remove special code-path for handing unknown tokens

In `StringReader`, we have a buffer of fatal errors, which is used only in a single case: when we see something which is not a reasonable token at all, like `🦀`. I think a more straightforward thing to do here is to produce an explicit error token in this case, and let the next layer (the parser), deal with it.

However currently this leads to duplicated error messages. What should we do with this? Naively, I would think that emitting (just emitting, not raising) `FatalError` should stop other errors, but looks like this is not the case? We can also probably tweak parser on the case-by-case basis, to avoid emitting "expected" errors if the current token is an `Err`. I personally also fine with cascading errors in this case: it's quite unlikely that you actually type a fully invalid token.

@petrochenkov, which approach should we take to fight cascading errors?
Explaining the reason why validation is performed in to_str of path.rs

I thought it's good to explain the reason for the validation during the conversion between Path/PathBuffer into str, which explains the reason for returning an Option at this point (good for beginners who are reading through the docs).
…ized, r=Centril

Make use of possibly uninitialized data [E0381] a hard error

This is one of the behaviors we no longer allow in NLL. Since it can
lead to undefined behavior, I think it's definitely worth making it a
hard error without waiting to turn off migration mode (rust-lang#58781).

Closes rust-lang#60450.

My ulterior motive here is making it impossible to leave variables
partially initialized across a yield (see rust-lang#60889, discussion at rust-lang#63035), so
tests are included for that.

cc rust-lang#54987

---

I'm not sure if bypassing the buffer is a good way of doing this. We could also make a `force_errors_buffer` or similar that gets recombined with all the errors as they are emitted. But this is simpler and seems fine to me.

r? @Centril
cc @cramertj @nikomatsakis @pnkfelix @RalfJung
diagnostics: Describe crate root modules in `DefKind::Mod` as "crate"

Or we can use "extern crate" like resolve previously did sometimes, not sure.

r? @davidtwco
fix UB in a test

We used to compare two mutable references that were supposed to point to the same thing. That's no good.

Compare them as raw pointers instead.
…rors, r=estebank

Revert "Rollup merge of rust-lang#62696 - chocol4te:fix_#62194, r=estebank"

This reverts commit df21a6f (rust-lang#62696), reversing
changes made to cc16d04.

That PR makes error messages worse than before, and we couldn't come up with a way of actually making them better, so revert it for now. Any idea for making this error message better is welcome!

Fixes rust-lang#63145.

r? @estebank
…chenkov

Some more libsyntax::attr cleanup

Much smaller patch than the last one, mostly just finishing up by removing some Span arguments.

r? @petrochenkov
…Centril

Remove leftover AwaitOrigin

This was missed in PR rust-lang#62293.
Don't store &Span

This is just needless indirection.
Clarify align_to's requirements and obligations

Based on discussions with @RalfJung around my misunderstandings when using this.

r? @RalfJung
…=oli-obk

Make qualify consts in_projection use PlaceRef

r? @oli-obk
doc: fix broken sentence

Also, the move was done nearly a year ago
@Centril
Copy link
Contributor Author

Centril commented Aug 6, 2019

@bors r+ p=14 rollup=never

@bors
Copy link
Contributor

bors commented Aug 6, 2019

📌 Commit 3bb4a53 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Aug 6, 2019
@bors
Copy link
Contributor

bors commented Aug 6, 2019

⌛ Testing commit 3bb4a53 with merge 92de8936b5a1bfd3be3fd0422dcd63a5f43559a5...

@bors
Copy link
Contributor

bors commented Aug 6, 2019

💔 Test failed - checks-azure

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-aux of your PR failed (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.
2019-08-06T02:41:15.9798396Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-06T02:41:15.9798456Z 
2019-08-06T02:41:15.9798660Z   git checkout -b <new-branch-name>
2019-08-06T02:41:15.9798696Z 
2019-08-06T02:41:15.9798952Z HEAD is now at 92de8936b Auto merge of #63318 - Centril:rollup-r599iq6, r=Centril
2019-08-06T02:41:15.9946542Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-06T02:41:15.9949424Z ==============================================================================
2019-08-06T02:41:15.9949497Z Task         : Bash
2019-08-06T02:41:15.9949587Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-06T04:41:43.7142997Z test workspaces::ws_warn_unused ... ok
2019-08-06T04:41:43.7143150Z 
2019-08-06T04:41:43.7143219Z failures:
2019-08-06T04:41:43.7143281Z 
2019-08-06T04:41:43.7147281Z ---- check::rustc_check_err stdout ----
2019-08-06T04:41:43.7148159Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo rustc --profile check -- --emit=metadata`
2019-08-06T04:41:43.7148883Z thread 'check::rustc_check_err' panicked at '
2019-08-06T04:41:43.7149007Z Expected: execs
2019-08-06T04:41:43.7149102Z     but: expected to find:
2019-08-06T04:41:43.7149174Z [..]cannot find function `qux` in module `bar`
2019-08-06T04:41:43.7149298Z did not find in output:
2019-08-06T04:41:43.7149298Z did not find in output:
2019-08-06T04:41:43.7150238Z     Checking bar v0.1.0 (/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t458/bar)
2019-08-06T04:41:43.7150659Z     Checking foo v0.0.1 (/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t458/foo)
2019-08-06T04:41:43.7150780Z error[E0425]: cannot find function `qux` in crate `bar`
2019-08-06T04:41:43.7151095Z   |
2019-08-06T04:41:43.7151095Z   |
2019-08-06T04:41:43.7151160Z 1 | extern crate bar; fn main() { ::bar::qux(); }
2019-08-06T04:41:43.7151257Z   |                                      ^^^ not found in `bar`
2019-08-06T04:41:43.7151369Z error: aborting due to previous error
2019-08-06T04:41:43.7151446Z 
2019-08-06T04:41:43.7151724Z For more information about this error, try `rustc --explain E0425`.
2019-08-06T04:41:43.7151823Z error: Could not compile `foo`.
2019-08-06T04:41:43.7151823Z error: Could not compile `foo`.
2019-08-06T04:41:43.7151866Z 
2019-08-06T04:41:43.7152256Z To learn more, run the command again with --verbose.
2019-08-06T04:41:43.7152511Z ', src/tools/cargo/tests/testsuite/support/mod.rs:843:13
2019-08-06T04:41:43.7152605Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-08-06T04:41:43.7152656Z 
2019-08-06T04:41:43.7152876Z ---- metabuild::metabuild_failed_build_json stdout ----
2019-08-06T04:41:43.7153435Z running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/cargo build --message-format=json`
2019-08-06T04:41:43.7153688Z thread 'metabuild::metabuild_failed_build_json' panicked at '
2019-08-06T04:41:43.7153771Z Expected: execs
2019-08-06T04:41:43.7153828Z     but: Did not find expected JSON:
2019-08-06T04:41:43.7154774Z "\n{\n  \"message\": {\n    \"children\": \"{...}\",\n    \"code\": \"{...}\",\n    \"level\": \"error\",\n    \"message\": \"cannot find function `metabuild` in module `mb`\",\n    \"rendered\": \"[..]\",\n    \"spans\": \"{...}\"\n  },\n  \"package_id\": \"foo [..]\",\n  \"reason\": \"compiler-message\",\n  \"target\": {\n    \"crate_types\": [\n      \"bin\"\n    ],\n    \"doctest\": false,\n    \"edition\": \"2018\",\n    \"kind\": [\n      \"custom-build\"\n    ],\n    \"name\": \"metabuild-foo\",\n    \"src_path\": null\n  }\n}\n"
2019-08-06T04:41:43.7155173Z Remaining available output:
2019-08-06T04:41:43.7156618Z {"reason":"compiler-artifact","package_id":"mb 0.5.0 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/mb)","target":{"kind":["lib"],"crate_types":["lib"],"name":"mb","src_path":"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/mb/src/lib.rs","edition":"2015","doctest":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/target/debug/deps/libmb-e9507ea5788b89c0.rlib","/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/target/debug/deps/libmb-e9507ea5788b89c0.rmeta"],"executable":null,"fresh":false}
2019-08-06T04:41:43.7158180Z {"reason":"compiler-artifact","package_id":"mb-other 0.0.1 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/mb-other)","target":{"kind":["lib"],"crate_types":["lib"],"name":"mb-other","src_path":"/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/mb-other/src/lib.rs","edition":"2015","doctest":true},"profile":{"opt_level":"0","debuginfo":2,"debug_assertions":true,"overflow_checks":true,"test":false},"features":[],"filenames":["/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/target/debug/deps/libmb_other-cbe3510fdcdf0ea7.rlib","/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo/target/debug/deps/libmb_other-cbe3510fdcdf0ea7.rmeta"],"executable":null,"fresh":false}
2019-08-06T04:41:43.7163264Z {"reason":"compiler-message","package_id":"foo 0.0.1 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo)","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"metabuild-foo","src_path":null,"edition":"2018","doctest":false},"message":{"rendered":"error[E0425]: cannot find function `metabuild` in crate `mb`\n --> target/.metabuild/metabuild-foo-11ea4648a08a0492.rs:4:9\n  |\n4 |     mb::metabuild();\n  |         ^^^^^^^^^ not found in `mb`\nhelp: possible candidate is found in another module, you can import it into scope\n  |\n1 | use mb_other::metabuild;\n  |\n\n","children":[{"children":[],"code":null,"level":"help","message":"possible candidate is found in another module, you can import it into scope","rendered":null,"spans":[{"byte_end":0,"byte_start":0,"column_end":1,"column_start":1,"expansion":null,"file_name":"target/.metabuild/metabuild-foo-11ea4648a08a0492.rs","is_primary":true,"label":null,"line_end":1,"line_start":1,"suggested_replacement":"use mb_other::metabuild;\n","suggestion_applicability":"Unspecified","text":[{"highlight_end":1,"highlight_start":1,"text":"use mb;"}]}]}],"code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","message":"cannot find function `metabuild` in crate `mb`","spans":[{"byte_end":51,"byte_start":42,"column_end":18,"column_start":9,"expansion":null,"file_name":"target/.metabuild/metabuild-foo-11ea4648a08a0492.rs","is_primary":true,"label":"not found in `mb`","line_end":4,"line_start":4,"suggested_replacement":null,"suggestion_applicability":null,"text":[{"highlight_end":18,"highlight_start":9,"text":"    mb::metabuild();"}]}]}}
2019-08-06T04:41:43.7165724Z {"reason":"compiler-message","package_id":"foo 0.0.1 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo)","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"metabuild-foo","src_path":null,"edition":"2018","doctest":false},"message":{"rendered":"error: aborting due to previous error\n\n","children":[],"code":null,"level":"error","message":"aborting due to previous error","spans":[]}}
2019-08-06T04:41:43.7166562Z {"reason":"compiler-message","package_id":"foo 0.0.1 (path+file:///checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/cit/t932/foo)","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"metabuild-foo","src_path":null,"edition":"2018","doctest":false},"message":{"rendered":"For more information about this error, try `rustc --explain E0425`.\n","children":[],"code":null,"level":"","message":"For more information about this error, try `rustc --explain E0425`.","spans":[]}}
2019-08-06T04:41:43.7166947Z ', src/tools/cargo/tests/testsuite/support/mod.rs:843:13
2019-08-06T04:41:43.7167051Z 
2019-08-06T04:41:43.7167118Z failures:
2019-08-06T04:41:43.7167332Z     check::rustc_check_err
2019-08-06T04:41:43.7167816Z     metabuild::metabuild_failed_build_json
---
2019-08-06T04:41:43.7217525Z 
2019-08-06T04:41:43.7217556Z 
2019-08-06T04:41:43.7227110Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/test/run-fail/pretty src/test/run-pass-valgrind/pretty src/tools/cargo src/tools/cargotest
2019-08-06T04:41:43.7227447Z Build completed unsuccessfully in 1:55:40
2019-08-06T04:41:43.7282554Z Makefile:50: recipe for target 'check-aux' failed
2019-08-06T04:41:43.7282796Z make: *** [check-aux] Error 1
2019-08-06T04:41:50.1992933Z ##[error]Bash exited with code '2'.
2019-08-06T04:41:50.2038016Z ##[section]Starting: Upload CPU usage statistics
2019-08-06T04:41:50.2055751Z ==============================================================================
2019-08-06T04:41:50.2055832Z Task         : Bash
2019-08-06T04:41:50.2055906Z Description  : Run a Bash script on macOS, Linux, or Windows

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)

@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 Aug 6, 2019
@Centril Centril closed this Aug 6, 2019
@Centril Centril deleted the rollup-r599iq6 branch August 6, 2019 06:16
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.