Commit graph

151333 commits

Author SHA1 Message Date
Guillaume Gomez
d12b16887b
Rollup merge of #86726 - sexxi-goose:use-diagnostic-item-for-rfc2229-migration, r=nikomatsakis
Use diagnostic items instead of lang items for rfc2229 migrations

This PR removes the `Send`, `UnwindSafe` and `RefUnwindSafe` lang items introduced in https://github.com/rust-lang/rust/pull/84730, and uses diagnostic items instead to check for `Send`, `UnwindSafe` and `RefUnwindSafe` traits for RFC2229 migrations.

r? ```@nikomatsakis```
2021-07-08 18:30:33 +02:00
Guillaume Gomez
d9297aea10
Rollup merge of #84961 - GuillaumeGomez:rework-session-globals, r=oli-obk
Rework SESSION_GLOBALS API

Fixes #84954.

<s>Needs #84953 to be merged first (I cherry-picked its commits to have CI pass).</s> (done)

r? ``@Aaron1011``
2021-07-08 18:30:32 +02:00
Guillaume Gomez
1f84bffdf0 Fix display of small-section-header elements 2021-07-08 17:49:06 +02:00
Guillaume Gomez
d891c8cd54 Update to last upstream version 2021-07-08 17:14:28 +02:00
bors
d0485c7986 Auto merge of #86520 - ssomers:btree_iterators_checked_unwrap, r=Mark-Simulacrum
BTree: consistently avoid unwrap_unchecked in iterators

Some iterator support functions named `_unchecked` internally use `unwrap`, some use `unwrap_unchecked`. This PR tries settling on `unwrap`. #86195 went up the same road but travelled way further and doesn't seem successful.

r? `@Mark-Simulacrum`
2021-07-08 15:06:43 +00:00
Guillaume Gomez
a2654fb64c Rework SESSION_GLOBALS API to prevent overwriting it 2021-07-08 16:16:28 +02:00
bors
0deb536ff9 Auto merge of #85363 - EFanZh:gdb-pretty-print-slices, r=michaelwoerister
Support pretty printing slices using GDB

Support pretty printing `&[T]`, `&mut [T]` and `&mut str` types using GDB.

Support pretty printing `&mut [T]` and `&mut str` types using LLDB.

Fixes #85219.
2021-07-08 12:25:47 +00:00
Ian Jackson
ff618977aa mailmap: Add alternative addresses for myself
At least one of these is already in-tree; it seems plausible that
others might appear too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2021-07-08 12:45:52 +01:00
bors
0cd0709f19 Auto merge of #86823 - the8472:opt-chunk-tra, r=kennytm
Optimize unchecked indexing into chunks and chunks_mut

Fixes #53340

