]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #73353 - davidtwco:issue-73003-non-structural-match-ty-closures,...
Ralf Jung [Mon, 15 Jun 2020 07:57:37 +0000 (09:57 +0200)]
Rollup merge of #73353 - davidtwco:issue-73003-non-structural-match-ty-closures, r=varkor

structural_match: non-structural-match ty closures

Fixes #73003.

This PR adds a `Closure` variant to `NonStructuralMatchTy` in `structural_match`, fixing an ICE which can occur when `impl_trait_in_bindings` is used with constants.

4 years agoRollup merge of #73351 - gnodarse:patch-1, r=ecstatic-morse
Ralf Jung [Mon, 15 Jun 2020 07:57:35 +0000 (09:57 +0200)]
Rollup merge of #73351 - gnodarse:patch-1, r=ecstatic-morse

Update E0446.md

The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
https://github.com/rust-lang/rust/issues/30905
https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958

4 years agoRollup merge of #73342 - schteve:master, r=jonas-schievink
Ralf Jung [Mon, 15 Jun 2020 07:57:33 +0000 (09:57 +0200)]
Rollup merge of #73342 - schteve:master, r=jonas-schievink

Fix iterator copied() documentation example code

The documentation for copied() gives example code with variable v_cloned instead of v_copied. This seems like a copy/paste error from cloned() and it would be clearer to use v_copied.

4 years agoRollup merge of #73341 - jonas-schievink:matchdoc, r=davidtwco
Ralf Jung [Mon, 15 Jun 2020 07:57:32 +0000 (09:57 +0200)]
Rollup merge of #73341 - jonas-schievink:matchdoc, r=davidtwco

_match.rs: fix module doc comment

It was applied to a `use` item, not to the module

4 years agoRollup merge of #73336 - lzutao:pattern-group, r=sfackler
Ralf Jung [Mon, 15 Jun 2020 07:57:30 +0000 (09:57 +0200)]
Rollup merge of #73336 - lzutao:pattern-group, r=sfackler

Group `Pattern::strip_*` method together

4 years agoRollup merge of #72598 - Aaron1011:feature/fnmut-capture-span, r=nikomatsakis
Ralf Jung [Mon, 15 Jun 2020 07:57:28 +0000 (09:57 +0200)]
Rollup merge of #72598 - Aaron1011:feature/fnmut-capture-span, r=nikomatsakis

Display information about captured variable in `FnMut` error

Fixes #69446

When we encounter a region error involving an `FnMut` closure, we
display a specialized error message. However, we currently do not
tell the user which upvar was captured. This makes it difficult to
determine the cause of the error, especially when the closure is large.

This commit records marks constraints involving closure upvars
with `ConstraintCategory::ClosureUpvar`. When we decide to 'blame'
a `ConstraintCategory::Return`, we additionall store
the captured upvar if we found a `ConstraintCategory::ClosureUpvar` in
the path.

When generating an error message, we point to relevant spans if we have
closure upvar information available. We further customize the message if
an `async` closure is being returned, to make it clear that the captured
variable is being returned indirectly.

4 years agoRollup merge of #72584 - CAD97:stabilize-58957, r=dtolnay
Ralf Jung [Mon, 15 Jun 2020 07:57:26 +0000 (09:57 +0200)]
Rollup merge of #72584 - CAD97:stabilize-58957, r=dtolnay

Stabilize vec::Drain::as_slice

and add `AsRef<[T]> for Drain<'_, T>`.

Tracking issue: #58957. Does not stabilize `slice::IterMut::as_slice` yet. cc @cuviper
This PR proposes stabilizing just the `vec::Drain::as_slice` part of that tracking issue.

My ultimate goal here: being able to use `for<T, I: Iterator<Item=T> + AsRef<[T]>> I` to refer to `vec::IntoIter`, `vec::Drain`, and eventually `array::IntoIter`, as an approximation of the set of by-value iterators that can be "previewed" as by-ref iterators. (Actually expressing that as a trait requires GAT.)

4 years agoRollup merge of #72556 - matthew-mcallister:trait-alias-inherent-impl, r=estebank
Ralf Jung [Mon, 15 Jun 2020 07:57:24 +0000 (09:57 +0200)]
Rollup merge of #72556 - matthew-mcallister:trait-alias-inherent-impl, r=estebank

Fix trait alias inherent impl resolution

Fixes #60021 and fixes #72415.

Obviously, the fix was very easy, but getting started with the testing and debugging rust compiler was an interesting experience. Now I can cross it off my bucket list!

4 years agoRollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, r=nikomatsakis
Ralf Jung [Mon, 15 Jun 2020 07:57:22 +0000 (09:57 +0200)]
Rollup merge of #72389 - Aaron1011:feature/move-fn-self-msg, r=nikomatsakis

Explain move errors that occur due to method calls involving `self`

When calling a method that takes `self` (e.g. `vec.into_iter()`), the method receiver is moved out of. If the method receiver is used again, a move error will be emitted::

```rust
fn main() {
    let a = vec![true];
    a.into_iter();
    a;
}
```

emits

```
error[E0382]: use of moved value: `a`
 --> src/main.rs:4:5
  |
2 |     let a = vec![true];
  |         - move occurs because `a` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
3 |     a.into_iter();
  |     - value moved here
4 |     a;
  |     ^ value used here after move
```

However, the error message doesn't make it clear that the move is caused by the call to `into_iter`.

This PR adds additional messages to move errors when the move is caused by using a value as the receiver of a `self` method::

```
error[E0382]: use of moved value: `a`
   --> vec.rs:4:5
    |
2   |     let a = vec![true];
    |         - move occurs because `a` has type `std::vec::Vec<bool>`, which does not implement the `Copy` trait
3   |     a.into_iter();
    |     ------------- value moved due to this method call
4   |     a;
    |     ^ value used here after move
    |
note: this function takes `self`, which moves the receiver
   --> /home/aaron/repos/rust/src/libcore/iter/traits/collect.rs:239:5
    |
239 |     fn into_iter(self) -> Self::IntoIter;
```

TODO:

- [x] Add special handling for `FnOnce/FnMut/Fn` - we probably don't want to point at the unstable trait methods
- [x] Consider adding additional context for operations (e.g. `Shr::shr`) when the call was generated using the operator syntax (e.g. `a >> b`)
- [x] Consider pointing to the method parent (impl or trait block) in addition to the method itself.

