]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoAdd `format_args_capture` to the unstable book
David Hewitt [Sat, 27 Jun 2020 20:18:02 +0000 (21:18 +0100)]
Add `format_args_capture` to the unstable book

4 years agoImprove messaging from PR feedback
David Hewitt [Sat, 27 Jun 2020 17:13:47 +0000 (18:13 +0100)]
Improve messaging from PR feedback

4 years agoAdd `format_args_capture` feature
David Hewitt [Sat, 12 Oct 2019 14:07:13 +0000 (15:07 +0100)]
Add `format_args_capture` feature

4 years agoAuto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearth
bors [Tue, 23 Jun 2020 07:50:51 +0000 (07:50 +0000)]
Auto merge of #73643 - Manishearth:rollup-68dr8fz, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #72271 (Improve compiler error message for wrong generic parameter order)
 - #72493 ( move leak-check to during coherence, candidate eval)
 - #73398 (A way forward for pointer equality in const eval)
 - #73472 (Clean up E0689 explanation)
 - #73496 (Account for multiple impl/dyn Trait in return type when suggesting `'_`)
 - #73515 (Add second message for LiveDrop errors)
 - #73567 (Clarify --extern documentation.)
 - #73572 (Fix typos in doc comments)
 - #73590 (bootstrap: no `config.toml` exists regression)

Failed merges:

r? @ghost

4 years agoRollup merge of #73590 - davidtwco:bootstrap-fix-config-env-var, r=Mark-Simulacrum
Manish Goregaokar [Tue, 23 Jun 2020 07:34:06 +0000 (00:34 -0700)]
Rollup merge of #73590 - davidtwco:bootstrap-fix-config-env-var, r=Mark-Simulacrum

bootstrap: no `config.toml` exists regression

Fixes #73574.

This PR fixes a regression introduced in #73317 where an oversight meant that `config.toml` was assumed to exist.

4 years agoRollup merge of #73572 - JOE1994:patch-4, r=jonas-schievink
Manish Goregaokar [Tue, 23 Jun 2020 07:34:05 +0000 (00:34 -0700)]
Rollup merge of #73572 - JOE1994:patch-4, r=jonas-schievink

Fix typos in doc comments

Hello 🦀 ,

This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'

Thank you for reviewing this PR 👍

4 years agoRollup merge of #73567 - adetaylor:extern-doc-fix, r=dtolnay
Manish Goregaokar [Tue, 23 Jun 2020 07:34:03 +0000 (00:34 -0700)]
Rollup merge of #73567 - adetaylor:extern-doc-fix, r=dtolnay

Clarify --extern documentation.

Fixes #64731, #73531.

See also https://github.com/rust-lang/rust/issues/64402#issuecomment-530852886

4 years agoRollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obk
Manish Goregaokar [Tue, 23 Jun 2020 07:34:00 +0000 (00:34 -0700)]
Rollup merge of #73515 - christianpoveda:livedrop-diagnostics, r=oli-obk

Add second message for LiveDrop errors

This is an attempt to fix https://github.com/rust-lang/rust/issues/72907 by adding a second message to the `LiveDrop` diagnostics. Changing from this
```
error[E0493]: destructors cannot be evaluated at compile-time
 --> src/lib.rs:7:9
  |
7 |     let mut always_returned = None;
  |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors

error: aborting due to previous error
```
to this
```
error[E0493]: destructors cannot be evaluated at compile-time
  --> foo.rs:6:9
   |
6  |     let mut always_returned = None;
   |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
...
10 |         always_returned = never_returned;
   |         --------------- value is dropped here

error: aborting due to previous error
```
r? @RalfJung @ecstatic-morse

4 years agoRollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikomatsakis
Manish Goregaokar [Tue, 23 Jun 2020 07:33:58 +0000 (00:33 -0700)]
Rollup merge of #73496 - estebank:opaque-missing-lts-in-fn-3, r=nikomatsakis

Account for multiple impl/dyn Trait in return type when suggesting `'_`

Make `impl` and `dyn` Trait lifetime suggestions a bit more resilient.

Follow up to #72804.

r? @nikomatsakis

4 years agoRollup merge of #73472 - GuillaumeGomez:cleanup-e0689, r=Dylan-DPC
Manish Goregaokar [Tue, 23 Jun 2020 07:33:56 +0000 (00:33 -0700)]
Rollup merge of #73472 - GuillaumeGomez:cleanup-e0689, r=Dylan-DPC

Clean up E0689 explanation

r? @Dylan-DPC

4 years agoRollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung,nagisa
Manish Goregaokar [Tue, 23 Jun 2020 07:33:54 +0000 (00:33 -0700)]
Rollup merge of #73398 - oli-obk:const_raw_ptr_cmp, r=varkor,RalfJung,nagisa

A way forward for pointer equality in const eval

r? @varkor on the first commit and @RalfJung on the second commit

cc #53020

4 years agoRollup merge of #72493 - nikomatsakis:move-leak-check, r=matthewjasper
Manish Goregaokar [Tue, 23 Jun 2020 07:33:52 +0000 (00:33 -0700)]
Rollup merge of #72493 - nikomatsakis:move-leak-check, r=matthewjasper

 move leak-check to during coherence, candidate eval

Implementation of MCP https://github.com/rust-lang/compiler-team/issues/295.

I'd like to do a crater run on this.

Note to @rust-lang/lang: This PR is a breaking change (bugfix). It causes tests like the following to go from a future-compatibility warning #56105 to a hard error:

```rust
trait Trait {}
impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {}
impl Trait for for<'c> fn(&'c u32, &'c u32) {} // now rejected, used to warn
```

I am not aware of any instances of this code in the wild, but that is why we are doing a crater run. The reason for this change is that those two types are, in fact, the same type, and hence the two impls are overlapping.

There will still be impls that trigger #56105 after this lands, however -- I hope that we will eventually just accept those impls without warning, for the most part. One example of such an impl is this pattern, which is used by wasm-bindgen and other crates as well:

```rust
trait Trait {}
impl<T> Trait for fn(&T) { }
impl<T> Trait for fn(T) { } // still accepted, but warns
```