```
# BEFORE

$ rustc +nightly -Copt-level=3 -Ccodegen-units=1 -Clto=fat chunks.rs
$ perf stat ./chunks

 Performance counter stats for './chunks':

          3,177.03 msec task-clock                #    1.000 CPUs utilized
                 4      context-switches          #    0.001 K/sec
                 0      cpu-migrations            #    0.000 K/sec
           984,006      page-faults               #    0.310 M/sec
    13,092,199,322      cycles                    #    4.121 GHz                      (83.29%)
       384,543,475      stalled-cycles-frontend   #    2.94% frontend cycles idle     (83.35%)
     7,414,280,722      stalled-cycles-backend    #   56.63% backend cycles idle      (83.38%)
    50,493,980,662      instructions              #    3.86  insn per cycle
                                                  #    0.15  stalled cycles per insn  (83.29%)
     6,625,375,297      branches                  # 2085.396 M/sec                    (83.38%)
         3,087,652      branch-misses             #    0.05% of all branches          (83.31%)

       3.178079469 seconds time elapsed

       2.327156000 seconds user
       0.762041000 seconds sys

# AFTER

$ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc -Copt-level=3 -Ccodegen-units=1 -Clto=fat chunks.rs
$ perf stat ./chunks

 Performance counter stats for './chunks':

          2,705.76 msec task-clock                #    1.000 CPUs utilized
                 4      context-switches          #    0.001 K/sec
                 0      cpu-migrations            #    0.000 K/sec
           984,005      page-faults               #    0.364 M/sec
    11,156,763,039      cycles                    #    4.123 GHz                      (83.26%)
       342,198,882      stalled-cycles-frontend   #    3.07% frontend cycles idle     (83.37%)
     6,486,263,637      stalled-cycles-backend    #   58.14% backend cycles idle      (83.37%)
    40,553,476,617      instructions              #    3.63  insn per cycle
                                                  #    0.16  stalled cycles per insn  (83.37%)
     6,668,429,113      branches                  # 2464.532 M/sec                    (83.37%)
         3,099,636      branch-misses             #    0.05% of all branches          (83.26%)

       2.706725288 seconds time elapsed

       1.782083000 seconds user
       0.848424000 seconds sys
```
2021-07-08 09:44:52 +00:00
Mara Bos
99b5d2a88f Fix typo in comment. 2021-07-08 11:33:33 +02:00
bors
2daa26b7ca Auto merge of #86949 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/86923
Cc `@rust-lang/miri` r? `@ghost`
2021-07-08 06:46:41 +00:00
Lamb
07f903e0e0 fn must be const if marked with stability attribut
remove trailing newline

fix: test with attribute but missing const

Update compiler/rustc_passes/src/stability.rs

Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>

Add test for extern functions

fix: using span_help instead of span_suggestion

add test for some ABIs + fmt fix

Update compiler/rustc_passes/src/stability.rs

Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>

Refractor and add test for `impl const`

Add test to make sure no output + cleanup condition

-----------------------------

remove stdcall test, failing CI test

C abi is already tested in this, so it is not that useful to test another one.
The tested code is blind to which specific ABI for now, as long as it's not an intrinsic one
2021-07-08 07:52:05 +02:00
bors
ac8c3bfffb Auto merge of #86966 - JohnTitor:rollup-uiqj2vc, r=JohnTitor
Rollup of 9 pull requests

Successful merges:

 - #86639 (Support lint tool names in rustc command line options)
 - #86812 (Recover from `&dyn mut ...` parse errors)
 - #86917 (Add doc comment for `impl From<LayoutError> for TryReserveError`)
 - #86925 (Add self to mailmap)
 - #86927 (Sync rustc_codegen_cranelift)
 - #86932 (Fix ICE when misplaced visibility cannot be properly parsed)
 - #86933 (Clean up rustdoc static files)
 - #86955 (Fix typo in `ops::Drop` docs)
 - #86956 (Revert "Add "every" as a doc alias for "all".")

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-08 04:05:41 +00:00
Yuki Okushi
01474ad92c
Rollup merge of #86956 - cuviper:unalias-every, r=m-ou-se
Revert "Add "every" as a doc alias for "all"."