4 years agoRollup merge of #71824 - ecstatic-morse:const-check-post-drop-elab, r=oli-obk
Ralf Jung [Mon, 15 Jun 2020 07:57:20 +0000 (09:57 +0200)]
Rollup merge of #71824 - ecstatic-morse:const-check-post-drop-elab, r=oli-obk

Check for live drops in constants after drop elaboration

Resolves #66753.

This PR splits the MIR "optimization" pass series in two and introduces a query–`mir_drops_elaborated_and_const_checked`–that holds the result of the `post_borrowck_cleanup` analyses and checks for live drops. This query is invoked in `rustc_interface` for all items requiring const-checking, which means we now do `post_borrowck_cleanup` for items even if they are unused in the crate.

As a result, we are now more precise about when drops are live. This is because drop elaboration can e.g. eliminate drops of a local when all its fields are moved from. This does not mean we are doing value-based analysis on move paths, however; Storing a `Some(CustomDropImpl)` into a field of a local will still set the qualifs for that entire local.

r? @oli-obk

4 years agoUpdate E0446.md
gnodarse [Sun, 14 Jun 2020 18:25:19 +0000 (14:25 -0400)]
Update E0446.md

The existing error documentation did not show how to use a child module's functions if the types used in those functions are private. These are some other places this problem has popped up that did not present a solution (these are from before the solution existed, 2016-2017. The solution was released in the Rust 2018 edition. However these were the places I was pointed to when I encountered the problem myself):
https://github.com/rust-lang/rust/issues/30905
https://stackoverflow.com/questions/39334430/how-to-reference-private-types-from-public-functions-in-private-modules/62374958#62374958

4 years agostructural_match: non-structural-match ty closures
David Wood [Sun, 14 Jun 2020 18:16:35 +0000 (19:16 +0100)]
structural_match: non-structural-match ty closures

This commit adds a `Closure` variant to `NonStructuralMatchTy` in
`structural_match`, fixing an ICE which can occur when
`impl_trait_in_bindings` is used with constants.

Signed-off-by: David Wood <david@davidtw.co>
4 years agoFix iterator copied() documentation example code
Steve Heindel [Sun, 14 Jun 2020 12:53:23 +0000 (08:53 -0400)]
Fix iterator copied() documentation example code

4 years ago_match.rs: fix module doc comment
Jonas Schievink [Sun, 14 Jun 2020 12:53:36 +0000 (14:53 +0200)]
_match.rs: fix module doc comment

It was applied to a `use` item, not to the module

4 years agoAuto merge of #73089 - tmiasko:musl-1.1.24, r=kennytm
bors [Sun, 14 Jun 2020 10:37:36 +0000 (10:37 +0000)]
Auto merge of #73089 - tmiasko:musl-1.1.24, r=kennytm

Update musl to 1.1.24

Release notes since previous version 1.1.22:

## 1.1.23 release notes

### new features:
- riscv64 port
- configure now allows customizing AR and RANLIB vars
- header-level support for new linux features in 5.1

### major internal changes:
- removed extern __syscall; syscall header code is now fully self-contained

### performance:
- new math library implementation for log/exp/pow
- aarch64 dynamic tlsdesc function is streamlined

### compatibility & conformance:
- O_TTY_INIT is now defined
- sys/types.h no longer pollutes namespace with sys/sysmacros.h in any profile
- powerpc asm is now compatible with clang internal assembler

### changes for new POSIX interpretations:
- fgetwc now sets stream error indicator on encoding errors
- fmemopen no longer rejects 0 size

### bugs fixed:
- static TLS for shared libraries was allocated wrong on "Variant I" archs
- crash in dladdr reading through uninitialized pointer on non-match
- sigaltstack wrongly errored out on invalid ss_size when doing SS_DISABLE
- getdents function misbehaved with buffer length larger than INT_MAX
- set*id could deadlock after fork from multithreaded process

### arch-specfic bugs fixed:
- s390x SO_PEERSEC definition was wrong
- passing of 64-bit syscall arguments was broken on microblaze
- posix_fadvise was broken on mips due to missing 7-arg syscall support
- vrregset_t layout and member naming was wrong on powerpc64

## 1.1.24 release notes

### new features:
- GLOB_TILDE extension to glob
- non-stub catgets localization API, using netbsd binary catalog format
- posix_spawn file actions for [f]chdir (extension, pending future standard)
- secure_getenv function (extension)
- copy_file_range syscall wrapper (Linux extension)
- header-level support for new linux features in 5.2

### performance:
- new fast path for lrint (generic C version) on 32-bit archs

### major internal changes:
- functions involving time are overhauled to be time64-ready in 32-bit archs
- x32 uses the new time64 code paths to replace nasty hacks in syscall glue

### compatibility & conformance:
- support for powerpc[64] unaligned relocation types
- powerpc[64] and sh sys/user.h no longer clash with kernel asm/ptrace.h
- select no longer modifies timeout on failure (or at all)
- mips64 stat results are no longer limited to 32-bit time range
- optreset (BSD extension) now has a public declaration
- support for clang inconsistencies in wchar_t type vs some 32-bit archs
- mips r6 syscall asm no longer has invalid lo/hi register clobbers
- vestigial asm declarations of __tls_get_new are removed (broke some tooling)
- riscv64 mcontext_t mismatch glibc's member naming is corrected

### bugs fixed:
- glob failed to match broken symlinks consistently
- invalid use of interposed calloc to allocate initial TLS
- various dlsym symbol resolution logic errors
- semctl with SEM_STAT_ANY didn't work
- pthread_create with explicit scheduling was subject to priority inversion
- pthread_create failure path had data race for thread count
- timer_create with SIGEV_THREAD notification had data race getting timer id
- wide printf family failed to support l modifier for float formats

### arch-specific bugs fixed:
- x87 floating point stack imbalance in math asm (i386-only CVE-2019-14697)
- x32 clock_adjtime, getrusage, wait3, wait4 produced junk (struct mismatches)
- lseek broken on x32 and mipsn32 with large file offsets
- riscv64 atomics weren't compiler barriers
- riscv64 atomics had broken asm constraints (missing earlyclobber flag)
- arm clone() was broken when compiled as thumb if start function returned
- mipsr6 setjmp/longjmp did not preserve fpu register state correctly