4 years agoRollup merge of #72271 - rakshith-ravi:master, r=varkor
Manish Goregaokar [Tue, 23 Jun 2020 07:33:46 +0000 (00:33 -0700)]
Rollup merge of #72271 - rakshith-ravi:master, r=varkor

Improve compiler error message for wrong generic parameter order

- Added optional "help" parameter that shows a help message on the compiler error if required.
- Added a simple ordered parameter as a sample help.

@varkor will make more changes as required. Let me know if I'm heading in the right direction.

Fixes #68437

r? @varkor

4 years agoAuto merge of #73635 - Dylan-DPC:rollup-b4wbp42, r=Dylan-DPC
bors [Tue, 23 Jun 2020 04:03:28 +0000 (04:03 +0000)]
Auto merge of #73635 - Dylan-DPC:rollup-b4wbp42, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #71756 (add Windows system error codes that should map to io::ErrorKind::TimedOut)
 - #73495 (Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits)
 - #73575 (Fix typo in error_codes doc)
 - #73578 (Make is_freeze and is_copy_modulo_regions take TyCtxtAt)
 - #73586 (switch_ty is redundant)
 - #73600 (Fix spurious 'value moved here in previous iteration of loop' messages)
 - #73610 (Clean up E0699 explanation)

Failed merges:

r? @ghost

4 years agoRollup merge of #73610 - GuillaumeGomez:cleanup-e0699, r=Dylan-DPC
Dylan DPC [Tue, 23 Jun 2020 01:16:28 +0000 (03:16 +0200)]
Rollup merge of #73610 - GuillaumeGomez:cleanup-e0699, r=Dylan-DPC

Clean up E0699 explanation

r? @Dylan-DPC

4 years agoRollup merge of #73600 - Aaron1011:fix/move-in-macro, r=ecstatic-morse
Dylan DPC [Tue, 23 Jun 2020 01:16:26 +0000 (03:16 +0200)]
Rollup merge of #73600 - Aaron1011:fix/move-in-macro, r=ecstatic-morse

Fix spurious 'value moved here in previous iteration of loop' messages

Fixes #46099

Previously, we would check the 'move' and 'use' spans to see if we
should emit this message. However, this can give false positives when
macros are involved, since two distinct expressions may end up with the
same span.

Instead, we check the actual MIR `Location`, which eliminates false
positives.

4 years agoRollup merge of #73586 - RalfJung:switch-ty, r=oli-obk
Dylan DPC [Tue, 23 Jun 2020 01:16:24 +0000 (03:16 +0200)]
Rollup merge of #73586 - RalfJung:switch-ty, r=oli-obk

switch_ty is redundant

This field is redundant, but we cannot remove it currently as pretty-printing relies on it (and it does not have access to `mir::Body` to compute the type itself).

Cc @oli-obk @matthewjasper @jonas-schievink

4 years agoRollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink
Dylan DPC [Tue, 23 Jun 2020 01:16:22 +0000 (03:16 +0200)]
Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink

Make is_freeze and is_copy_modulo_regions take TyCtxtAt

Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.

4 years agoRollup merge of #73575 - dario23:typo-errorcodes-doc, r=matthewjasper
Dylan DPC [Tue, 23 Jun 2020 01:16:21 +0000 (03:16 +0200)]
Rollup merge of #73575 - dario23:typo-errorcodes-doc, r=matthewjasper

Fix typo in error_codes doc

