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 10 pull requests #50666

Closed
wants to merge 28 commits into from
Closed

Conversation

alexcrichton
Copy link
Member

Successful merges:

Failed merges:

llogiq and others added 27 commits May 9, 2018 02:01
added rustc_const_unstable attribute

extended tests

added conversion test

fixed tidy test

added feature attribute
Generate an IO error if the offset is out of bounds for the system call.
The Higher Intermediate Representation doesn't have spans for visibility
keywords, so we were assuming that the first whitespace-delimited token
in the item span was the `pub` to be weakened. This doesn't work for
brace-grouped `use`s, which get lowered as if they were several
individual `use` statements, but with spans that only cover the braced
path-segments. Constructing a correct suggestion here presents some
challenges—until someone works those out, we can at least protect the
dignity of our compiler marking the suggestion for `use` items as
potentially incorrect.

This resolves rust-lang#50455 (but again, it would be desirable in the future to
make a correct suggestion instead of copping out like this).
This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes rust-lang#50662
This commit fixes recommending the `crate` prefix when migrating to 2018 for
paths that look like `use foo;` or `use {bar, baz}`

Closes rust-lang#50660
…gestion, r=Manishearth

don't make crazy suggestion for unreachable braced pub-use

The Higher Intermediate Representation doesn't have spans for visibility
keywords, so we were assuming that the first whitespace-delimited token
in the item span was the `pub` to be weakened. This doesn't work for
brace-grouped `use`s, which get lowered as if they were several
individual `use` statements, but with spans that only cover the braced
path-segments. Constructing a correct suggestion here presents some
challenges—until someone works those out, we can at least protect the
dignity of our compiler by not offering any suggestion at all for `use` items.

This resolves rust-lang#50455 (but again, it would be desirable in the future to
make a correct suggestion instead of copping out like this).

r? @Manishearth
Made some functions in time module const

They may be const, or i missed something?
use fmt::Result where applicable

This is a quite boring PR, but I think the type alias improves readability, so why not use it?
…ster

Remove all reference to DepGraph::work_products

This is an attempt at fixing rust-lang#50500. It will remove the `work_products` key from `DepGraphData` completely, in favour of just passing the relevant data around. I went in a little blindly; everything appears to work just fine but I'd appreciate any additional advice people.

I didn't want to remove too much of what was already there, so I kept the structure pretty much the same (aside from some naming tweaks) - if anyone has suggestions on how to streamline it a little better, happy to follow up.

r? @michaelwoerister
…cs, r=cramertj

Update canonicalize docs

I was recently working with file-paths in Rust, and I felt let down by the `std::fs::canonicalize` docs, so I figured I should submit a PR with some suggestions.

I was looking for a method to turn a relative path into an absolute path. The `canonicalize` docs didn't mention the words "relative" or "absolute", but they did mention resolving symlinks (which is a kind of canonicalisation and does not imply converting to absolute), so I assumed that's all it did. To remedy this, I've added the word "absolute" to the description of both `std::fs::canonicalize` and `std::path::Path::canonicalize`.

After calling `canonicalize` on Windows, I ran into a bunch of other problems I would not have expected from the function's behaviour on Linux. Specifically, if you call `canonicalize` on a path:

  - it's allowed to be much longer than it otherwise would
  - `.join("a/slash/delimited/path")` gives you a broken path that Windows can't use, where the same operation would have worked perfectly without `canonicalize` (if the path were short enough)
  - the resulting path may confuse other Windows programs if you pass it to them on the command-line, or write it to a config file that they read, etc.

...so I tried to summarize those behaviours too.

If I understand correctly, those behaviours are a side-effect of calling `GetFinalPathNameByHandle`, and the documentation says `canonicalize` might not call that function in future, so maybe those side-effects shouldn't be part of the function's documentation. However, I bet there's a lot of applications deliberately calling `canonicalize` just for the path-length-extension alone, so that particular side-effect is de-facto part of the `canonicalize` interface.
…veklabnik

fs::write: Add example writing a &str

This adds an example to the documentation for `fs::write` that demonstrates the use of the `AsRef<[u8]>` implementation for &str. Experienced users should already recognize the possibility from the type signature, but new users may not recognize the significance.
…nnytm