Fixes #71099.

4 years agoAuto merge of #73232 - RalfJung:miri-no-default, r=Mark-Simulacrum
bors [Sun, 14 Jun 2020 06:42:40 +0000 (06:42 +0000)]
Auto merge of #73232 - RalfJung:miri-no-default, r=Mark-Simulacrum

x.py: do not build Miri by default on stable/beta

Fixes https://github.com/rust-lang/rust/issues/73117

Do I need to do anything to make sure Miri is still built by the tools CI builder? Are there other tools that should be off-by-default?

Also, unfortunately the `DEFAULT` associated const has no doc comment, so I have no idea what it does, or why there are semmingly two places where the default build of tools is controlled.

4 years agoAuto merge of #73188 - mati865:use-preinstalled-msys2, r=pietroalbini
bors [Sun, 14 Jun 2020 03:10:53 +0000 (03:10 +0000)]
Auto merge of #73188 - mati865:use-preinstalled-msys2, r=pietroalbini

Use preinstalled msys2

Fixes https://github.com/rust-lang/rust/issues/65767

4 years agoGroup Pattern::strip_* method together
Lzu Tao [Sun, 14 Jun 2020 01:01:07 +0000 (01:01 +0000)]
Group Pattern::strip_* method together

4 years agoAdd tests for `const_precise_live_drops`
Dylan MacKenzie [Thu, 11 Jun 2020 22:08:53 +0000 (15:08 -0700)]
Add tests for `const_precise_live_drops`

4 years agoUpdate incorrect error code docs
Dylan MacKenzie [Sun, 3 May 2020 19:41:48 +0000 (12:41 -0700)]
Update incorrect error code docs

4 years agoEnsure that `drop_elaboration_and_check_consts` runs for all const items
Dylan MacKenzie [Sun, 3 May 2020 04:16:55 +0000 (21:16 -0700)]
Ensure that `drop_elaboration_and_check_consts` runs for all const items

4 years agoAdd MIR phase and query for drop elaboration
Dylan MacKenzie [Sun, 3 May 2020 04:16:17 +0000 (21:16 -0700)]
Add MIR phase and query for drop elaboration

4 years agoAdd `CheckLiveDrops` pass
Dylan MacKenzie [Sun, 3 May 2020 18:18:26 +0000 (11:18 -0700)]
Add `CheckLiveDrops` pass

4 years agoAdd feature gate for precise live drop checking
Dylan MacKenzie [Thu, 11 Jun 2020 21:30:19 +0000 (14:30 -0700)]
Add feature gate for precise live drop checking

4 years agoMake `Qualifs` getters public
Dylan MacKenzie [Fri, 1 May 2020 04:04:59 +0000 (21:04 -0700)]
Make `Qualifs` getters public

4 years agoMove `check_op` logic to `ops` module
Dylan MacKenzie [Fri, 1 May 2020 04:04:46 +0000 (21:04 -0700)]
Move `check_op` logic to `ops` module

4 years agoAuto merge of #73316 - Dylan-DPC:rollup-zgouwou, r=Dylan-DPC
bors [Sat, 13 Jun 2020 15:50:56 +0000 (15:50 +0000)]
Auto merge of #73316 - Dylan-DPC:rollup-zgouwou, r=Dylan-DPC

Rollup of 8 pull requests

Successful merges:

 - #72932 (Clarify the behaviour of Pattern when used with methods like str::contains)
 - #73066 (Querify whether a type has structural equality (Take 2))
 - #73194 (Prefer the associated constants for pattern matching error)
 - #73241 (Add/update comments about MinGW late_link_args)
 - #73267 (Use the built cargo for cargotest.)
 - #73290 (Fix links when pinging notification groups)
 - #73302 (Adjusted some doctests in libcore to use `should_panic`.)
 - #73308 (pretty/asm.rs should only be tested for x86_64 and not AArch64)

Failed merges:

r? @ghost

4 years agoRollup merge of #73308 - yerke:fix-pretty-asm-rs-test-for-aarch64, r=Amanieu
Dylan DPC [Sat, 13 Jun 2020 14:47:56 +0000 (16:47 +0200)]
Rollup merge of #73308 - yerke:fix-pretty-asm-rs-test-for-aarch64, r=Amanieu

pretty/asm.rs should only be tested for x86_64 and not AArch64

pretty/asm.rs should only be tested for x86_64 and not AArch64
closes #73134
r?  @Amanieu

4 years agoRollup merge of #73302 - JakobDegen:should-panic-documentation, r=Mark-Simulacrum
Dylan DPC [Sat, 13 Jun 2020 14:47:54 +0000 (16:47 +0200)]
Rollup merge of #73302 - JakobDegen:should-panic-documentation, r=Mark-Simulacrum

Adjusted some doctests in libcore to use `should_panic`.

Fixes #73196 .

I grepped libstd and libcore for all the instances of this pattern that I could find, but its possible that I missed some of course. If anyone knows of any more, please let me know and I will add them to the PR.

4 years agoRollup merge of #73290 - LeSeulArtichaut:patch-1, r=Dylan-DPC
Dylan DPC [Sat, 13 Jun 2020 14:47:53 +0000 (16:47 +0200)]
Rollup merge of #73290 - LeSeulArtichaut:patch-1, r=Dylan-DPC

Fix links when pinging notification groups

I think a blank line is necessary for the link to be applied.
Not sure who to assign, r? @Dylan-DPC

4 years agoRollup merge of #73267 - ehuss:cargotest-this-cargo, r=Mark-Simulacrum
Dylan DPC [Sat, 13 Jun 2020 14:47:51 +0000 (16:47 +0200)]
Rollup merge of #73267 - ehuss:cargotest-this-cargo, r=Mark-Simulacrum

Use the built cargo for cargotest.

cargotest was using the beta (bootstrap) cargo. This changes it so that it will use the locally built cargo. This is intended to provide a sort of smoke test to ensure Cargo is functional. This *shouldn't* have any real impact on the CI build time.  The cargotest job also happens to run cargo's testsuite, so it should already be building cargo.