4 years agoRollup merge of #73495 - Lucretiel:wasi-io-impls, r=sfackler
Dylan DPC [Tue, 23 Jun 2020 01:16:19 +0000 (03:16 +0200)]
Rollup merge of #73495 - Lucretiel:wasi-io-impls, r=sfackler

Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits

Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`.

Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused #72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms.

This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.

4 years agoRollup merge of #71756 - carstenandrich:master, r=dtolnay
Dylan DPC [Tue, 23 Jun 2020 01:16:14 +0000 (03:16 +0200)]
Rollup merge of #71756 - carstenandrich:master, r=dtolnay

add Windows system error codes that should map to io::ErrorKind::TimedOut

closes #71646

**Disclaimer:** The author of this pull request has a negligible amount of experience (i.e., kinda zero) with the Windows API. This PR should _definitely_ be reviewed by someone familiar with the API and its error handling.

While porting POSIX software using serial ports to Windows, I found that for many Windows system error codes, an `io::Error` created via `io::Error::from_raw_os_error()` or `io::Error::last_os_error()` is not `io::ErrorKind::TimedOut`. For example, when a (non-overlapped) write to a COM port via [`WriteFile()`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile) times out, [`GetLastError()`](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror) returns `ERROR_SEM_TIMEOUT` ([121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)). However, an `io::Error` created from this error code will have `io::ErrorKind::Other`.

Currently, only the error codes `ERROR_OPERATION_ABORTED` and `WSAETIMEDOUT` will instantiate `io::Error`s with kind `io::ErrorKind::TimedOut`.
This makes `io::Error::last_os_error()` unsuitable for error handling of syscalls that could time out, because timeouts can not be caught by matching the error's kind against `io::ErrorKind::TimedOut`.

Downloading the [list of Windows system error codes](https://gist.github.com/carstenandrich/c331d557520b8a0e7f44689ca257f805) and grepping anything that sounds like a timeout (`egrep -i "timed?.?(out|limit)"`), I've identified the following error codes that should also have `io::ErrorKind::TimedOut`, because they could be I/O-related:

Name | Code | Description
--- | --- | ---
`ERROR_SEM_TIMEOUT` | [121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-) | The semaphore timeout period has expired.
`WAIT_TIMEOUT` | [258](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-) | The wait operation timed out.
`ERROR_DRIVER_CANCEL_TIMEOUT` | [594](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--500-999-) | The driver %hs failed to complete a cancelled I/O request in the allotted time.
`ERROR_COUNTER_TIMEOUT` | [1121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-) | A serial I/O operation completed because the timeout period expired. The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)
`ERROR_TIMEOUT` | [1460](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1300-1699-) | This operation returned because the timeout period expired.
`ERROR_CTX_MODEM_RESPONSE_TIMEOUT` | [7012](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on.
`ERROR_CTX_CLIENT_QUERY_TIMEOUT` | [7040](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The client failed to respond to the server connect message.
`ERROR_DS_TIMELIMIT_EXCEEDED` | [8226](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--8200-8999-) | The time limit for this request was exceeded.
`DNS_ERROR_RECORD_TIMED_OUT` | [9705](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--9000-11999-) | DNS record timed out.
`ERROR_IPSEC_IKE_TIMED_OUT` | [13805](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | Negotiation timed out.

The following errors are also timeouts, but they don't seem to be directly related to I/O or network operations:

Name | Code | Description
--- | --- | ---
`ERROR_SERVICE_REQUEST_TIMEOUT` | [1053](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-) | The service did not respond to the start or control request in a timely fashion.
`ERROR_RESOURCE_CALL_TIMED_OUT` | [5910](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--4000-5999-) | The call to the cluster resource DLL timed out.
`FRS_ERR_SYSVOL_POPULATE_TIMEOUT` | [8014](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The file replication service cannot populate the system volume because of an internal timeout. The event log may have more information.
`ERROR_RUNLEVEL_SWITCH_TIMEOUT` | [15402](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | The requested run level switch cannot be completed successfully since one or more services will not stop or restart within the specified timeout.
`ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT` | [15403](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | A run level switch agent did not respond within the specified timeout.

Please note that `ERROR_SEM_TIMEOUT` is the only timeout error I have [seen in action](https://gist.github.com/carstenandrich/10b3962fa1abc9e50816b6460010900b). The remainder of the error codes listed above is based purely on reading documentation.

This pull request adds all of the errors listed in both tables, but I'm not sure whether adding all of them makes sense. Someone with actual Windows API experience should decide that.

I expect these changes to be fairly backwards compatible, because only the error's [`.kind()`](https://doc.rust-lang.org/std/io/struct.Error.html#method.kind) will change, but matching the error's code via [`.raw_os_error()`](https://doc.rust-lang.org/std/io/struct.Error.html#method.raw_os_error) will not be affected.
However, code expecting these errors to be `io::ErrorKind::Other` would break. Even though I personally do not think such an implementation would make sense, after all the docs say that `io::ErrorKind` is _intended to grow over time_, a residual risk remains, of course. I took the liberty to ammend the docstring of `io::ErrorKind::Other` with a remark that discourages matching against it.

As per the contributing guidelines I'm adding @steveklabnik due to the changed documentation. Also @retep998 might have some valuable insights on the error codes.

r? @steveklabnik
cc @retep998
cc @Mark-Simulacrum

4 years agoAuto merge of #73007 - yoshuawuyts:socketaddr-from-string-u16, r=sfackler
bors [Tue, 23 Jun 2020 00:13:50 +0000 (00:13 +0000)]
Auto merge of #73007 - yoshuawuyts:socketaddr-from-string-u16, r=sfackler

impl ToSocketAddrs for (String, u16)

This adds a convenience impl of `ToSocketAddrs for (String, u16)`. When authoring HTTP services it's common to take command line options for `host` and `port` and parse them into `String` and `u16` respectively. Consider the following program:
```rust
#[derive(Debug, StructOpt)]
struct Config {
    host: String,
    port: u16,
}

async fn main() -> io::Result<()> {
    let config = Config::from_args();
    let stream = TcpStream::connect((&*config.host, config.port))?; // &* is not ideal
    // ...
}
```

Networking is a pretty common starting point for people new to Rust, and seeing `&*` in basic examples can be confusing. Even as someone that has experience with networking in Rust I tend to forget that `String` can't be passed directly there. Instead with this patch we can omit the `&*` conversion and pass `host` directly:
```rust
#[derive(Debug, StructOpt)]
struct Config {
    host: String,
    port: u16,
}

async fn main() -> io::Result<()> {
    let config = Config::from_args();
    let stream = TcpStream::connect((config.host, config.port))?; // no more conversions!
    // ...
}
```

I think should be an easy and small ergonomics improvement for networking. Thanks!

4 years agoreview comments
Esteban Küber [Mon, 22 Jun 2020 23:05:31 +0000 (16:05 -0700)]
review comments

4 years agoAuto merge of #73594 - Aaron1011:revert/move-fn-self-msg, r=Manishearth
bors [Mon, 22 Jun 2020 20:30:06 +0000 (20:30 +0000)]
Auto merge of #73594 - Aaron1011:revert/move-fn-self-msg, r=Manishearth

Revert PR #72389 - "Explain move errors that occur due to method calls involving `self"

r? @petrochenkov

4 years agocite issue 73154
Niko Matsakis [Mon, 8 Jun 2020 23:22:10 +0000 (23:22 +0000)]
cite issue 73154

4 years agofix subtle bug in NLL type checker
Niko Matsakis [Mon, 8 Jun 2020 23:12:01 +0000 (23:12 +0000)]
fix subtle bug in NLL type checker

The bug was revealed by the behavior of the old-lub-glb-hr-noteq1.rs
test. The old-lub-glb-hr-noteq2 test shows the current 'order dependent'
behavior of coercions around higher-ranked functions, at least when
running with `-Zborrowck=mir`.

Also, run compare-mode=nll.

4 years agoWIP bless test and compare-mode=nll
Niko Matsakis [Sat, 6 Jun 2020 10:31:51 +0000 (10:31 +0000)]
WIP bless test and compare-mode=nll

4 years agoadd new coherence tests and update the documentation
Niko Matsakis [Fri, 5 Jun 2020 21:14:34 +0000 (21:14 +0000)]
add new coherence tests and update the documentation

4 years agoadd new tests from MCP and the tracking issue
Niko Matsakis [Fri, 22 May 2020 11:05:09 +0000 (11:05 +0000)]
add new tests from MCP and the tracking issue

4 years agoremove `leak_check` from the outlives predicate evaluations
Niko Matsakis [Fri, 22 May 2020 18:19:54 +0000 (18:19 +0000)]
remove `leak_check` from the outlives predicate evaluations

4 years agoremove leak-check from project
Niko Matsakis [Fri, 22 May 2020 18:16:28 +0000 (18:16 +0000)]
remove leak-check from project