This reverts commit 35450365ac (#81697) for "every" and closes #86554 in kind for "some".

The new [doc alias policy](https://std-dev-guide.rust-lang.org/documentation/doc-alias-policy.html) is that we don't want language-specific aliases like these JavaScript names, and we especially don't want to conflict with real names. While "every" is okay in the latter regard, its natural pair "some" makes a doc-search collision with `Option::Some`.

r? ```@m-ou-se```
2021-07-08 10:44:37 +09:00
Yuki Okushi
0f37050b74
Rollup merge of #86955 - Swordelf2:patch-1, r=cuviper
Fix typo in `ops::Drop` docs
2021-07-08 10:44:36 +09:00
Yuki Okushi
59b4f88af1
Rollup merge of #86933 - GuillaumeGomez:cleanup-rustdoc-static-files, r=Manishearth
Clean up rustdoc static files

The `html/static` of rustdoc was starting to be quite a mess... So I moved files in sub-folders to make it easier to follow. Here what remains in `html/static` folder:

```
$ ls
COPYRIGHT.txt  css  fonts  images  js  LICENSE-APACHE.txt  LICENSE-MIT.txt
```

cc ```@jyn514```
r? ```@Manishearth```
2021-07-08 10:44:35 +09:00
Yuki Okushi
463301aa5a
Rollup merge of #86932 - rylev:fix-ice-86895, r=estebank
Fix ICE when misplaced visibility cannot be properly parsed

Fixes #86895

The issue was that a failure to parse the visibility was causing the original error to be dropped before being emitted.

The resulting error isn't quite as nice as when the visibility is parsed properly, but I'm not sure which error to prioritize here. Displaying both errors might be too confusing.

r? ```@estebank```
2021-07-08 10:44:34 +09:00
Yuki Okushi
89638a1ddc
Rollup merge of #86927 - bjorn3:sync_cg_clif-2021-07-07, r=bjorn3
Sync rustc_codegen_cranelift

The main hightlight this sync is basic support for AArch64. Most things should work on Linux, but there does seem to be an ABI incompatibility causing proc-macros to crash, see https://github.com/bjorn3/rustc_codegen_cranelift/issues/1184. Thanks to ```@afonso360``` for implementing all Cranelift features that were necessary to compile for AArch64 using cg_clif. Also thanks to ```@shamatar``` for implementing the `llvm.x86.addcarry.64` and `llvm.x86.subborrow.64` llvm intrinsics used by num-bigint (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1178) and ```@eggyal``` for implementing multi-threading support for the lazy jit mode. (https://github.com/bjorn3/rustc_codegen_cranelift/pull/1166)

r? ```@ghost```

```@rustbot``` label +A-codegen +A-cranelift +T-compiler
2021-07-08 10:44:33 +09:00
Yuki Okushi
fccf0c2f8c
Rollup merge of #86925 - inquisitivecrystal:mailmap, r=Mark-Simulacrum
Add self to mailmap

For personal reasons, I would currently prefer to be known by this name.
2021-07-08 10:44:32 +09:00
Yuki Okushi
a57a2e991d
Rollup merge of #86917 - notriddle:notriddle/from-try-reserve-error, r=JohnTitor
Add doc comment for `impl From<LayoutError> for TryReserveError`
2021-07-08 10:44:31 +09:00
Yuki Okushi
165b520b89
Rollup merge of #86812 - FabianWolff:recover-dyn-mut, r=petrochenkov
Recover from `&dyn mut ...` parse errors

Consider this example:
```rust
fn main() {
    let r: &dyn mut Trait;
}
```
This currently leads to:
```
error: expected one of `!`, `(`, `;`, `=`, `?`, `for`, lifetime, or path, found keyword `mut`
 --> src/main.rs:2:17
  |
2 |     let r: &dyn mut Trait;
  |                 ^^^ expected one of 8 possible tokens

error: aborting due to previous error
```
However, especially for beginners, I think it is easy to get `&dyn mut` and `&mut dyn` confused. With my changes, I get a help message, and the parser even recovers:
```
error: `mut` must precede `dyn`
 --> test.rs:2:12
  |
2 |     let r: &dyn mut Trait;
  |            ^^^^^^^^ help: place `mut` before `dyn`: `&mut dyn`

error[E0405]: cannot find trait `Trait` in this scope
 --> test.rs:2:21
  |
2 |     let r: &dyn mut Trait;
  |                     ^^^^^ not found in this scope

error: aborting due to 2 previous errors
```
2021-07-08 10:44:30 +09:00
Yuki Okushi
c2d3f5f772
Rollup merge of #86639 - eholk:lint-tool, r=petrochenkov
Support lint tool names in rustc command line options

When rustc is running without a lint tool such as clippy enabled, options for lints such as `clippy::foo` are meant to be ignored. This was already working for those specified by attrs, such as `#![allow(clippy::foo)]`, but this did not work for command line arguments like `-A clippy::foo`. This PR fixes that issue.

Note that we discovered this issue while discussing https://github.com/rust-lang/cargo/issues/5034.

Fixes #86628.
2021-07-08 10:44:29 +09:00
Jacob Pratt
bd674b1e0b
Update .mailmap file 2021-07-07 16:32:04 -04:00
Josh Stone
ace3989d55 Revert "Add "every" as a doc alias for "all"."
This reverts commit 35450365ac.
2021-07-07 13:13:26 -07:00
Swordelf2
7677f5fe31
Fix typo in ops::Drop docs 2021-07-07 22:26:32 +03:00
bors
d2b04f075c Auto merge of #86105 - bjorn3:link_info_refactor, r=petrochenkov
Refactor the generation of the metadata for linking
2021-07-07 18:28:53 +00:00
Eric Holk
4a83a93e9a Cleanup: unify lint name checking
This change merges `check_lint_and_tool_name` into `check_lint_name` in
order to avoid having two very similar functions.

Also adds the `.stderr` file back for the test case, since apparently
it is still needed.
2021-07-07 10:50:50 -07:00
Eric Holk
5413d2e529 Fix test case
Previously this was using a `.stderr` file, but that does not seem to
work for all cases. This change uses `// error-pattern:` instead.
2021-07-07 10:28:35 -07:00
cyberia
a853a49425 Clarify behaviour of f64 and f32::sqrt when argument is negative zero 2021-07-07 18:22:17 +01:00
EFanZh
1b0998ca52 Ignore Windows debugger pretty-printing tests 2021-07-08 01:04:59 +08:00
Ralf Jung
381a9e5714 update Miri 2021-07-07 18:44:07 +02:00
Guillaume Gomez
e5c24ba400 Clean up rustdoc static files 2021-07-07 17:52:18 +02:00
Justus K
27b55e636f
Document rustdoc with --document-private-items 2021-07-07 16:52:30 +02:00
bjorn3
2977dff116 Remove a sorting operation from used_crates 2021-07-07 15:32:51 +02:00
Mara Bos
10d6b34d32 Add generic types to prelude collision lint test. 2021-07-07 13:26:38 +00:00
Mara Bos
f77dd5ac93 Add test for trait check in prelude collision lint. 2021-07-07 13:26:38 +00:00
Mara Bos
60535441c8 Check FromIterator trait impl in prelude collision check. 2021-07-07 13:26:38 +00:00
Ryan Levick
04a9c10fc2 Fix ICE when misplaced visibility cannot be properly parsed 2021-07-07 15:02:20 +02:00
Ryan Levick
7515bcf01a Change linked tracking issue for more qualified paths 2021-07-07 14:56:51 +02:00
Trevor Spiteri
ed76c11202 special case for integer log10 2021-07-07 14:10:05 +02:00
Trevor Spiteri
b0f98c60a6 test integer log10 values close to all powers of 10 2021-07-07 14:07:32 +02:00
Guillaume Gomez
74d71c204f Only show restricted pub use 2021-07-07 13:47:28 +02:00
EFanZh
2b2bcf11ab Ignore Android debugger pretty-printing tests 2021-07-07 18:46:24 +08:00
bjorn3
00b2f56bc6 Add memchr to list of permitted cg_clif deps
Object started depending on it
2021-07-07 11:39:29 +02:00
Guillaume Gomez
e7bc2a012a Add tests for reexports (both public and private) 2021-07-07 11:30:08 +02:00
Guillaume Gomez
cc0932641a Fix inconsistency on visibility display for typedefs 2021-07-07 11:30:08 +02:00
Guillaume Gomez
e948e8de79 Fix reexports visibility 2021-07-07 11:30:08 +02:00
Guillaume Gomez
84f259e44c Unify macro source display 2021-07-07 11:30:08 +02:00
Guillaume Gomez
c70250dfbd Add test for reexported macros 2.0 rendering 2021-07-07 11:30:08 +02:00
Guillaume Gomez
d1ad40eac4 Fix rendering of reexported macros 2.0 2021-07-07 11:30:08 +02:00