127204 Commits

Author SHA1 Message Date
Elichai Turkel
2e82589741
linker-plugin-lto.md: Convert the rust-clang MxN table to a 2xM table 2020-09-06 14:55:27 +03:00
bors
23e49ddafb Auto merge of #76370 - fusion-engineering-forks:synconcecell-soundness, r=nagisa
Fix dropck issue of SyncOnceCell.

Fixes #76367.
2020-09-06 10:29:54 +00:00
Sasha
84fc6fd2d0 Fix documentation for TyCtxt::all_impls 2020-09-06 12:10:46 +02:00
Simon Vandel Sillesen
9b0fc6202b Generalize to Eq(true, _place) and Eq(_place, true) 2020-09-06 11:51:44 +02:00
Simon Vandel Sillesen
c2693db264 Add peephold optimization that simplifies Ne(_1, false) and Ne(false, _1) into _1
This was observed emitted from the MatchBranchSimplification pass.
2020-09-06 11:51:44 +02:00
Elichai Turkel
9e1403373d
Update linker-plugin-lto.md to contain up to rust 1.46 2020-09-06 11:20:53 +03:00
bors
6c6003a7ad Auto merge of #76341 - richkadel:ignore-gcc-destructor-priority, r=cuviper
Update llvm-project to include PR 73

https://github.com/rust-lang/llvm-project/pull/73

r? @cuviper
2020-09-06 08:13:39 +00:00
bors
ffaf158608 Auto merge of #76331 - Aaron1011:fix/group-compat-hack-test, r=petrochenkov
Account for version number in NtIdent hack

Issue #74616 tracks a backwards-compatibility hack for certain macros.
This has is implemented by hard-coding the filenames and macro names of
certain code that we want to continue to compile.

However, the initial implementation of the hack was based on the
directory structure when building the crate from its repository (e.g.
`js-sys/src/lib.rs`). When the crate is build as a dependency, it will
include a version number from the clone from the cargo registry (e.g.
`js-sys-0.3.17/src/lib.rs`), which would fail the check.

This commit modifies the backwards-compatibility hack to check that
desired crate name (`js-sys` or `time-macros-impl`) is a prefix of the
proper part of the path.

See https://github.com/rust-lang/rust/issues/76070#issuecomment-687215646
for more details.
2020-09-06 06:15:28 +00:00
bors
b40abfd485 Auto merge of #76326 - mati865:use_lld-no-linker, r=Mark-Simulacrum
Fix rust.use-lld when linker is not set

Fixes https://github.com/rust-lang/rust/pull/76127#issuecomment-685419195

Previously when `[<target>].linker` was not configured `rust.use-lld` would set it to `rust-lld` on platforms where it should not.
2020-09-06 04:00:56 +00:00
Ayush Kumar Mishra
05d22c8519 Move test-cases in string.rs 2020-09-06 09:23:40 +05:30
Caleb Zulawski
8f69266f79 Emit warnings on misplaced #[no_mangle] 2020-09-05 22:12:24 -04:00
bors
94b8eb80ab Auto merge of #76307 - sunfishcode:wasm-no-eh-frame-header, r=alexcrichton
Disable use of `--eh-frame-hdr` on wasm32.

Set wasm32's `TargetOptions::eh_frame_header` to false so that we don't pass `--eh-frame-hdr` to `wasm-ld`, which doesn't support that flag.

r? @alexcrichton
2020-09-06 01:58:35 +00:00
Caleb Zulawski
acd68b503d Fix broken test on musl 2020-09-05 21:29:54 -04:00
Caleb Zulawski
0c62ef08bd Allow #[cold], #[track_caller] on closures. Fix whitespace in error messages. 2020-09-05 20:46:38 -04:00
Caleb Zulawski
f745b34960 Emit warnings for misplaced attributes used by some crates 2020-09-05 20:46:37 -04:00
Caleb Zulawski
4efe97a3d9 Check placement of more attributes 2020-09-05 20:45:43 -04:00
dylni
b92b0d6ee6 Fix typo in tracking issue template 2020-09-05 20:12:26 -04:00
dylni
cf529c767e Adjust documentation for slice_check_range 2020-09-05 19:53:35 -04:00
bors
d39b076489 Auto merge of #76385 - calebcartwright:update-rls-rustfmt, r=Xanewok
Update RLS and Rustfmt