Note: This will fail until #73266 is merged.

4 years agoRollup merge of #73241 - mati865:mingw-libs-order-comment, r=petrochenkov
Dylan DPC [Sat, 13 Jun 2020 14:47:49 +0000 (16:47 +0200)]
Rollup merge of #73241 - mati865:mingw-libs-order-comment, r=petrochenkov

Add/update comments about MinGW late_link_args

4 years agoRollup merge of #73194 - lzutao:INT-patterns, r=dtolnay
Dylan DPC [Sat, 13 Jun 2020 14:47:47 +0000 (16:47 +0200)]
Rollup merge of #73194 - lzutao:INT-patterns, r=dtolnay

Prefer the associated constants for pattern matching error

Resolved this comment: https://github.com/rust-lang/rust/issues/68490#issuecomment-641614383

4 years agoRollup merge of #73066 - ecstatic-morse:query-structural-eq2, r=pnkfelix
Dylan DPC [Sat, 13 Jun 2020 14:47:45 +0000 (16:47 +0200)]
Rollup merge of #73066 - ecstatic-morse:query-structural-eq2, r=pnkfelix

Querify whether a type has structural equality (Take 2)

Alternative to #72177.

Unlike in #72177, this helper method works for all types, falling back to a query for `TyKind::Adt`s that determines whether the `{Partial,}StructuralEq` traits are implemented.

This is my preferred interface for this method. I think this is better than just documenting that the helper only works for ADTs. If others disagree, we can just merge #72177 with the fixes applied. This has already taken far too long.

4 years agoRollup merge of #72932 - poliorcetics:pattern-contains-behaviour, r=hanna-kruppe
Dylan DPC [Sat, 13 Jun 2020 14:47:40 +0000 (16:47 +0200)]
Rollup merge of #72932 - poliorcetics:pattern-contains-behaviour, r=hanna-kruppe

Clarify the behaviour of Pattern when used with methods like str::contains

Fixes #45507.

I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).

4 years agoAdd/update comments about MinGW late_link_args
Mateusz Mikuła [Thu, 11 Jun 2020 15:22:30 +0000 (17:22 +0200)]
Add/update comments about MinGW late_link_args

4 years agopretty/asm.rs should only be tested for x86_64 and not AArch64
Yerkebulan Tulibergenov [Sat, 13 Jun 2020 07:41:39 +0000 (00:41 -0700)]
pretty/asm.rs should only be tested for x86_64 and not AArch64

4 years agoAdjusted some doctests in libcore to use `should_panic`.
Jake Degen [Sat, 13 Jun 2020 04:06:09 +0000 (00:06 -0400)]
Adjusted some doctests in libcore to use `should_panic`.

Previously, some doctests were spawning new threads and joining them to
indicate that a particular call should panic; this hurt readability, so
the tests have been adjusted to simply call the method and use the
`should_panic` marker.

4 years agoPrefer the associated consts for pattern matching error
Lzu Tao [Thu, 11 Jun 2020 03:03:59 +0000 (03:03 +0000)]
Prefer the associated consts for pattern matching error

4 years agoAuto merge of #73277 - RalfJung:miri-caller-location, r=oli-obk
bors [Sat, 13 Jun 2020 00:55:34 +0000 (00:55 +0000)]
Auto merge of #73277 - RalfJung:miri-caller-location, r=oli-obk

fix caller_location intrinsic for Miri

Fixes https://github.com/rust-lang/rust/issues/73272

r? @oli-obk Cc @Aaron1011

4 years agoAuto merge of #73262 - wesleywiser:simplifyarmidentity_beta_regression, r=oli-obk
bors [Fri, 12 Jun 2020 19:38:15 +0000 (19:38 +0000)]
Auto merge of #73262 - wesleywiser:simplifyarmidentity_beta_regression, r=oli-obk

Disable the `SimplifyArmIdentity` pass

This pass is buggy so I'm disabling it to fix a stable-to-beta
regression.

Related to #73223

4 years agoFix links when pinging notification groups
LeSeulArtichaut [Fri, 12 Jun 2020 18:33:18 +0000 (20:33 +0200)]
Fix links when pinging notification groups

4 years agoMake `type_marked_structural` private
Dylan MacKenzie [Fri, 12 Jun 2020 15:47:26 +0000 (08:47 -0700)]
Make `type_marked_structural` private

4 years agoUse "reflexive equality" in docs
Dylan MacKenzie [Fri, 12 Jun 2020 15:47:13 +0000 (08:47 -0700)]
Use "reflexive equality" in docs

4 years agoHelper method for whether type has structural equality
Dylan MacKenzie [Wed, 13 May 2020 20:40:22 +0000 (13:40 -0700)]
Helper method for whether type has structural equality

This helper method works for all types, falling back to a query for
`TyKind::Adt`s to determine whether the implement the
`{Partial,}StructuralEq` traits.

4 years agoAuto merge of #73276 - Dylan-DPC:rollup-hfd81qw, r=Dylan-DPC
bors [Fri, 12 Jun 2020 13:10:57 +0000 (13:10 +0000)]
Auto merge of #73276 - Dylan-DPC:rollup-hfd81qw, r=Dylan-DPC

Rollup of 5 pull requests

Successful merges:

 - #72906 (Migrate to numeric associated consts)
 - #73178 (expand: More precise locations for expansion-time lints)
 - #73225 (Allow inference regions when relating consts)
 - #73236 (Clean up E0666 explanation)
 - #73273 (Fix Zulip pings)

Failed merges:

r? @ghost

4 years agoDisable the `SimplifyArmIdentity` pass on beta
Wesley Wiser [Fri, 12 Jun 2020 00:46:55 +0000 (20:46 -0400)]
Disable the `SimplifyArmIdentity` pass on beta

This pass is buggy so I'm disabling it to fix a stable-to-beta
regression.

Related to #73223

4 years agofix caller_location intrinsic for Miri
Ralf Jung [Fri, 12 Jun 2020 10:35:37 +0000 (12:35 +0200)]
fix caller_location intrinsic for Miri

4 years agoRollup merge of #73273 - LeSeulArtichaut:patch-1, r=Dylan-DPC
Dylan DPC [Fri, 12 Jun 2020 10:28:31 +0000 (12:28 +0200)]
Rollup merge of #73273 - LeSeulArtichaut:patch-1, r=Dylan-DPC