Do not silently truncate offsets for `read_at`/`write_at` on emscripten

Generate an IO error if the offset is out of bounds for the system call.
…richton

AppVeyor: Read back trace from crash dump on failure.

This is an attempt to debug spurious access violations on Windows (rust-lang#33434, rust-lang#50604). Thanks to rust-lang#50276, there should be minidumps to read when rustc segfault.

(The implementation is based on <https://github.com/springmeyer/travis-coredump/blob/master/test.bat>.)
…nishearth

rustc: Allow an edition's feature on that edition

This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes rust-lang#50662
…arnings, r=Manishearth

rustc: Fix `crate` lint for single-item paths

This commit fixes recommending the `crate` prefix when migrating to 2018 for
paths that look like `use foo;` or `use {bar, baz}`

Closes rust-lang#50660
@alexcrichton
Copy link
Member Author

@bors: r+ p=2

@bors
Copy link
Contributor

bors commented May 11, 2018

📌 Commit 58481c0 has been approved by alexcrichton

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

bors commented May 11, 2018

⌛ Testing commit 58481c0 with merge 9a1a5c3eb5a68a437132c577195a77980dc7b83c...

@alexcrichton
Copy link
Member Author

@bors: retry r-

found a test failure, cancelling build

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 11, 2018
@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Contributor

bors commented May 11, 2018

📌 Commit 411bfed has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented May 11, 2018

⌛ Testing commit 411bfedf8187b9082c5dbc15022a4c93334994f0 with merge a46ce3b98587c133e8c961e646b0d3ed7b2bad01...

@bors
Copy link
Contributor

bors commented May 11, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

The job asmjs 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.
[01:06:00]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[01:06:00] [RUSTC-TIMING] panic_unwind test:false 0.204
[01:06:01] warning: dropping unsupported crate type `dylib` for target `asmjs-unknown-emscripten`
[01:06:01] 
[01:06:05] error[E0599]: no method named `try_into` found for type `i64` in the current scope
[01:06:05]   --> libstd/sys/unix/fd.rs:80:35
[01:06:05]    |
[01:06:05] 80 |             if let Ok(o) = offset.try_into() {
[01:06:05]    |
[01:06:05]    = help: items from traits can only be used if the trait is in scope
[01:06:05]    = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:06:05]            candidate #1: `use core::convert::TryInto;`
[01:06:05]            candidate #1: `use core::convert::TryInto;`
[01:06:05] 
[01:06:05] error[E0599]: no method named `try_into` found for type `i64` in the current scope
[01:06:05]    --> libstd/sys/unix/fd.rs:127:35
[01:06:05]     |
[01:06:05] 127 |             if let Ok(o) = offset.try_into() {
[01:06:05]     |
[01:06:05]     = help: items from traits can only be used if the trait is in scope
[01:06:05]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:06:05]             candidate #1: `use core::convert::TryInto;`
---
[01:06:05] [RUSTC-TIMING] std test:false 4.579
[01:06:05] error: Could not compile `std`.
[01:06:05] 
[01:06:05] Caused by:
[01:06:05]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name std libstd/lib.rs --color always --error-format json --crate-type dylib --crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg feature="alloc_jemalloc" --cfg feature="backtrace" --cfg feature="jemalloc" --cfg feature="panic-unwind" --cfg feature="panic_unwind" -C metadata=dd7e1cb952f01bfe -C extra-filename=-dd7e1cb952f01bfe --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps --target asmjs-unknown-emscripten -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/release/deps --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liblibc-51a399ba7e674717.rlib --extern std_unicode=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libstd_unicode-f3aad318045bbfb9.rlib --extern panic_unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libpanic_unwind-99544cd741ab91fb.rlib --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libcore-6ada1f8f2c20c8b5.rlib --extern unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libunwind-654a884bfdda8b1d.rlib --extern alloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liballoc-74412e5d25bc61ac.rlib --extern panic_abort=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libpanic_abort-9d726bd413a86f8b.rlib --extern alloc_jemalloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liballoc_jemalloc-2c1a44b9ee26baac.rlib --extern alloc_system=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liballoc_system-4a31f9b6a00b0663.rlib --extern compiler_builtins=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libcompiler_builtins-93fbfd71748200b0.rlib` (exit code: 101)
[01:06:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "asmjs-unknown-emscripten" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[01:06:05] expected success, got: exit code: 101
[01:06:05] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[01:06:05] travis_fold:end:stage2-std

[01:06:05] travis_time:end:stage2-std:start=1526067900171653875,finish=1526067959117672997,duration=58946019122

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 May 11, 2018
@rust-highfive
Copy link
Collaborator

The job asmjs 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.
[01:06:00]    Compiling panic_unwind v0.0.0 (file:///checkout/src/libpanic_unwind)
[01:06:00] [RUSTC-TIMING] panic_unwind test:false 0.204
[01:06:01] warning: dropping unsupported crate type `dylib` for target `asmjs-unknown-emscripten`
[01:06:01] 
[01:06:05] error[E0599]: no method named `try_into` found for type `i64` in the current scope
[01:06:05]   --> libstd/sys/unix/fd.rs:80:35
[01:06:05]    |
[01:06:05] 80 |             if let Ok(o) = offset.try_into() {
[01:06:05]    |
[01:06:05]    = help: items from traits can only be used if the trait is in scope
[01:06:05]    = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:06:05]            candidate #1: `use core::convert::TryInto;`
[01:06:05]            candidate #1: `use core::convert::TryInto;`
[01:06:05] 
[01:06:05] error[E0599]: no method named `try_into` found for type `i64` in the current scope
[01:06:05]    --> libstd/sys/unix/fd.rs:127:35
[01:06:05]     |
[01:06:05] 127 |             if let Ok(o) = offset.try_into() {
[01:06:05]     |
[01:06:05]     = help: items from traits can only be used if the trait is in scope
[01:06:05]     = note: the following trait is implemented but not in scope, perhaps add a `use` for it:
[01:06:05]             candidate #1: `use core::convert::TryInto;`
---
[01:06:05] [RUSTC-TIMING] std test:false 4.579
[01:06:05] error: Could not compile `std`.
[01:06:05] 
[01:06:05] Caused by:
[01:06:05]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name std libstd/lib.rs --color always --error-format json --crate-type dylib --crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 --cfg feature="alloc_jemalloc" --cfg feature="backtrace" --cfg feature="jemalloc" --cfg feature="panic-unwind" --cfg feature="panic_unwind" -C metadata=dd7e1cb952f01bfe -C extra-filename=-dd7e1cb952f01bfe --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps --target asmjs-unknown-emscripten -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/release/deps --extern libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liblibc-51a399ba7e674717.rlib --extern std_unicode=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libstd_unicode-f3aad318045bbfb9.rlib --extern panic_unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libpanic_unwind-99544cd741ab91fb.rlib --extern core=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libcore-6ada1f8f2c20c8b5.rlib --extern unwind=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libunwind-654a884bfdda8b1d.rlib --extern alloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liballoc-74412e5d25bc61ac.rlib --extern panic_abort=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libpanic_abort-9d726bd413a86f8b.rlib --extern alloc_jemalloc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liballoc_jemalloc-2c1a44b9ee26baac.rlib --extern alloc_system=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/liballoc_system-4a31f9b6a00b0663.rlib --extern compiler_builtins=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-std/asmjs-unknown-emscripten/release/deps/libcompiler_builtins-93fbfd71748200b0.rlib` (exit code: 101)
[01:06:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "asmjs-unknown-emscripten" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
[01:06:05] expected success, got: exit code: 101
[01:06:05] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[01:06:05] travis_fold:end:stage2-std

[01:06:05] travis_time:end:stage2-std:start=1526067900171653875,finish=1526067959117672997,duration=58946019122

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)

@alexcrichton
Copy link
Member Author

@bors: r+

@bors
Copy link
Contributor

bors commented May 11, 2018

📌 Commit 094873c has been approved by alexcrichton

@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 May 11, 2018
@alexcrichton alexcrichton deleted the rollup branch May 11, 2018 19:54
@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-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.