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

Strip code to the left and right in diagnostics for long lines #63402

Merged
merged 9 commits into from Aug 30, 2019

Conversation

@estebank
Copy link
Contributor

estebank commented Aug 9, 2019

Fix #62999.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Aug 9, 2019

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Aug 9, 2019

The job x86_64-gnu-llvm-6.0 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-09T06:19:28.1718588Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-09T06:19:28.1923432Z ##[command]git config gc.auto 0
2019-08-09T06:19:28.1992606Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-09T06:19:28.2053340Z ##[command]git config --get-all http.proxy
2019-08-09T06:19:28.2211548Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63402/merge:refs/remotes/pull/63402/merge
---
2019-08-09T06:20:03.5115857Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-09T06:20:03.5115913Z 
2019-08-09T06:20:03.5116178Z   git checkout -b <new-branch-name>
2019-08-09T06:20:03.5116214Z 
2019-08-09T06:20:03.5116280Z HEAD is now at 9ac753be9 Merge 5873a187f559f18eb84dfe6dc06119b0ab9bff77 into 5aa3d9a7b5d3a46a7f158e8881146331a6bc9243
2019-08-09T06:20:03.5276613Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-09T06:20:03.5279885Z ==============================================================================
2019-08-09T06:20:03.5279992Z Task         : Bash
2019-08-09T06:20:03.5280045Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-09T06:26:18.2232007Z    Compiling serde_json v1.0.40
2019-08-09T06:26:22.7806528Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-08-09T06:26:31.9661996Z     Finished release [optimized] target(s) in 1m 41s
2019-08-09T06:26:31.9735066Z tidy check
2019-08-09T06:26:32.4693273Z tidy error: /checkout/src/librustc_errors/emitter.rs:260: line longer than 100 chars
2019-08-09T06:26:33.9864636Z Stray file with UI testing output: "/checkout/src/test/ui/feature-gates/feature-gate-existential-type.stderr"
2019-08-09T06:26:33.9897010Z Stray file with UI testing output: "/checkout/src/test/ui/feature-gate/await-macro.stderr"
2019-08-09T06:26:34.0167286Z Stray file with UI testing output: "/checkout/src/test/ui/issues/issue-50264-inner-deref-trait/result-deref.stderr"
2019-08-09T06:26:34.0169306Z Stray file with UI testing output: "/checkout/src/test/ui/issues/issue-50264-inner-deref-trait/option-deref.stderr"
2019-08-09T06:26:34.0170032Z Stray file with UI testing output: "/checkout/src/test/ui/issues/issue-50264-inner-deref-trait/result-deref-ok.stderr"
2019-08-09T06:26:34.0174872Z Stray file with UI testing output: "/checkout/src/test/ui/issues/issue-50264-inner-deref-trait/result-deref-err.stderr"
2019-08-09T06:26:34.0218175Z Stray file with UI testing output: "/checkout/src/test/ui/issues/issue-26158.stderr"
2019-08-09T06:26:34.0270542Z Stray file with UI testing output: "/checkout/src/test/ui/allocator-submodule.stderr"
2019-08-09T06:26:34.0283340Z some tidy checks failed
2019-08-09T06:26:34.0290351Z 
2019-08-09T06:26:34.0290351Z 
2019-08-09T06:26:34.0291616Z 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"
2019-08-09T06:26:34.0291803Z 
2019-08-09T06:26:34.0291828Z 
2019-08-09T06:26:34.0294396Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-08-09T06:26:34.0294461Z Build completed unsuccessfully in 0:01:44
2019-08-09T06:26:34.0294461Z Build completed unsuccessfully in 0:01:44
2019-08-09T06:26:35.7435023Z ##[error]Bash exited with code '1'.
2019-08-09T06:26:35.7465993Z ##[section]Starting: Checkout
2019-08-09T06:26:35.7467639Z ==============================================================================
2019-08-09T06:26:35.7467696Z Task         : Get sources
2019-08-09T06:26:35.7467761Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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

This comment has been minimized.

Copy link
Contributor Author

estebank commented Aug 9, 2019

TODO:

  • Rebase
  • Fix tests
  • Handle Unicode slicing correctly
  • Use calculated margins to aim at the span being roughly centered, but bias towards stripping more whitespace than code
  • Add width rustc flag so that cargo can set the current column width (running cargo will default the output to 140 chars)
  • Consider centering the position of the span as much as possible.

Current look on the code in the original report:

Screen Shot 2019-08-08 at 11 17 09 PM


Edit: current look
Screen Shot 2019-08-14 at 11 36 15 AM


Edit:

Screen Shot 2019-08-14 at 2 21 57 PM