Fix Zulip pings

r? @Dylan-DPC

4 years agoRollup merge of #73236 - GuillaumeGomez:cleanup-e0666, r=Dylan-DPC
Dylan DPC [Fri, 12 Jun 2020 10:28:29 +0000 (12:28 +0200)]
Rollup merge of #73236 - GuillaumeGomez:cleanup-e0666, r=Dylan-DPC

Clean up E0666 explanation

r? @Dylan-DPC

4 years agoRollup merge of #73225 - tmandry:issue-73050, r=oli-obk
Dylan DPC [Fri, 12 Jun 2020 10:28:27 +0000 (12:28 +0200)]
Rollup merge of #73225 - tmandry:issue-73050, r=oli-obk

Allow inference regions when relating consts

As first noticed by @eddyb, `super_relate_consts` doesn't need to check for inference vars since `eval` does it already (and handles lifetimes correctly by erasing them).

Fixes #73050

r? @oli-obk

4 years agoRollup merge of #73178 - petrochenkov:explint, r=varkor
Dylan DPC [Fri, 12 Jun 2020 10:28:25 +0000 (12:28 +0200)]
Rollup merge of #73178 - petrochenkov:explint, r=varkor

expand: More precise locations for expansion-time lints

First commit: a macro expansion doesn't have a `NodeId` associated with it, but it has a parent `DefId` which we can use for linting.
The observable effect is that lints associated with macro expansions can now be `allow`ed at finer-grained level than whole crate.

Second commit: each macro definition has a `NodeId` which we can use for linting, unless that macro definition was decoded from other crate.

4 years agoRollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnay
Dylan DPC [Fri, 12 Jun 2020 10:28:23 +0000 (12:28 +0200)]
Rollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnay

Migrate to numeric associated consts

The deprecation PR is #72885

cc #68490
cc rust-lang/rfcs#2700

4 years agoFix Zulip pings
LeSeulArtichaut [Fri, 12 Jun 2020 08:40:41 +0000 (10:40 +0200)]
Fix Zulip pings

4 years agox.py: do not build Miri by default
Ralf Jung [Thu, 11 Jun 2020 07:25:06 +0000 (09:25 +0200)]
x.py: do not build Miri by default

4 years agoAuto merge of #73266 - ehuss:update-cargo, r=ehuss
bors [Fri, 12 Jun 2020 04:46:03 +0000 (04:46 +0000)]
Auto merge of #73266 - ehuss:update-cargo, r=ehuss

Update cargo