4 years agoremove snapshot calls from "match" operations during select
Niko Matsakis [Fri, 22 May 2020 17:48:07 +0000 (17:48 +0000)]
remove snapshot calls from "match" operations during select

Motivation:

- we want to use leak-check sparingly, first off
- these calls were essentially the same as doing the check during subtyping

4 years agoStop using old version of `syn` in `rustc-workspace-hack`
Aaron Hill [Mon, 22 Jun 2020 17:29:04 +0000 (13:29 -0400)]
Stop using old version of `syn` in `rustc-workspace-hack`

None of the tools seem to need syn 0.15.35, so we can just build syn
1.0.

This was causing an issue with clippy's `compile-test` program: since
multiple versions of `syn` would exist in the build directory, we would
non-deterministically pick one based on filesystem iteration order. If
the pre-1.0 version of `syn` was picked, a strange build error would
occur (see
https://github.com/rust-lang/rust/pull/73594#issuecomment-647671463)

To prevent this kind of issue from happening again, we now panic if we
find multiple versions of a crate in the build directly, instead of
silently picking the first version we find.

4 years agoRe-enable Clippy tests
Aaron Hill [Sun, 21 Jun 2020 20:28:58 +0000 (16:28 -0400)]
Re-enable Clippy tests

4 years agoRevert "Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, r=nikomatsakis"
Aaron Hill [Sun, 21 Jun 2020 20:28:19 +0000 (16:28 -0400)]
Revert "Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, r=nikomatsakis"

This reverts commit 372cb9b69c76a042d0b9d4b48ff6084f64c84a2c, reversing
changes made to 5c61a8dc34c3e2fc6d7f02cb288c350f0233f944.

4 years agoAuto merge of #73415 - ehuss:update-cargo, r=ehuss
bors [Mon, 22 Jun 2020 16:38:21 +0000 (16:38 +0000)]
Auto merge of #73415 - ehuss:update-cargo, r=ehuss

Update cargo

3 commits in 79c769c3d7b4c2cf6a93781575b7f592ef974255..089cbb80b73ba242efdcf5430e89f63fa3b5328d
2020-06-11 22:13:37 +0000 to 2020-06-15 14:38:34 +0000
- Support linker with -Zdoctest-xcompile. (rust-lang/cargo#8359)
- Fix doctests not running with --target=HOST. (rust-lang/cargo#8358)
- Allow passing a registry index url directly to `cargo install` (rust-lang/cargo#8344)

4 years agoupcasting traits requires only that things become more general
Niko Matsakis [Wed, 20 May 2020 14:31:51 +0000 (14:31 +0000)]
upcasting traits requires only that things become more general

Revert the code that states that upcasting traits requires full
equality and change to require that the source type is a subtype of
the target type, as one would expect. As the comment states, this was
an old bug that we didn't want to fix yet as it interacted poorly with
the old leak-check. This fixes the old-lub-glb-object test, which was
previously reporting too many errors (i.e., in the previous commit).

4 years agomove leak-check to during coherence, candidate eval
Niko Matsakis [Wed, 20 May 2020 10:19:36 +0000 (10:19 +0000)]
move leak-check to during coherence, candidate eval

In particular, it no longer occurs during the subtyping check. This is
important for enabling lazy normalization, because the subtyping check
will be producing sub-obligations that could affect its results.

Consider an example like

    for<'a> fn(<&'a as Mirror>::Item) =
      fn(&'b u8)

where `<T as Mirror>::Item = T` for all `T`. We will wish to produce a
new subobligation like

    <'!1 as Mirror>::Item = &'b u8

This will, after being solved, ultimately yield a constraint that `'!1
= 'b` which will fail. But with the leak-check being performed on
subtyping, there is no opportunity to normalize `<'!1 as
Mirror>::Item` (unless we invoke that normalization directly from
within subtyping, and I would prefer that subtyping and unification
are distinct operations rather than part of the trait solving stack).

The reason to keep the leak check during coherence and trait
evaluation is partly for backwards compatibility. The coherence change
permits impls for `fn(T)` and `fn(&T)` to co-exist, and the trait
evaluation change means that we can distinguish those two cases
without ambiguity errors. It also avoids recreating #57639, where we
were incorrectly choosing a where clause that would have failed the
leak check over the impl which succeeds.

The other reason to keep the leak check in those places is that I
think it is actually close to the model we want. To the point, I think
the trait solver ought to have the job of "breaking down"
higher-ranked region obligation like ``!1: '2` into into region
obligations that operate on things in the root universe, at which
point they should be handed off to polonius. The leak check isn't
*really* doing that -- these obligations are still handed to the
region solver to process -- but if/when we do adopt that model, the
decision to pass/fail would be happening in roughly this part of the
code.

This change had somewhat more side-effects than I anticipated. It
seems like there are cases where the leak-check was not being enforced
during method proving and trait selection. I haven't quite tracked
this down but I think it ought to be documented, so that we know what
precisely we are committing to.

One surprising test was `issue-30786.rs`. The behavior there seems a
bit "fishy" to me, but the problem is not related to the leak check
change as far as I can tell, but more to do with the closure signature
inference code and perhaps the associated type projection, which
together seem to be conspiring to produce an unexpected
signature. Nonetheless, it is an example of where changing the
leak-check can have some unexpected consequences: we're now failing to
resolve a method earlier than we were, which suggests we might change
some method resolutions that would have been ambiguous to be
successful.

TODO:

* figure out remainig test failures
* add new coherence tests for the patterns we ARE disallowing

4 years agorewrite leak check to be based on universes
Niko Matsakis [Tue, 19 May 2020 01:09:40 +0000 (01:09 +0000)]
rewrite leak check to be based on universes

In the new leak check, instead of getting a list of placeholders to
track, we look for any placeholder that is part of a universe which
was created during the snapshot.

We are looking for the following error patterns:

* P1: P2, where P1 != P2
* P1: R, where R is in some universe that cannot name P1

This new leak check is more precise than before, in that it accepts
this patterns:

* R: P1, even if R cannot name P1, because R = 'static is a valid
sol'n
* R: P1, R: P2, as above

Note that this leak check, when running during subtyping, is less
efficient than before in some sense because it is going to check and
re-check all the universes created since the snapshot. We're going to
move when the leak check runs to try and correct that.

4 years agoRevert "modify leak-check to track only outgoing edges from placeholders"
Niko Matsakis [Mon, 18 May 2020 21:43:11 +0000 (21:43 +0000)]
Revert "modify leak-check to track only outgoing edges from placeholders"

This reverts commit 2e01db4b396a1e161f7a73933fff34bc9421dba0.

4 years agomodify leak-check to track only outgoing edges from placeholders
Niko Matsakis [Mon, 18 May 2020 09:43:36 +0000 (09:43 +0000)]
modify leak-check to track only outgoing edges from placeholders

Also, update the affected tests. This seems strictly better but it is
actually more permissive than I initially intended. In particular it
accepts this

```
forall<'a, 'b> {
  exists<'intersection> {
    'a: 'intersection,
    'b: 'intersection,
  }
}
```

and I'm not sure I want to accept that. It implies that we have a
`'empty` in the new universe intoduced by the `forall`.

4 years agoAuto merge of #73617 - Dylan-DPC:rollup-zugh80o, r=Dylan-DPC
bors [Mon, 22 Jun 2020 12:59:57 +0000 (12:59 +0000)]
Auto merge of #73617 - Dylan-DPC:rollup-zugh80o, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #71660 (impl PartialEq<Vec<B>> for &[A], &mut [A])
 - #72623 (Prefer accessible paths in 'use' suggestions)
 - #73502 (Add E0765)
 - #73580 (deprecate wrapping_offset_from)
 - #73582 (Miri: replace many bug! by span_bug!)
 - #73585 (Do not send a notification for P-high stable regressions)

Failed merges:

 - #73581 (Create 0766 error code)

r? @ghost

4 years agoRollup merge of #73585 - LeSeulArtichaut:patch-3, r=Mark-Simulacrum
Dylan DPC [Mon, 22 Jun 2020 12:53:56 +0000 (14:53 +0200)]
Rollup merge of #73585 - LeSeulArtichaut:patch-3, r=Mark-Simulacrum

Do not send a notification for P-high stable regressions

This is kind of a hack to only match nightly and beta regressions, but not stable regressions. See my tests [on the playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6ff8a809162118aa2951f2ff12400067).

r? @spastorino cc @Mark-Simulacrum

4 years agoRollup merge of #73582 - RalfJung:miri-span-bug, r=oli-obk
Dylan DPC [Mon, 22 Jun 2020 12:53:54 +0000 (14:53 +0200)]
Rollup merge of #73582 - RalfJung:miri-span-bug, r=oli-obk

Miri: replace many bug! by span_bug!

r? @oli-obk

4 years agoRollup merge of #73580 - RalfJung:deprecate-wrapping-offset-from, r=Amanieu
Dylan DPC [Mon, 22 Jun 2020 12:53:52 +0000 (14:53 +0200)]
Rollup merge of #73580 - RalfJung:deprecate-wrapping-offset-from, r=Amanieu

deprecate wrapping_offset_from

As per https://github.com/rust-lang/rust/issues/41079#issuecomment-433140733 which seems like a consensus.

r? @Amanieu

4 years agoRollup merge of #73502 - GuillaumeGomez:add-e0764, r=estebank
Dylan DPC [Mon, 22 Jun 2020 12:53:50 +0000 (14:53 +0200)]
Rollup merge of #73502 - GuillaumeGomez:add-e0764, r=estebank

Add E0765

4 years agoRollup merge of #72623 - da-x:use-suggest-public-path, r=petrochenkov
Dylan DPC [Mon, 22 Jun 2020 12:53:48 +0000 (14:53 +0200)]
Rollup merge of #72623 - da-x:use-suggest-public-path, r=petrochenkov

Prefer accessible paths in 'use' suggestions

This PR addresses issue https://github.com/rust-lang/rust/issues/26454, where `use` suggestions are made for paths that don't work. For example:

```rust
mod foo {
    mod bar {
        struct X;
    }
}

fn main() { X; } // suggests `use foo::bar::X;`
```

4 years agoRollup merge of #71660 - sollyucko:master, r=dtolnay
Dylan DPC [Mon, 22 Jun 2020 12:53:46 +0000 (14:53 +0200)]
Rollup merge of #71660 - sollyucko:master, r=dtolnay

impl PartialEq<Vec<B>> for &[A], &mut [A]

https://github.com/rust-lang/rfcs/issues/2917

4 years agoClean up E0699 explanation
Guillaume Gomez [Mon, 22 Jun 2020 09:50:55 +0000 (11:50 +0200)]
Clean up E0699 explanation

4 years agobootstrap: no `config.toml` exists regression
David Wood [Sun, 21 Jun 2020 19:21:17 +0000 (20:21 +0100)]
bootstrap: no `config.toml` exists regression

This commit fixes a regression introduced in #73317 where an oversight
meant that `config.toml` was assumed to exist.

Signed-off-by: David Wood <david@davidtw.co>
4 years agoFix spurious 'value moved here in previous iteration of loop' messages
Aaron Hill [Mon, 22 Jun 2020 01:27:34 +0000 (21:27 -0400)]
Fix spurious 'value moved here in previous iteration of loop' messages

Fixes #46099

Previously, we would check the 'move' and 'use' spans to see if we
should emit this message. However, this can give false positives when
macros are involved, since two distinct expressions may end up with the
same span.

Instead, we check the actual MIR `Location`, which eliminates false
positives.

4 years agoAuto merge of #73180 - matthewjasper:predicate-cache, r=nikomatsakis
bors [Sun, 21 Jun 2020 21:05:57 +0000 (21:05 +0000)]
Auto merge of #73180 - matthewjasper:predicate-cache, r=nikomatsakis

Cache flags and escaping vars for predicates

With predicates becoming interned (rust-lang/compiler-team#285) this is now possible and could be a perf win. It would become an even larger win once we have recursive predicates.

cc @lcnr @nikomatsakis

r? @ghost

4 years agoDo not send a notification for P-high stable regressions
LeSeulArtichaut [Sun, 21 Jun 2020 16:09:58 +0000 (18:09 +0200)]
Do not send a notification for P-high stable regressions

Add comment to clarify the pattern

4 years agofmt
Ralf Jung [Sun, 21 Jun 2020 17:35:57 +0000 (19:35 +0200)]
fmt

4 years agoAuto merge of #72936 - jackh726:chalk-more, r=nikomatsakis
bors [Sun, 21 Jun 2020 17:10:09 +0000 (17:10 +0000)]
Auto merge of #72936 - jackh726:chalk-more, r=nikomatsakis

Upgrade Chalk

Things done in this PR:
- Upgrade Chalk to `0.11.0`
- Added compare-mode=chalk
- Bump rustc-hash in `librustc_data_structures` to `1.1.0` to match Chalk
- Removed `RustDefId` since the builtin type support is there
- Add a few more `FIXME(chalk)`s for problem spots I hit when running all tests with chalk
- Added some more implementation code for some newer builtin Chalk types (e.g. `FnDef`, `Array`)
- Lower `RegionOutlives` and `ObjectSafe` predicates
- Lower `Dyn` without the region
- Handle `Int`/`Float` `CanonicalVarKind`s
- Uncomment some Chalk tests that actually work now
- Remove the revisions in `src/test/ui/coherence/coherence-subtyping.rs` since they aren't doing anything different

r? @nikomatsakis

4 years agoMIR validation: check switch_ty
Ralf Jung [Sun, 21 Jun 2020 16:24:51 +0000 (18:24 +0200)]
MIR validation: check switch_ty

4 years agoremove switch_ty reliance in codegen
Ralf Jung [Sun, 21 Jun 2020 16:22:30 +0000 (18:22 +0200)]
remove switch_ty reliance in codegen

4 years agoPrefer accessible paths in 'use' suggestions
Dan Aloni [Sat, 13 Jun 2020 17:58:46 +0000 (20:58 +0300)]
Prefer accessible paths in 'use' suggestions

This fixes an issue with the following sample:

    mod foo {
mod inaccessible {
    pub struct X;
}
pub mod avail {
    pub struct X;
}
    }

    fn main() { X; }

Instead of suggesting both `use crate::foo::inaccessible::X;` and `use
crate::foo::avail::X;`, it should only suggest the latter.

It is done by trimming the list of suggestions from inaccessible paths
if accessible paths are present.

Visibility is checked with `is_accessible_from` now instead of being
hard-coded.

-

Some tests fixes are trivial, and others require a bit more explaining,
here are my comments:

src/test/ui/issues/issue-35675.stderr: Only needs to make the enum
public to have the suggestion make sense.

src/test/ui/issues/issue-42944.stderr: Importing the tuple struct won't
help because its constructor is not visible, so the attempted
constructor does not work. In that case, it's better not to suggest it.
The case where the constructor is public is covered in `issue-26545.rs`.

4 years agoUpdate src/librustc_mir/monomorphize/collector.rs
Youngsuk Kim [Sun, 21 Jun 2020 15:43:30 +0000 (11:43 -0400)]
Update src/librustc_mir/monomorphize/collector.rs

typo fix

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
4 years agoUpdate UI tests
Guillaume Gomez [Sun, 21 Jun 2020 09:24:45 +0000 (11:24 +0200)]
Update UI tests

4 years agoMiri: replace many bug! by span_bug!
Ralf Jung [Sun, 21 Jun 2020 14:13:31 +0000 (16:13 +0200)]
Miri: replace many bug! by span_bug!

4 years agoAuto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrum
bors [Sun, 21 Jun 2020 13:18:00 +0000 (13:18 +0000)]
Auto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrum

Enable LLVM zlib

Compilers may generate ELF objects with compressed sections (although rustc currently doesn't do this). Currently, when linking these with `rust-lld`, you'll get this error:

`rust-lld: error: ...: contains a compressed section, but zlib is not available`

This enables zlib when building LLVM.

4 years agoCreate E0765 error for unterminated double quote strings
Guillaume Gomez [Sun, 21 Jun 2020 09:24:35 +0000 (11:24 +0200)]
Create E0765 error for unterminated double quote strings

4 years agodeprecate wrapping_offset_from
Ralf Jung [Sun, 21 Jun 2020 10:28:33 +0000 (12:28 +0200)]
deprecate wrapping_offset_from

4 years ago`icmp` can handle raw pointers just fine, there's no need to cast to int.
Oliver Scherer [Sun, 21 Jun 2020 11:17:05 +0000 (13:17 +0200)]
`icmp` can handle raw pointers just fine, there's no need to cast to int.

4 years agoMake is_freeze and is_copy_modulo_regions take TyCtxtAt
Ralf Jung [Sun, 21 Jun 2020 09:20:48 +0000 (11:20 +0200)]
Make is_freeze and is_copy_modulo_regions take TyCtxtAt

4 years agoAuto merge of #73546 - RalfJung:miri, r=RalfJung
bors [Sun, 21 Jun 2020 09:28:26 +0000 (09:28 +0000)]
Auto merge of #73546 - RalfJung:miri, r=RalfJung

update Miri

Fixes https://github.com/rust-lang/rust/issues/73405
Cc @rust-lang/miri r? @ghost

4 years agoReplace `is_global` call on data with call on predicate
Matthew Jasper [Wed, 10 Jun 2020 08:38:13 +0000 (09:38 +0100)]
Replace `is_global` call on data with call on predicate

4 years agoCache flags and escaping vars for predicates
Matthew Jasper [Wed, 10 Jun 2020 08:30:39 +0000 (09:30 +0100)]
Cache flags and escaping vars for predicates

Also hash predicates by address

4 years agoCache decoded predicate shorthands
Matthew Jasper [Wed, 10 Jun 2020 08:26:54 +0000 (09:26 +0100)]
Cache decoded predicate shorthands

4 years agoFix typo in error_codes doc
Johannes Schilling [Sun, 21 Jun 2020 08:22:19 +0000 (10:22 +0200)]
Fix typo in error_codes doc

4 years agoAuto merge of #71911 - wesleywiser:const_prop_small_cleanups, r=oli-obk
bors [Sun, 21 Jun 2020 05:56:26 +0000 (05:56 +0000)]
Auto merge of #71911 - wesleywiser:const_prop_small_cleanups, r=oli-obk

[mir-opt] Small ConstProp cleanup

4 years agoFix typos in doc comments
Youngsuk Kim [Sun, 21 Jun 2020 02:53:51 +0000 (22:53 -0400)]
Fix typos in doc comments

This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'

4 years agoAuto merge of #70946 - jumbatm:clashing-extern-decl, r=nagisa
bors [Sun, 21 Jun 2020 02:20:07 +0000 (02:20 +0000)]
Auto merge of #70946 - jumbatm:clashing-extern-decl, r=nagisa

Add a lint to catch clashing `extern` fn declarations.

Closes #69390.

Adds lint `clashing_extern_decl` to detect when, within a single crate, an extern function of the same name is declared with different types. Because two symbols of the same name cannot be resolved to two different functions at link time, and one function cannot possibly have two types, a clashing extern declaration is almost certainly a mistake.

This lint does not run between crates because a project may have dependencies which both rely on the same extern function, but declare it in a different (but valid) way. For example, they may both declare an opaque type for one or more of the arguments (which would end up distinct types), or use types that are valid conversions in the language the extern fn is defined in. In these cases, we can't say that the clashing declaration is incorrect.

r? @eddyb

4 years agoClarify --extern documentation.
Adrian Taylor [Sun, 21 Jun 2020 00:02:18 +0000 (17:02 -0700)]
Clarify --extern documentation.

Fixes #64731, #73531.

See also #64402#issuecomment-530852886

4 years agoUpdate stability attribute of new Vec PartialEq impls
David Tolnay [Sat, 20 Jun 2020 23:02:21 +0000 (16:02 -0700)]
Update stability attribute of new Vec PartialEq impls

4 years agoAuto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth
bors [Sat, 20 Jun 2020 22:53:46 +0000 (22:53 +0000)]
Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth

Rollup of 9 pull requests

Successful merges:

 - #72456 (Try to suggest dereferences on trait selection failed)
 - #72788 (Projection bound validation)
 - #72790 (core/time: Add Duration methods for zero)
 - #73227 (Allow multiple `asm!` options groups and report an error on duplicate options)
 - #73287 (lint: normalize projections using opaque types)
 - #73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs)
 - #73378 (Remove use of specialization from librustc_arena)
 - #73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15))
 - #73443 (ci: allow gating GHA on everything but macOS)

Failed merges:

r? @ghost

4 years agoimpl PartialEq<Vec<B>> for &[A], &mut [A]
Solomon Ucko [Wed, 29 Apr 2020 02:40:18 +0000 (22:40 -0400)]
impl PartialEq<Vec<B>> for &[A], &mut [A]

4 years agoRollup merge of #73443 - pietroalbini:gha-auto-fallible, r=Mark-Simulacrum
Manish Goregaokar [Sat, 20 Jun 2020 21:45:04 +0000 (14:45 -0700)]
Rollup merge of #73443 - pietroalbini:gha-auto-fallible, r=Mark-Simulacrum

ci: allow gating GHA on everything but macOS

In our GitHub Actions setup macOS is too unreliable to gate on it, but the other builders work fine. This commit splits the macOS builders into a separate job (called `auto-fallible`), allowing us to gate on the auto job without failing due to macOS spurious failures.

cc https://github.com/rust-lang/rust-central-station/issues/848
r? @Mark-Simulacrum

4 years agoRollup merge of #73411 - ehuss:bump-stage0, r=Mark-Simulacrum
Manish Goregaokar [Sat, 20 Jun 2020 21:45:02 +0000 (14:45 -0700)]
Rollup merge of #73411 - ehuss:bump-stage0, r=Mark-Simulacrum

Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)

Pulls in changes from #73326.

Closes #73286

4 years agoRollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk
Manish Goregaokar [Sat, 20 Jun 2020 21:45:00 +0000 (14:45 -0700)]
Rollup merge of #73378 - matthewjasper:arena-not-special, r=oli-obk

Remove use of specialization from librustc_arena

This reworks the macro so that specialization, `transmute` and `#[marker]` are not used.

r? @oli-obk

4 years agoRollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petrochenkov
Manish Goregaokar [Sat, 20 Jun 2020 21:44:58 +0000 (14:44 -0700)]
Rollup merge of #73291 - marmeladema:hir-id-ification-fix, r=petrochenkov

Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs

cc #50928

I don't know who is exactly the best person to review this.

r? @petrochenkov

4 years agoRollup merge of #73287 - davidtwco:issue-73251-opaque-types-in-projections, r=estebank
Manish Goregaokar [Sat, 20 Jun 2020 21:44:57 +0000 (14:44 -0700)]
Rollup merge of #73287 - davidtwco:issue-73251-opaque-types-in-projections, r=estebank

lint: normalize projections using opaque types

Fixes #73251.

This PR normalizes projections which use opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this PR fail).

4 years agoRollup merge of #73227 - camelid:multiple-asm-options, r=Amanieu
Manish Goregaokar [Sat, 20 Jun 2020 21:44:55 +0000 (14:44 -0700)]
Rollup merge of #73227 - camelid:multiple-asm-options, r=Amanieu

Allow multiple `asm!` options groups and report an error on duplicate options

Fixes #73193

Cc @joshtriplett @Amanieu

- [x] Allow multiple options
- [x] Update existing test
- [x] Add new tests
- [x] Check for duplicate options
- [x] Add duplicate options tests
- [x] Finalize suggestion format for duplicate options error

4 years agoRollup merge of #72790 - jonhoo:duration-is-zero, r=LukasKalbertodt
Manish Goregaokar [Sat, 20 Jun 2020 21:44:53 +0000 (14:44 -0700)]
Rollup merge of #72790 - jonhoo:duration-is-zero, r=LukasKalbertodt

core/time: Add Duration methods for zero

This patch adds two methods to `Duration`. The first, `Duration::zero`,
provides a `const` constructor for getting an zero-length duration. This
is also what `Default` provides (this was clarified in the docs), though
`default` is not `const`.

The second, `Duration::is_zero`, returns true if a `Duration` spans no
time (i.e., because its components are all zero). Previously, the way to
do this was either to compare both `as_secs` and `subsec_nanos` to 0, to
compare against `Duration::new(0, 0)`, or to use the `u128` method
`as_nanos`, none of which were particularly elegant.

4 years agoRollup merge of #72788 - matthewjasper:projection-bound-validation, r=nikomatsakis
Manish Goregaokar [Sat, 20 Jun 2020 21:44:52 +0000 (14:44 -0700)]
Rollup merge of #72788 - matthewjasper:projection-bound-validation, r=nikomatsakis

Projection bound validation

During selection we use bounds declared on associated types (e.g. `type X: Copy`) to satisfy trait/projection bounds. This would be fine so long as those bounds are checked on any impls/trait objects. For simple cases they are because the bound `Self::X: Copy` gets normalized when we check the impl.

However, for default values with specialization and higher-ranked bounds from GATs or otherwise, we can't normalize when checking the impl, and so we use the bound from the trait to prove that the bound applies to the impl, which is clearly unsound.

This PR makes 2 fixes for this:

1. Requiring that the bounds on the trait apply to a projection type with the corresponding substs, so a bound `for<'a> <Self as X<'a>>::U: Copy` on the trait cannot be used to prove `<T as X<'_>>::U: Copy`.
2. Actually checking that the bounds that we still allow apply to generic/default associated types.

Opening for a crater run.

Closes #68641
Closes #68642
Closes #68643
Closes #68644
Closes #68645
Closes #68656

r? @ghost

4 years agoRollup merge of #72456 - ldm0:dereftrait, r=estebank
Manish Goregaokar [Sat, 20 Jun 2020 21:44:50 +0000 (14:44 -0700)]
Rollup merge of #72456 - ldm0:dereftrait, r=estebank

Try to suggest dereferences on trait selection failed

Fixes #39029 Fixes #62530
This PR consists of two parts:
1. Decouple `Autoderef` with `FnCtxt` and move `Autoderef` to `librustc_trait_selection`.
2. Try to suggest dereferences when trait selection failed.

The first is needed because:
1. For suggesting dereferences, the struct `Autoderef` should be used. But before this PR, it is placed in `librustc_typeck`, which depends on `librustc_trait_selection`. But trait selection error emitting happens in `librustc_trait_selection`, if we want to use `Autoderef` in it, dependency loop is inevitable. So I moved the `Autoderef` to `librustc_trait_selection`.
2. Before this PR, `FnCtxt` is coupled to `Autoderef`, and `FnCtxt` only exists in `librustc_typeck`. So decoupling is needed.

After this PR, we can get suggestion like this:
```
error[E0277]: the trait bound `&Baz: Happy` is not satisfied
  --> $DIR/trait-suggest-deferences-multiple.rs:34:9
   |
LL | fn foo<T>(_: T) where T: Happy {}
   |                          ----- required by this bound in `foo`
...
LL |     foo(&baz);
   |         ^^^^
   |         |
   |         the trait `Happy` is not implemented for `&Baz`
   |         help: consider adding dereference here: `&***baz`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
```

r? @estebank

4 years agoupdate tests
Christian Poveda [Sat, 20 Jun 2020 20:38:57 +0000 (20:38 +0000)]
update tests

4 years agoFix broken inner_deref doc tests.
Eric Huss [Sat, 20 Jun 2020 19:27:16 +0000 (12:27 -0700)]
Fix broken inner_deref doc tests.

4 years agoAuto merge of #73550 - RalfJung:rollup-5huj1k1, r=RalfJung
bors [Sat, 20 Jun 2020 19:14:52 +0000 (19:14 +0000)]
Auto merge of #73550 - RalfJung:rollup-5huj1k1, r=RalfJung

Rollup of 9 pull requests

Successful merges:

 - #72600 (Properly encode AnonConst into crate metadata)
 - #73055 (remove leftover mentions of `skol` and `int` from the compiler)
 - #73058 (Support sanitizers on aarch64-unknown-linux-gnu)
 - #73171 (RISC-V Emulated Testing)
 - #73404 (Update CFGuard syntax)
 - #73444 (ci: disable alt build during try builds)
 - #73471 (Prevent attacker from manipulating FPU tag word used in SGX enclave)
 - #73539 (Deprecate `Vec::remove_item`)
 - #73543 (Clean up E0695 explanation)

Failed merges:

r? @ghost

4 years agoUpdate bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)
Eric Huss [Tue, 16 Jun 2020 15:52:00 +0000 (08:52 -0700)]
Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)

4 years agoRun `./x.py fmt`
Camelid [Sat, 20 Jun 2020 03:25:36 +0000 (20:25 -0700)]
Run `./x.py fmt`

4 years agoFix duplicate options error
Camelid [Sat, 20 Jun 2020 03:18:32 +0000 (20:18 -0700)]
Fix duplicate options error

The UI isn't glitching anymore.

4 years agoUse `p.token` instead of `p.look_ahead()`
Camelid [Thu, 18 Jun 2020 02:02:57 +0000 (19:02 -0700)]
Use `p.token` instead of `p.look_ahead()`

4 years agoAdd documentation
Camelid [Wed, 17 Jun 2020 01:10:26 +0000 (18:10 -0700)]
Add documentation

4 years agoCreate a separate, tool-only suggestion for the comma
Camelid [Tue, 16 Jun 2020 19:43:03 +0000 (12:43 -0700)]
Create a separate, tool-only suggestion for the comma

That way the comma isn't highlighted as part of the option in the UI.

Weirdly, the comma removal suggestion shows up in the UI.

4 years agoMake suggestion machine-applicable
Camelid [Tue, 16 Jun 2020 19:32:13 +0000 (12:32 -0700)]
Make suggestion machine-applicable

4 years agoAdd more to duplicate options test
Camelid [Tue, 16 Jun 2020 19:03:19 +0000 (12:03 -0700)]
Add more to duplicate options test

4 years agoUse `span_suggestion` instead of `span_label`
Camelid [Tue, 16 Jun 2020 18:54:12 +0000 (11:54 -0700)]
Use `span_suggestion` instead of `span_label`

4 years agoUse bitflags function instead of custom one
Camelid [Mon, 15 Jun 2020 20:30:13 +0000 (13:30 -0700)]
Use bitflags function instead of custom one