Fixes #76145 and fixes #76146

cc @Xanewok @topecongiro
2020-09-05 23:29:05 +00:00
MaulingMonkey
5acd272f5f Fix HashMap visualizers in Visual Studio (Code)
CDB doesn't care that you're using static_cast between unrelated types.
VS(C) does.  These should've been reinterpret_cast or C casts.
Cast is from e.g. `u8*` to `tuple<$T1, $T2>*`
2020-09-05 14:50:03 -07:00
MaulingMonkey
4046f928d1 debuginfo: Ignore HashMap tests before cdb 10.0.18362.1
cdb chokes on the cast and reports "Unable to find type 'tuple<u64,u64> *' for cast."
2020-09-05 14:47:16 -07:00
MaulingMonkey
7cbfbd3ee7 compiletest: Introduce "min-cdb-version" 2020-09-05 14:46:22 -07:00
bors
cdc8f0606d Auto merge of #76217 - RalfJung:maybe-uninit-slice, r=KodrAus
rename MaybeUninit slice methods

The `first` methods conceptually point to the whole slice, not just its first element, so rename them to be consistent with the raw ptr methods on ref-slices.

Also, do the equivalent of https://github.com/rust-lang/rust/pull/76047 for the slice reference getters, and make them part of https://github.com/rust-lang/rust/issues/63569 (so far they somehow had no tracking issue).

* first_ptr -> slice_as_ptr
* first_ptr_mut -> slice_as_mut_ptr
* slice_get_ref -> slice_assume_init_ref
* slice_get_mut -> slice_assume_init_mut
2020-09-05 21:02:18 +00:00
Caleb Cartwright
1ceb82488f Update RLS and Rustfmt 2020-09-05 15:40:07 -05:00
bors
e9440cbcde Auto merge of #5997 - giraffate:fix_fp_about_clone_in_same_item_push, r=ebroto
Fix FP in `same_item_push`

Don't emit a lint when the pushed item doesn't have Clone trait

Fix #5979

changelog: Fix FP in `same_item_push` not to emit a lint when the pushed item doesn't have Clone trait
2020-09-05 20:27:17 +00:00
Rich Kadel
39a35178d3 Update llvm-project to include PR 73
https://github.com/rust-lang/llvm-project/pull/73
2020-09-05 12:49:17 -07:00
bors
de921ab3c3 Auto merge of #75428 - the8472:fix-copy-eopnotsupp, r=joshtriplett
Workarounds for copy_file_range issues

fixes #75387
fixes #75446
2020-09-05 19:09:22 +00:00
Edd Barrett
8af85fa1f7 Improve the documentation of filter() and filter_map().
I believe the documentation is currently a little misleading.

For example, in the docs for `filter()`:

> If the closure returns `false`, it will try again, and call the closure on
> the next element, seeing if it passes the test.

This kind of implies that if the closure returns true then we *don't* "try
again" and no further elements are considered. In actuality that's not the
case, every element is tried regardless of what happened with the previous
element.

This change tries to clarify that by removing the uses of "try again"
altogether.
2020-09-05 19:59:30 +01:00
Joshua Nelson
cd72d9029f Find the first segment that failed to resolve for _any_ namespace
Moves this detection into `resolution_failure` to avoid doing
unnecessary work and make the control flow a little easier to work with.
2020-09-05 13:56:57 -04:00
Joshua Nelson
8318a185f3 x.py bless 2020-09-05 13:56:57 -04:00
Joshua Nelson
efdc3facdf Give a much better error message when an item has a macro disambiguator
Previously, this called `check_full_res` for values and types, but not
macros. This would result in not showing when there was a partial
resolution for a parent of the item.