@estebank estebank changed the title [WIP] Strip code to the left and right in diagnostics for long lines Strip code to the left and right in diagnostics for long lines Aug 14, 2019
@estebank estebank force-pushed the estebank:strip-margin branch from 5873a18 to f240167 Aug 14, 2019
@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Aug 14, 2019

@rust-lang/wg-diagnostics @Centril @nikomatsakis you all might be interested in taking a look at this.

What it looks like in practice:

Screen Shot 2019-08-14 at 11 39 50 AM


Update: now centered:

Screen Shot 2019-08-14 at 2 06 37 PM

@Centril

This comment has been minimized.

Copy link
Member

Centril commented Aug 14, 2019

@estebank how does it look right now?

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Aug 14, 2019

how does it look right now?

@Centril I'm not sure I follow? I have screenshots in the comments.

Right now the logic is:

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Aug 14, 2019

The job x86_64-gnu-llvm-6.0 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-14T18:46:38.8915932Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-14T18:46:38.9088465Z ##[command]git config gc.auto 0
2019-08-14T18:46:38.9168523Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-14T18:46:38.9223348Z ##[command]git config --get-all http.proxy
2019-08-14T18:46:38.9361009Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/63402/merge:refs/remotes/pull/63402/merge
---
2019-08-14T18:47:13.8191975Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-14T18:47:13.8192017Z 
2019-08-14T18:47:13.8192198Z   git checkout -b <new-branch-name>
2019-08-14T18:47:13.8192223Z 
2019-08-14T18:47:13.8192279Z HEAD is now at 763d00b0e Merge 53546269a437ccbad26998a1aa65f25f3c82eeec into c43d03a19f326f4a323569328cc501e86eb6d22e
2019-08-14T18:47:13.8338886Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-14T18:47:13.8341425Z ==============================================================================
2019-08-14T18:47:13.8341471Z Task         : Bash
2019-08-14T18:47:13.8341508Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-14T18:53:24.9357813Z    Compiling serde_json v1.0.40
2019-08-14T18:53:29.1395700Z    Compiling tidy v0.1.0 (/checkout/src/tools/tidy)
2019-08-14T18:53:37.5472219Z     Finished release [optimized] target(s) in 1m 27s
2019-08-14T18:53:37.5544276Z tidy check
2019-08-14T18:53:37.9728312Z tidy error: /checkout/src/librustc_errors/emitter.rs:1262: TODO is deprecated; use FIXME
2019-08-14T18:53:39.3798763Z some tidy checks failed
2019-08-14T18:53:39.3805735Z 
2019-08-14T18:53:39.3805735Z 
2019-08-14T18:53:39.3807575Z 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"
2019-08-14T18:53:39.3808190Z 
2019-08-14T18:53:39.3808280Z 
2019-08-14T18:53:39.3809400Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-08-14T18:53:39.3809628Z Build completed unsuccessfully in 0:01:30
2019-08-14T18:53:39.3809628Z Build completed unsuccessfully in 0:01:30
2019-08-14T18:53:39.3852232Z == clock drift check ==
2019-08-14T18:53:39.3863337Z   local time: Wed Aug 14 18:53:39 UTC 2019
2019-08-14T18:53:39.4708365Z   network time: Wed, 14 Aug 2019 18:53:39 GMT
2019-08-14T18:53:39.4710878Z == end clock drift check ==
2019-08-14T18:53:40.8283656Z ##[error]Bash exited with code '1'.
2019-08-14T18:53:40.8312378Z ##[section]Starting: Checkout
2019-08-14T18:53:40.8314105Z ==============================================================================
2019-08-14T18:53:40.8314164Z Task         : Get sources
2019-08-14T18:53:40.8314313Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@Centril

This comment has been minimized.

Copy link
Member

Centril commented Aug 14, 2019

@estebank sounds good :)

@estebank estebank force-pushed the estebank:strip-margin branch from 5354626 to 440b3f7 Aug 14, 2019
@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Aug 15, 2019

Idk how I feel about this. It will make the move to annotate_snippets harder

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Aug 15, 2019

@oli-obk Can we add this to annotate_snippets instead, and try to speed up the move?

@bors

This comment was marked as resolved.

Copy link
Contributor

bors commented Aug 16, 2019