2 commits in 1ec223effbbbf9fddd3453cdcae3a96a967608eb..79c769c3d7b4c2cf6a93781575b7f592ef974255
2020-06-09 20:03:14 +0000 to 2020-06-11 22:13:37 +0000
- Fix failure with missing readme. (rust-lang/cargo#8353)
- Some LTO fixes. (rust-lang/cargo#8349)

4 years agoUpdate cargo
Eric Huss [Fri, 12 Jun 2020 01:47:27 +0000 (18:47 -0700)]
Update cargo

4 years agoAuto merge of #69478 - avr-rust:avr-support-upstream, r=jonas-schievink
bors [Fri, 12 Jun 2020 01:28:37 +0000 (01:28 +0000)]
Auto merge of #69478 - avr-rust:avr-support-upstream, r=jonas-schievink

Enable AVR as a Tier 3 target upstream

Tracking issue: #44052.

Things intentionally left out of the initial upstream:

* The `target_cpu` flag

I have made the cleanup suggestions by @jplatte and @jplatte in https://github.com/avr-rust/rust/commit/043550d9db0582add42e5837f636f61acb26b915.

Anybody feel free to give the branch a test and see how it fares, or make suggestions on the code patch itself.

4 years agoUse the built cargo for cargotest.
Eric Huss [Fri, 12 Jun 2020 01:28:13 +0000 (18:28 -0700)]
Use the built cargo for cargotest.

4 years agoRun fmt
Aaron Hill [Fri, 12 Jun 2020 00:16:41 +0000 (20:16 -0400)]
Run fmt

4 years agoUse `fn_span` to point to the actual method call
Aaron Hill [Thu, 11 Jun 2020 22:10:13 +0000 (18:10 -0400)]
Use `fn_span` to point to the actual method call

4 years agoAuto merge of #73259 - Dylan-DPC:rollup-m6nw1n0, r=Dylan-DPC
bors [Thu, 11 Jun 2020 22:08:01 +0000 (22:08 +0000)]
Auto merge of #73259 - Dylan-DPC:rollup-m6nw1n0, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #73033 (Fix #[thread_local] statics as asm! sym operands)
 - #73036 (std: Enable atomic.fence emission on wasm32)
 - #73163 (Add long error explanation for E0724)
 - #73187 (Remove missed `cfg(bootstrap)`)
 - #73195 (Provide suggestion to convert numeric op LHS rather than unwrapping RHS)
 - #73247 (Add various Zulip notifications for prioritization)
 - #73254 (Add comment about LocalDefId -> DefId)

Failed merges:

r? @ghost

4 years agoRollup merge of #73254 - jyn514:local-def-id-comment, r=lcnr
Dylan DPC [Thu, 11 Jun 2020 22:05:36 +0000 (00:05 +0200)]
Rollup merge of #73254 - jyn514:local-def-id-comment, r=lcnr

Add comment about LocalDefId -> DefId

Now there are instructions on how to convert back and forth on both
structs, not just one.

See also https://github.com/rust-lang/rust/pull/73076

r? @lcnr

4 years agoRollup merge of #73247 - LeSeulArtichaut:patch-1, r=spastorino
Dylan DPC [Thu, 11 Jun 2020 22:05:34 +0000 (00:05 +0200)]
Rollup merge of #73247 - LeSeulArtichaut:patch-1, r=spastorino

Add various Zulip notifications for prioritization

Adapts `triagebot.toml` for rust-lang/triagebot#616 and adds various Zulip notifications for the Prioritization WG workflow.
We should also add indications about the procedure for handling those events, cc @rust-lang/wg-prioritization.

r? @spastorino
This should be merged as soon as possible after rust-lang/triagebot#616 is merged, cc @Mark-Simulacrum

4 years agoRollup merge of #73195 - ayazhafiz:i/73145, r=estebank
Dylan DPC [Thu, 11 Jun 2020 22:05:33 +0000 (00:05 +0200)]
Rollup merge of #73195 - ayazhafiz:i/73145, r=estebank

Provide suggestion to convert numeric op LHS rather than unwrapping RHS

Given a code

```rust
fn foo(x: u8, y: u32) -> bool {
    x > y
}
fn main() {}
```

it could be more helpful to provide a suggestion to do "u32::from(x)"
rather than "y.try_into().unwrap()", since the latter may panic.

We do this by passing the LHS of a binary expression up the stack into
the coercion checker.

Closes #73145

4 years agoRollup merge of #73187 - mati865:bootstrap-cleanup, r=Mark-Simulacrum
Dylan DPC [Thu, 11 Jun 2020 22:05:31 +0000 (00:05 +0200)]
Rollup merge of #73187 - mati865:bootstrap-cleanup, r=Mark-Simulacrum

Remove missed `cfg(bootstrap)`

4 years agoRollup merge of #73163 - ayushmishra2005:61137-add-long-error-code-e0724, r=davidtwco
Dylan DPC [Thu, 11 Jun 2020 22:05:29 +0000 (00:05 +0200)]
Rollup merge of #73163 - ayushmishra2005:61137-add-long-error-code-e0724, r=davidtwco

Add long error explanation for E0724

Add long explanation for the E0724 error code
Part of #61137

4 years agoRollup merge of #73036 - alexcrichton:update-wasm-fence, r=Mark-Simulacrum
Dylan DPC [Thu, 11 Jun 2020 22:05:27 +0000 (00:05 +0200)]
Rollup merge of #73036 - alexcrichton:update-wasm-fence, r=Mark-Simulacrum

std: Enable atomic.fence emission on wasm32

This commit removes the `#[cfg]` guards in `atomic::fence` on wasm
targets. Since these guards were originally added the upstream wasm
specification for threads gained an `atomic.fence` instruction, so LLVM
no longer panics on these intrinsics.

Although there aren't a ton of tests in-repo for this right now I've
tested locally and all of these fences generate `atomic.fence`
instructions in wasm.

Closes #65687
Closes #72997

4 years agoRollup merge of #73033 - Amanieu:asm-tls, r=oli-obk
Dylan DPC [Thu, 11 Jun 2020 22:05:19 +0000 (00:05 +0200)]
Rollup merge of #73033 - Amanieu:asm-tls, r=oli-obk

Fix #[thread_local] statics as asm! sym operands

The `asm!` RFC specifies that `#[thread_local]` statics may be used as `sym` operands for inline assembly.

This also fixes a regression in the handling of `#[thread_local]` during monomorphization which caused link-time errors with multiple codegen units, most likely introduced by #71192.

r? @oli-obk

4 years agoExplain move errors that occur due to method calls involving `self`
Aaron Hill [Thu, 11 Jun 2020 17:48:46 +0000 (13:48 -0400)]
Explain move errors that occur due to method calls involving `self`

4 years agoMake `fn_arg_names` return `Ident` instead of symbol
Aaron Hill [Thu, 11 Jun 2020 17:42:22 +0000 (13:42 -0400)]
Make `fn_arg_names` return `Ident` instead of symbol

Also, implement this query for the local crate, not just foreign crates.

4 years agoAdd comment about LocalDefId -> DefId
Joshua Nelson [Thu, 11 Jun 2020 21:16:38 +0000 (17:16 -0400)]
Add comment about LocalDefId -> DefId

Now there are instructions on how to convert back and forth on both
structs, not just one.

4 years agoAuto merge of #73246 - Dylan-DPC:rollup-xnm531f, r=Dylan-DPC
bors [Thu, 11 Jun 2020 18:11:07 +0000 (18:11 +0000)]
Auto merge of #73246 - Dylan-DPC:rollup-xnm531f, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #72180 (remove extra space from crate-level doctest names)
 - #73012 (Show `SyntaxContext` in formatted `Span` debug output)
 - #73097 (Try_run must only be used if toolstate is populated)
 - #73169 (Handle assembler warnings properly)
 - #73182 (Track span of function in method calls, and use this in #[track_caller])
 - #73207 (Clean up E0648 explanation)
 - #73230 (Suggest including unused asm arguments in a comment to avoid error)

Failed merges:

r? @ghost

4 years agoAdd long error explanation for E0724
Ayush Kumar Mishra [Tue, 9 Jun 2020 10:56:21 +0000 (16:26 +0530)]
Add long error explanation for E0724

Minor refactoring

Minor refactoring

Update src/librustc_error_codes/error_codes/E0724.md

Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Update src/librustc_error_codes/error_codes/E0724.md

Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Update src/librustc_error_codes/error_codes/E0724.md

Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Minor refactoring

4 years agoAdd various Zulip notifications for prioritization
LeSeulArtichaut [Thu, 11 Jun 2020 17:21:09 +0000 (19:21 +0200)]
Add various Zulip notifications for prioritization

4 years agoRollup merge of #73230 - Amanieu:asm-unused2, r=petrochenkov
Dylan DPC [Thu, 11 Jun 2020 17:04:20 +0000 (19:04 +0200)]
Rollup merge of #73230 - Amanieu:asm-unused2, r=petrochenkov

Suggest including unused asm arguments in a comment to avoid error

We require all arguments to an `asm!` to be used in the template string, just like format strings. However in some cases (e.g. `black_box`) it may be desirable to have `asm!` arguments that are not used in the template string.

Currently this is a hard error rather than a lint since `#[allow]` does not work on macros (#63221), so this PR suggests using the unused arguments in an asm comment as a workaround.

r? @petrochenkov

4 years agoRollup merge of #73207 - GuillaumeGomez:cleanup-e0648, r=Dylan-DPC
Dylan DPC [Thu, 11 Jun 2020 17:04:18 +0000 (19:04 +0200)]
Rollup merge of #73207 - GuillaumeGomez:cleanup-e0648, r=Dylan-DPC

Clean up E0648 explanation

r? @Dylan-DPC

4 years agoRollup merge of #73182 - Aaron1011:feature/call-fn-span, r=matthewjasper
Dylan DPC [Thu, 11 Jun 2020 17:04:16 +0000 (19:04 +0200)]
Rollup merge of #73182 - Aaron1011:feature/call-fn-span, r=matthewjasper

Track span of function in method calls, and use this in #[track_caller]

Fixes #69977

When we parse a chain of method calls like `foo.a().b().c()`, each
`MethodCallExpr` gets assigned a span that starts at the beginning of
the call chain (`foo`). While this is useful for diagnostics, it means
that `Location::caller` will return the same location for every call
in a call chain.

This PR makes us separately record the span of the function name and
arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This
`Span` is passed through HIR lowering and MIR building to
`TerminatorKind::Call`, where it is used in preference to
`Terminator.source_info.span` when determining `Location::caller`.

This new span is also useful for diagnostics where we want to emphasize
a particular method call - for an example, see
https://github.com/rust-lang/rust/pull/72389#discussion_r436035990

4 years agoRollup merge of #73169 - Amanieu:asm-warnings, r=petrochenkov
Dylan DPC [Thu, 11 Jun 2020 17:04:14 +0000 (19:04 +0200)]
Rollup merge of #73169 - Amanieu:asm-warnings, r=petrochenkov

Handle assembler warnings properly

Previously all inline asm diagnostics were treated as errors, but LLVM sometimes emits warnings and notes as well.

Fixes #73160

r? @petrochenkov

4 years agoRollup merge of #73097 - Mark-Simulacrum:clippy-fail, r=oli-obk
Dylan DPC [Thu, 11 Jun 2020 17:04:12 +0000 (19:04 +0200)]
Rollup merge of #73097 - Mark-Simulacrum:clippy-fail, r=oli-obk

Try_run must only be used if toolstate is populated

Clippy's tests were failing the build, but that failure was ignored in favor of checking toolstate. This is the correct behavior for toolstate-checked tools, but Clippy no longer updates its toolstate status as it should always build.

The previous PR of this kind didn't catch this as I expected x.py failures to always lead to a non-successful build in CI, but that's not the case specifically for tool testing.

4 years agoRollup merge of #73012 - Aaron1011:feature/span-debug-ctxt, r=matthewjasper
Dylan DPC [Thu, 11 Jun 2020 17:04:09 +0000 (19:04 +0200)]
Rollup merge of #73012 - Aaron1011:feature/span-debug-ctxt, r=matthewjasper

Show `SyntaxContext` in formatted `Span` debug output

This is only really useful in debug messages, so I've switched to
calling `span_to_string` in any place that causes a `Span` to end up in
user-visible output.

4 years agoRollup merge of #72180 - euclio:rustdoc-test-extra-space, r=Dylan-DPC
Dylan DPC [Thu, 11 Jun 2020 17:04:08 +0000 (19:04 +0200)]
Rollup merge of #72180 - euclio:rustdoc-test-extra-space, r=Dylan-DPC

remove extra space from crate-level doctest names

Before:

```
running 2 tests
test src/test/rustdoc-ui/doctest-output.rs - foo::bar (line 11) ... ok
test src/test/rustdoc-ui/doctest-output.rs -  (line 5) ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```

After:

```
running 2 tests
test src/test/rustdoc-ui/doctest-output.rs - foo::bar (line 11) ... ok
test src/test/rustdoc-ui/doctest-output.rs - (line 5) ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```

4 years agofixup! Provide suggestion to convert numeric op LHS rather than unwrapping RHS
Ayaz Hafiz [Thu, 11 Jun 2020 15:34:12 +0000 (08:34 -0700)]
fixup! Provide suggestion to convert numeric op LHS rather than unwrapping RHS

4 years agoProvide suggestion to convert numeric op LHS rather than unwrapping RHS
Ayaz Hafiz [Tue, 9 Jun 2020 18:45:40 +0000 (11:45 -0700)]
Provide suggestion to convert numeric op LHS rather than unwrapping RHS

Given a code

```rust
fn foo(x: u8, y: u32) -> bool {
    x > y
}
fn main() {}
```

it could be more helpful to provide a suggestion to do "u32::from(x)"
rather than "y.try_into().unwrap()", since the latter may panic.

We do this by passing the LHS of a binary expression up the stack into
the coercion checker.

Closes #73145

4 years agoUse preinstalled MSYS2
Mateusz Mikuła [Tue, 9 Jun 2020 22:48:43 +0000 (00:48 +0200)]
Use preinstalled MSYS2

4 years agoClean up E0666 explanation
Guillaume Gomez [Thu, 11 Jun 2020 11:34:04 +0000 (13:34 +0200)]
Clean up E0666 explanation

4 years agoAuto merge of #73235 - Dylan-DPC:rollup-zp8oxhg, r=Dylan-DPC
bors [Thu, 11 Jun 2020 11:17:37 +0000 (11:17 +0000)]
Auto merge of #73235 - Dylan-DPC:rollup-zp8oxhg, r=Dylan-DPC

Rollup of 11 pull requests

Successful merges:

 - #72380 (Fix `is_const_context`, update `check_for_cast`)
 - #72941 (Ensure stack when building MIR for matches)
 - #72976 (Clean up E0642 explanation)
 - #73080 (doc/rustdoc: Fix incorrect external_doc feature flag)
 - #73155 (save_analysis: better handle paths and functions signature)
 - #73164 (Add new E0762 error code)
 - #73172 (Fix more clippy warnings)
 - #73181 (Automatically prioritize unsoundness issues)
 - #73183 (Support proc macros in intra doc link resolution)
 - #73208 (Fix doctest template)
 - #73219 (x.py: with --json-output, forward cargo's JSON)

Failed merges:

r? @ghost

4 years agoRollup merge of #73219 - RalfJung:cargo-json, r=Mark-Simulacrum
Dylan DPC [Thu, 11 Jun 2020 11:16:12 +0000 (13:16 +0200)]
Rollup merge of #73219 - RalfJung:cargo-json, r=Mark-Simulacrum

x.py: with --json-output, forward cargo's JSON

Fixes https://github.com/rust-lang/rust/issues/73209

r? @Mark-Simulacrum

4 years agoRollup merge of #73208 - qm3ster:patch-1, r=Amanieu
Dylan DPC [Thu, 11 Jun 2020 11:16:10 +0000 (13:16 +0200)]
Rollup merge of #73208 - qm3ster:patch-1, r=Amanieu

Fix doctest template

`saturating_add` example was not parameterized, but passed because the `u8` would saturate successfully

4 years agoRollup merge of #73183 - Manishearth:intra-doc-macro, r=GuillaumeGomez
Dylan DPC [Thu, 11 Jun 2020 11:16:08 +0000 (13:16 +0200)]
Rollup merge of #73183 - Manishearth:intra-doc-macro, r=GuillaumeGomez

Support proc macros in intra doc link resolution

The feature was written pre-proc macro resolution, so it only supported the wacky MBE resolution rules. This adds support for proc macros as well.

cc @GuillaumeGomez

Fixes #73173

4 years agoRollup merge of #73181 - LeSeulArtichaut:patch-1, r=spastorino
Dylan DPC [Thu, 11 Jun 2020 11:16:06 +0000 (13:16 +0200)]
Rollup merge of #73181 - LeSeulArtichaut:patch-1, r=spastorino

Automatically prioritize unsoundness issues

r? @spastorino cc @Mark-Simulacrum @rust-lang/wg-prioritization

4 years agoRollup merge of #73172 - matthiaskrgr:cl9ppy, r=Dylan-DPC
Dylan DPC [Thu, 11 Jun 2020 11:16:04 +0000 (13:16 +0200)]
Rollup merge of #73172 - matthiaskrgr:cl9ppy, r=Dylan-DPC

Fix more clippy warnings

Fixes more of:

clippy::unused_unit
clippy::op_ref
clippy::useless_format
clippy::needless_return
clippy::useless_conversion
clippy::bind_instead_of_map
clippy::into_iter_on_ref
clippy::redundant_clone
clippy::nonminimal_bool
clippy::redundant_closure
clippy::option_as_ref_deref
clippy::len_zero
clippy::iter_cloned_collect
clippy::filter_next

r? @Dylan-DPC

4 years agoRollup merge of #73164 - GuillaumeGomez:add-e0761, r=petrochenkov
Dylan DPC [Thu, 11 Jun 2020 11:16:02 +0000 (13:16 +0200)]
Rollup merge of #73164 - GuillaumeGomez:add-e0761, r=petrochenkov

Add new E0762 error code

4 years agoRollup merge of #73155 - marmeladema:save-analysis-various-fixes, r=Xanewok
Dylan DPC [Thu, 11 Jun 2020 11:16:00 +0000 (13:16 +0200)]
Rollup merge of #73155 - marmeladema:save-analysis-various-fixes, r=Xanewok

save_analysis: better handle paths and functions signature

This should improve slightly some possible regressions due to hir rework.

r? @Xanewok

4 years agoRollup merge of #73080 - ertos-rs:sean.wilson/devel/external_doc-ref-fix, r=ollie27
Dylan DPC [Thu, 11 Jun 2020 11:15:58 +0000 (13:15 +0200)]
Rollup merge of #73080 - ertos-rs:sean.wilson/devel/external_doc-ref-fix, r=ollie27

doc/rustdoc: Fix incorrect external_doc feature flag

4 years agoRollup merge of #72976 - GuillaumeGomez:cleanup-e0642, r=Dylan-DPC
Dylan DPC [Thu, 11 Jun 2020 11:15:57 +0000 (13:15 +0200)]
Rollup merge of #72976 - GuillaumeGomez:cleanup-e0642, r=Dylan-DPC

Clean up E0642 explanation

r? @Dylan-DPC

4 years agoRollup merge of #72941 - nagisa:ensure-stack-for-match, r=oli-obk
Dylan DPC [Thu, 11 Jun 2020 11:15:54 +0000 (13:15 +0200)]
Rollup merge of #72941 - nagisa:ensure-stack-for-match, r=oli-obk

Ensure stack when building MIR for matches

In particular matching on complex types such as strings will cause
deep recursion to happen.

Fixes #72933

r? @matthewjasper @oli-obk

4 years agoRollup merge of #72380 - lcnr:const_context, r=estebank
Dylan DPC [Thu, 11 Jun 2020 11:15:53 +0000 (13:15 +0200)]
Rollup merge of #72380 - lcnr:const_context, r=estebank

Fix `is_const_context`, update `check_for_cast`

A better version of #71477

Adds `fn enclosing_body_owner` and uses it in `is_const_context`.
`is_const_context` now uses the same mechanism as `mir_const_qualif` as it was previously incorrect.
Renames `is_const_context` to `is_inside_const_context`.

I also updated `check_for_cast` in the second commit, so r? @estebank

(I removed one lvl of indentation, so it might be easier to review by hiding whitespace changes)

4 years agoAuto merge of #71896 - spastorino:existential-assoc-types-variance, r=nikomatsakis
bors [Thu, 11 Jun 2020 04:58:48 +0000 (04:58 +0000)]
Auto merge of #71896 - spastorino:existential-assoc-types-variance, r=nikomatsakis

Relate existential associated types with variance Invariant

Fixes #71550 #72315

r? @nikomatsakis

The test case reported in that issue now errors with the following message ...

```
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in function call due to conflicting requirements
  --> /tmp/test.rs:25:5
   |
25 |     bad(&Bar(PhantomData), x)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 24:11...
  --> /tmp/test.rs:24:11
   |
24 | fn extend<'a, T>(x: &'a T) -> &'static T {
   |           ^^
note: ...so that reference does not outlive borrowed content
  --> /tmp/test.rs:25:28
   |
25 |     bad(&Bar(PhantomData), x)
   |                            ^
   = note: but, the lifetime must be valid for the static lifetime...
note: ...so that the types are compatible
  --> /tmp/test.rs:25:9
   |
25 |     bad(&Bar(PhantomData), x)
   |         ^^^^^^^^^^^^^^^^^
   = note: expected  `&'static T`
              found  `&T`

error: aborting due to previous error

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

I could also add that test case if we want to have a weaponized one too.

4 years agoAdd a suggestion to use unused asm arguments in comments
Amanieu d'Antras [Thu, 11 Jun 2020 00:27:48 +0000 (01:27 +0100)]
Add a suggestion to use unused asm arguments in comments