This now calls `check_full_res`. Additionally, it checks if there was a
disambiguator, and if so, says that specific kind wasn't found instead
of saying generically 'associated item'.
2020-09-05 13:56:57 -04:00
Joshua Nelson
ee683ef853 Say 'prefix with kind@' instead of 'prefix with the item kind'
This is both more specific and easier to read.
2020-09-05 13:56:55 -04:00
Vadim Petrochenkov
8754884b78 rustbuild: Do not use rust-mingw component when bootstrapping windows-gnu targets 2020-09-05 20:49:59 +03:00
Joshua Nelson
d67eb1f148 Don't suggest \[ \] if there's a :: in the path 2020-09-05 13:48:20 -04:00
Joshua Nelson
f2826d9e9b Show the first path segment which failed to resolve.
Before, it would arbitrarily pick the third-to-last if the last three or
more did not resolve.
2020-09-05 13:48:19 -04:00
Joshua Nelson
bb9d157604 Address my own review comments
- Remove unneeded lifetime parameter
- Comment why some code doesn't use `check_full_res`
2020-09-05 13:48:19 -04:00
Joshua Nelson
2ca6f11663 Fix rebase conflicts 2020-09-05 13:48:19 -04:00
Joshua Nelson
418f6089e9 Give a better error message when linking to a macro with the wrong disambiguator
Before:

```
warning: unresolved link to `m`
 --> m.rs:1:6
  |
1 | /// [value@m]
  |      ^^^^^^^
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
  = note: no item named `m` is in scope
  = help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
```

After:

```
warning: unresolved link to `m`
 --> m.rs:1:6
  |
1 | /// [value@m]
  |      ^^^^^^^ help: to link to the macro, use its disambiguator: `m!`
  |
  = note: `#[warn(broken_intra_doc_links)]` on by default
  = note: this link resolves to the macro `m`, which is not in the value namespace
```
2020-09-05 13:48:19 -04:00
Joshua Nelson
6875220e1a Use rustc_resolve's descr() instead of rewriting it 2020-09-05 13:48:19 -04:00
Joshua Nelson
ebc8cb470f Turn NoParentItem from a panic into an ICE 2020-09-05 13:48:19 -04:00
Joshua Nelson
19d100278d Fix failures to resolve primitives
Previously, when looking for the associated items for primitives,
rustdoc would look for primitives in the current namespace.
But all primitives are in the type namespace. To fix this, rustdoc now
always looks for primitives in the namespace when considering them as a
stepping stone to the associated item.

However, fixing that bug caused several duplicate errors because rustdoc
now reports the same error in each namespace. To avoid this, rustdoc now
ignores all duplicate errors when issuing them.
2020-09-05 13:48:19 -04:00
Joshua Nelson
e2d69f2eb1 Make errors more concise and helpful
Before:
```
   = note: this link partially resolves to the struct `S`
   = note: no `fmt` in `S`
```

After:
```
   = note: the struct `S` has no field or associated item named `fmt`
```
2020-09-05 13:48:19 -04:00
Joshua Nelson
7b8d0befd6 Remove some TODOs 2020-09-05 13:48:19 -04:00
Joshua Nelson
002d3a922c Don't give misleading errors for f::A, where f is in the value namespace 2020-09-05 13:48:19 -04:00
Joshua Nelson
f4e6ebd11a Fix tests and improve error message if :: isn't found 2020-09-05 13:48:19 -04:00
Joshua Nelson
42bed03500 Pass on the DefId so rustdoc can name it in suggestions
Look at this beauty:

```rust
error: unresolved link to `S::h`
  --> intra-link-errors.rs:51:6
   |
51 | /// [type@S::h]
   |      ^^^^^^^^^ help: to link to the associated function, use its disambiguator: `S::h()`
   |
   = note: this link resolves to the associated function `h`, which is not in the type namespace
```
2020-09-05 13:48:19 -04:00
Joshua Nelson
fcb21999a7 Report if the thing exists in another namespace 2020-09-05 13:48:19 -04:00
Joshua Nelson
4ace4e7520 Use fewer .to_string()s 2020-09-05 13:48:19 -04:00
Joshua Nelson
f45e7b5862 Update .stderr 2020-09-05 13:48:19 -04:00
Joshua Nelson
3797f29aad [WIP] give better errors for broken intra doc links 2020-09-05 13:48:19 -04:00