☔️ The latest upstream changes (presumably #63627) made this pull request unmergeable. Please resolve the merge conflicts.

@eddyb

This comment has been minimized.

Copy link
Member

eddyb commented Aug 18, 2019

Blocked on #63402 (comment) (or at least a decision regarding it, maybe this should've been nominated for compiler-team meeting?).

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Aug 19, 2019

I would be ok with adding the feature to annotate-snippets, but I would like to land this asap as when it is needed, it is really needed, and it'll be useful to gather actual real world usage feedback, even if we never land it in stable. I want to see how people react.

Edit: furthermore, some of the changes include extra flags that cargo needs to know about, so it'd be nice to have it in place to speed up that part of the work.

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Aug 20, 2019

ok, let's land this without touching annotate snippets first

@estebank

This comment has been minimized.

Copy link
Contributor Author

estebank commented Aug 30, 2019

ping?

@@ -427,7 +427,7 @@ pub fn make_test(s: &str,
// Any errors in parsing should also appear when the doctest is compiled for real, so just
// send all the errors that libsyntax emits directly into a `Sink` instead of stderr.
let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let emitter = EmitterWriter::new(box io::sink(), None, false, false, false);
let emitter = EmitterWriter::new(box io::sink(), None, false, false, false, None);

This comment has been minimized.

Copy link
@oli-obk

oli-obk Aug 30, 2019

Contributor

these arguments are really getting out of hand

@@ -37,8 +37,8 @@ LL | asm!("mov sp, $0"::"r"(addr),
error[E0669]: invalid value for constraint in inline assembly
--> $DIR/inline-asm-bad-operand.rs:56:32
|
LL | "r"("hello e0669"));
| ^^^^^^^^^^^^^
LL | ... "r"("hello e0669"));

This comment has been minimized.

Copy link
@oli-obk

oli-obk Aug 30, 2019

Contributor

should we trim whitespace more eagerly?

This comment has been minimized.

Copy link
@estebank

estebank Aug 30, 2019

Author Contributor

Maybe, although I want it always to be clear that trimming is happening (with the leading ... and some leading whitespace as possible).

|
LL | ...-> usize {
| ----- expected `usize` because of return type
LL | ... ()

This comment has been minimized.

Copy link
@oli-obk

oli-obk Aug 30, 2019

Contributor

I think this could also benefit from more eager whitespace eating

This comment has been minimized.

Copy link
@estebank

estebank Aug 30, 2019

Author Contributor

This test in particular can't eat more without changing the shape of the code. The trimming uses bounding boxes, and what you see here is the smallest bounding box possible that points to both the return type and the () being returned by the tail expression. I personally prefer this behavior (at least to start with) to using different left side trimming on different lines.

error[E0308]: mismatched types
--> $DIR/whitespace-trimming-2.rs:4:187
|
LL | ...-> usize {

This comment has been minimized.

Copy link
@oli-obk

oli-obk Aug 30, 2019

Contributor

this isn't too great. Not sure what to do about it though

This comment has been minimized.

Copy link
@estebank

estebank Aug 30, 2019

Author Contributor

I think this is a pathological case and the current behavior is the best possible one given the constraints.

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Aug 30, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 30, 2019

📌 Commit aaf4dc3 has been approved by oli-obk

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Aug 30, 2019

@rust-highfive rust-highfive assigned oli-obk and unassigned eddyb Aug 30, 2019
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 30, 2019

⌛️ Testing commit aaf4dc3 with merge 19a38de...

bors added a commit that referenced this pull request Aug 30, 2019
Strip code to the left and right in diagnostics for long lines

Fix #62999.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 30, 2019

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing 19a38de to master...

@bors bors added the merged-by-bors label Aug 30, 2019
@bors bors merged commit aaf4dc3 into rust-lang:master Aug 30, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20190821.58 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (LinuxTools) LinuxTools succeeded
Details
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Aug 30, 2019

📣 Toolstate changed by #63402!

Tested on commit 19a38de.
Direct link to PR: #63402

💔 miri on windows: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
🎉 rls on linux: test-fail → test-pass (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Aug 30, 2019
Tested on commit rust-lang/rust@19a38de.
Direct link to PR: <rust-lang/rust#63402>

💔 miri on windows: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
💔 miri on linux: test-pass → test-fail (cc @oli-obk @RalfJung @eddyb, @rust-lang/infra).
🎉 rls on linux: test-fail → test-pass (cc @Xanewok, @rust-lang/infra).
@RalfJung

This comment has been minimized.

Copy link
Member

RalfJung commented Aug 30, 2019

Interesting. This PR introduced an ICE in a Miri test.

2019-08-30T09:21:21.4479192Z error: failure produced the wrong error: exit code: 101
2019-08-30T09:21:21.4479270Z status: exit code: 101
2019-08-30T09:21:21.4479913Z command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/miri" "tests/compile-fail/validity/invalid_char.rs" "-L" "/tmp/compiletestkZNor4" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/compiletestkZNor4/validity/invalid_char.stage-id" "--edition" "2018" "-Astable-features" "--sysroot" "/home/user/.cache/miri/HOST" "-L" "/tmp/compiletestkZNor4/validity/invalid_char.stage-id.aux" "-A" "unused"
2019-08-30T09:21:21.4480668Z stdout:
2019-08-30T09:21:21.4481022Z ------------------------------------------
2019-08-30T09:21:21.4481081Z 
2019-08-30T09:21:21.4481328Z ------------------------------------------
2019-08-30T09:21:21.4481434Z stderr:
2019-08-30T09:21:21.4481671Z ------------------------------------------
2019-08-30T09:21:21.4482018Z thread 'rustc' panicked at 'attempt to subtract with overflow', src/librustc_errors/emitter.rs:154:38
2019-08-30T09:21:21.4482129Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-08-30T09:21:21.4482208Z 
2019-08-30T09:21:21.4482275Z error: internal compiler error: unexpected panic
2019-08-30T09:21:21.4482342Z 
2019-08-30T09:21:21.4482411Z note: the compiler unexpectedly panicked. this is a bug.
2019-08-30T09:21:21.4482462Z 
2019-08-30T09:21:21.4482813Z note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
2019-08-30T09:21:21.4482896Z 
2019-08-30T09:21:21.4483177Z note: rustc 1.39.0-dev running on x86_64-unknown-linux-gnu
2019-08-30T09:21:21.4483234Z 
2019-08-30T09:21:21.4483485Z note: compiler flags: -C prefer-dynamic
2019-08-30T09:21:21.4483538Z 
2019-08-30T09:21:21.4483574Z 
2019-08-30T09:21:21.4484155Z ------------------------------------------
2019-08-30T09:21:21.4484197Z 
2019-08-30T09:21:21.4484526Z thread '[compile-fail] compile-fail/validity/invalid_char.rs' panicked at 'explicit panic', /cargo/registry/src/github.com-1ecc6299db9ec823/compiletest_rs-0.3.22/src/runtest.rs:2632:9
2019-08-30T09:21:21.4484644Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
2019-08-30T09:21:21.4493103Z test [compile-fail] compile-fail/validity/invalid_char.rs ... FAILED

@estebank any idea why?

} else if self.span_right - self.span_left <= self.column_width {
// Attempt to fit the code window considering the spans and labels plus padding.
let padding_left = (self.column_width - (self.span_right - self.span_left)) / 5 * 2;
self.computed_left = self.span_left - padding_left;

This comment has been minimized.

Copy link
@RalfJung

RalfJung Aug 30, 2019

Member

Looks like this subtraction overflows when Miri emits an error.

This comment has been minimized.

Copy link
@estebank

estebank Aug 30, 2019

Author Contributor

@RalfJung is that the only test failing? What would be the correct steps for me to repro this? I have never used Miri. Otherwise, would you be up to taking this on? I'm sure it's a small change that's needed and hopefully there are enough comments to follow the somewhat convoluted logic.

This comment has been minimized.

Copy link
@RalfJung

RalfJung Aug 30, 2019

Member

It is the only test failing, yes. And I'm afraid I am leaving for vacation this weekend and probably won't have time for this before I leave. I also looked at the code while on the train today and could not figure out what all the magic constants (5, 2) were about...

What would be the correct steps for me to repro this?

  • Do a local rustc build with debug assertions enabled: ./x.py build src/rustc
  • Set up a rustup toolchain link for the stage2 directory of that build
  • git clone https://github.com/rust-lang/miri/, then cd into that dir
  • rustup override set <the linked toolchain>
  • RUST_BACKTRACE=1 ./miri run-debug tests/compile-fail/validity/invalid_char.rs

This comment has been minimized.

Copy link
@estebank

estebank Aug 31, 2019

Author Contributor

Fixed in #64029. Off-by-one error due to rounding.

Centril added a commit to Centril/rust that referenced this pull request Sep 1, 2019
Account for rounding errors when deciding the diagnostic boundaries

Fix Miri by fixing the bug raised in rust-lang#63402 (comment).

Fixes rust-lang#64020
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 11, 2019
Pkgsrc changes:
 * Remove patch which no longer applies (but what about RPATH?)
 * Adapt a few patches to changed files upstream.

Upstream changes:

Version 1.39.0 (2019-11-07)
===========================

Language
--------
- [You can now create `async` functions and blocks with `async fn`,
  `async move {}`, and `async {}` respectively, and you can now call
  `.await` on async expressions.][63209]
- [You can now use certain attributes on function, closure, and function
  pointer parameters.][64010] These attributes include `cfg`, `cfg_attr`,
  `allow`, `warn`, `deny`, `forbid` as well as inert helper attributes used
  by procedural macro attributes applied to items. e.g.
  ```rust
  fn len(
      #[cfg(windows)] slice: &[u16],
      #[cfg(not(windows))] slice: &[u8],
  ) -> usize {
      slice.len()
  }
  ```
- [You can now take shared references to bind-by-move patterns in the
  `if` guards of `match` arms.][63118] e.g.
  ```rust
  fn main() {
      let array: Box<[u8; 4]> = Box::new([1, 2, 3, 4]);

      match array {
          nums
  //      ---- `nums` is bound by move.
              if nums.iter().sum::<u8>() == 10
  //                 ^------ `.iter()` implicitly takes a reference to `nums`.
          => {
              drop(nums);
  //          ----------- Legal as `nums` was bound by move and so we have ownership.
          }
          _ => unreachable!(),
      }
  }
  ```

Compiler
--------
- [Added tier 3\* support for the `i686-unknown-uefi` target.][64334]
- [Added tier 3 support for the `sparc64-unknown-openbsd` target.][63595]
- [rustc will now trim code snippets in diagnostics to fit in your terminal.]
  [63402] **Note** Cargo currently doesn't use this feature. Refer to
  [cargo#7315][cargo/7315] to track this feature's progress.
- [You can now pass `--show-output` argument to test binaries to print the
  output of successful tests.][62600]

\* Refer to Rust's [platform support page][forge-platform-support] for more
information on Rust's tiered platform support.

Libraries
---------
- [`Vec::new` and `String::new` are now `const` functions.][64028]
- [`LinkedList::new` is now a `const` function.][63684]
- [`str::len`, `[T]::len` and `str::as_bytes` are now `const` functions.][63770]
- [The `abs`, `wrapping_abs`, and `overflowing_abs` numeric functions are
  now `const`.][63786]

Stabilized APIs
---------------
- [`Pin::into_inner`]
- [`Instant::checked_duration_since`]
- [`Instant::saturating_duration_since`]

Cargo
-----
- [You can now publish git dependencies if supplied with a `version`.]
  [cargo/7237]
- [The `--all` flag has been renamed to `--workspace`.][cargo/7241] Using
  `--all` is now deprecated.

Misc
----
- [You can now pass `-Clinker` to rustdoc to control the linker used
  for compiling doctests.][63834]

Compatibility Notes
-------------------
- [Code that was previously accepted by the old borrow checker, but rejected by
  the NLL borrow checker is now a hard error in Rust 2018.][63565] This was
  previously a warning, and will also become a hard error in the Rust 2015
  edition in the 1.40.0 release.
- [`rustdoc` now requires `rustc` to be installed and in the same directory to
  run tests.][63827] This should improve performance when running a large
  amount of doctests.
- [The `try!` macro will now issue a deprecation warning.][62672] It is
  recommended to use the `?` operator instead.
- [`asinh(-0.0)` now correctly returns `-0.0`.][63698] Previously this
  returned `0.0`.

[62600]: rust-lang/rust#62600
[62672]: rust-lang/rust#62672
[63118]: rust-lang/rust#63118
[63209]: rust-lang/rust#63209
[63402]: rust-lang/rust#63402
[63565]: rust-lang/rust#63565
[63595]: rust-lang/rust#63595
[63684]: rust-lang/rust#63684
[63698]: rust-lang/rust#63698
[63770]: rust-lang/rust#63770
[63786]: rust-lang/rust#63786
[63827]: rust-lang/rust#63827
[63834]: rust-lang/rust#63834
[63927]: rust-lang/rust#63927
[63933]: rust-lang/rust#63933
[63934]: rust-lang/rust#63934
[63938]: rust-lang/rust#63938
[63940]: rust-lang/rust#63940
[63941]: rust-lang/rust#63941
[63945]: rust-lang/rust#63945
[64010]: rust-lang/rust#64010
[64028]: rust-lang/rust#64028
[64334]: rust-lang/rust#64334
[cargo/7237]: rust-lang/cargo#7237
[cargo/7241]: rust-lang/cargo#7241
[cargo/7315]: rust-lang/cargo#7315
[`Pin::into_inner`]: https://doc.rust-lang.org/std/pin/struct.Pin.html#method.into_inner
[`Instant::checked_duration_since`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.checked_duration_since
[`Instant::saturating_duration_since`]: https://doc.rust-lang.org/std/time/struct.Instant.html#method.saturating_duration_since
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.