Commit graph

125199 commits

Author SHA1 Message Date
Josh Stone
2fa6e44c8d rustc_metadata: use IndexSet in EncodeContext 2020-08-09 12:25:22 -07:00
Josh Stone
d3c70b8af5 rustc_data_structures: use IndexSet in TransitiveRelation 2020-08-09 12:25:21 -07:00
Josh Stone
1f71f0f2b5 rustc_codegen_llvm: use IndexSet in CoverageMapGenerator 2020-08-09 12:25:21 -07:00
Josh Stone
997a766b32 Upgrade indexmap to 1.5.1, now using hashbrown! 2020-08-09 12:25:21 -07:00
Denis Vasilik
e9e319c460 Use intra-doc links 2020-08-09 21:20:57 +02:00
bors
7228368953 Auto merge of #5882 - dima74:ra_setup-prevent-compile-rustc, r=Manishearth
Prevent compile parts of rustc when using `cargo dev ra-setup`

Currently after running `cargo dev ra-setup` the following lines are added to `Cargo.toml`:

```toml
[target]
rustc_data_structures = { path = ".../rust/src/librustc_data_structures" }
rustc_driver = { path = ".../rust/src/librustc_driver" }
rustc_errors = { path = ".../rust/src/librustc_errors" }
rustc_interface = { path = ".../rust/src/librustc_interface" }
rustc_middle = { path = ".../rust/src/librustc_middle" }
```

This pull request adds dependencies for `rustc` crates under `cfg(NOT_A_PLATFORM)`, thus preventing them from compiling together with clippy:

```toml
[target.'cfg(NOT_A_PLATFORM)'.dependencies]
rustc_data_structures = { path = ".../rust/src/librustc_data_structures" }
rustc_driver = { path = ".../rust/src/librustc_driver" }
rustc_errors = { path = ".../rust/src/librustc_errors" }
rustc_interface = { path = ".../rust/src/librustc_interface" }
rustc_middle = { path = ".../rust/src/librustc_middle" }
```

---

This approach was [originally proposed for IntelliJ Rust](https://github.com/intellij-rust/intellij-rust/issues/1618#issuecomment-459098749), and looks like it works for rust-analyzer too.

changelog: none
2020-08-09 19:18:01 +00:00
Camelid
f3cc957f2e Rename "Important traits" to "Notable traits"
* Rename it in the UI
* Rename the CSS classes
2020-08-09 12:09:05 -07:00
Aaron Hill
db6b3c1ce4
Remove normalization of Span debug output in proc-macro tests
Fixes #74800

The definition of `is_x86_feature_detected!` (and similar macros)
depends on the platform - it is produced by a `cfg_if!` invocation on
x86, and a plain `#[cfg]` on other platforms. Since it is part of the
prelude, we will end up importing different hygiene information
depending on the platform. This previously required us to avoid printing raw
`SyntaxContext` ids in any tests that uses the standard library, since
the captured output will be platform-dependent.

Previously, we replaced all `SyntaxContext` ids with "#CTXT", and the
raw `Span` lo/hi bytes with "LO..HI".

This commit adds `#![no_std]` and `extern crate std` to all proc-macro
tests that print spans. This suppresses the prelude import, while
still using lang items from `std` (which gives us a buildable binary).
With this apporach, we will only load hygiene information for things
which we explicitly import. This lets us re-add
`-Z unpretty=expanded,hygiene`, since its output can now be made stable
across all platforms.

Additionally, we use `-Z span-debug` in more places, which lets us avoid
the "LO..HI" normalization hack.
2020-08-09 14:41:51 -04:00
bors
39e593ab14 Auto merge of #75137 - Aaron1011:fix/hygiene-skip-expndata, r=petrochenkov
Don't serialize ExpnData for foreign crates

When we encode an ExpnId into the crate metadata, we write out the
CrateNum of the crate that 'owns' the corresponding `ExpnData`, which
is later used to decode the `ExpnData` from its owning crate.

However, we current serialize the `ExpnData` for all `ExpnIds` that we
serialize, even if the `ExpnData` was already serialized into a foreign
crate. This commit skips encoding this kind of `ExpnData`, which should
hopefully speed up metadata encoding and reduce the total metadata size.
2020-08-09 18:19:34 +00:00
Josh Stone
29f5e5c574 Upgrade the FreeBSD toolchain to version 11.4
FreeBSD 10 reached its end-of-life in October 2018, and that toolchain
caused issues in the LLVM 11 upgrade (#73526) that are resolved with the
toolchain from FreeBSD 11.
2020-08-09 10:38:52 -07:00
Dmitry Murzin
6af969379e
Prevent compile parts of rustc when using cargo dev ra-setup 2020-08-09 22:21:09 +05:00
Ralf Jung
1fa7203161 bless MIR 2020-08-09 18:54:56 +02:00
Ivan Tham
4b549fa043
show multiple slashes starts_with Path example
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-08-10 00:43:45 +08:00
Ralf Jung
a0e057540e evaluate required_consts when pushing stack frame in Miri engine 2020-08-09 18:14:28 +02:00
Ralf Jung
aec6df9b94 move stack size check to const_eval machine 2020-08-09 18:01:37 +02:00
Alexis Bourget
5a0de2f828 Improve safety comments for usize, fix some other unclear parts 2020-08-09 16:43:24 +02:00
bors
543f03d241 Auto merge of #75134 - Aaron1011:feature/expn-data-parent-hash, r=petrochenkov
Hash parent ExpnData

cc https://github.com/rust-lang/rust/pull/72121#discussion_r460528326
2020-08-09 14:29:42 +00:00
David Wood
fd41bdeff0
instance: only polymorphize upvar substs
This commit restricts the substitution polymorphization added in #75255
to only apply to the tupled upvar substitution, rather than all
substitutions, fixing a bunch of regressions when polymorphization is
enabled.

Signed-off-by: David Wood <david@davidtw.co>
2020-08-09 14:53:33 +01:00
Ralf Jung
bff69c9525 move const_eval error reporting logic into rustc_mir::const_eval::error 2020-08-09 15:37:32 +02:00
Aaron Hill
ef49032297
Add comment about the lack of ExpnData serialization for proc-macro crates 2020-08-09 08:43:11 -04:00
Joshua Nelson
b11e2f2341 Give precedence to primitives over modules
This has less surprising behavior when there is a module with the same
name as a primitive in scope.
2020-08-09 08:34:21 -04:00
bors
8bc801b050 Auto merge of #75293 - poliorcetics:intra-doc-links-std-path, r=jyn514
Move to intra-doc links in library/std/src/path.rs

Helps with #75080.

@rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc

Known issue: The following links are broken (they are inside trait impls, undocumented in this file, inheriting from the original doc):

- [`Hasher`]
- [`Self`] (referencing `../primitive.slice.html`)
- [`Ordering`]
2020-08-09 12:31:03 +00:00
Mark Rousskov
2627eedde9 Avoid deleting temporary files on error
Previously if the compiler error'd, fatally, then temporary directories which
should be preserved by -Csave-temps would be deleted due to fatal compiler
errors being implemented as panics.
2020-08-09 08:28:15 -04:00
Guillaume Gomez
4e78760137 Remove E0749 from untested error codes 2020-08-09 13:53:27 +02:00
Guillaume Gomez
cc54a1f930 Clean up E0749 explanation 2020-08-09 13:53:27 +02:00
Stein Somers
ef753fc6ed BTreeMap: better distinguish the root holder from the root node 2020-08-09 13:43:13 +02:00
bors
8e738539be Auto merge of #75310 - petrochenkov:needwasm, r=Mark-Simulacrum
tests: Mark `ui/asm/bad-arch.rs` as requiring wasm llvm backend

So it doesn't fail when not all LLVM backends are built.
2020-08-09 08:52:53 +00:00
Vadim Petrochenkov
bef1ee3857 tests: Mark ui/asm/bad-arch.rs as requiring wasm llvm backend 2020-08-09 11:40:48 +03:00
kadmin
be0d6f1c06 Change Ord impl for ParamKindOrd
Updated tests and error msgs

Update stderr from test

Update w/ lcnr comments

Change some tests around, and also updated Ord implementation for ParamKindOrd

Update w/ nits from lcnr
2020-08-09 07:41:26 +00:00
kadmin
4f461f5d12 Switched to unordered field in ParamKindOrd
Run fmt
2020-08-09 07:41:26 +00:00
kadmin
1ae1a6332c Add ParamKindOrd::ConstUnordered variant 2020-08-09 07:41:26 +00:00
kadmin
319c4f45e0 Blessed old test where error message had changed
Added minor fmt change to ast_validation
2020-08-09 07:41:26 +00:00
kadmin
b8352eb2d1 Test lifetimes after types after consts forbidden
Added more complex test and changed error message
2020-08-09 07:41:24 +00:00
kadmin
f8588284af Added +1 test for only works w/ feat const gen
Added this test to ensure that reordering the parameters only works with the feature const
generics enabled.

Fixed nits

Also added another test to verify that intermixed lifetimes are forbidden
2020-08-09 07:41:22 +00:00
Ryan1729
873e5f5c19 add allow unused_unsafe and allow dead_code 2020-08-09 00:39:14 -06:00
Ryan1729
d2e7293078 add allow unused_unsafe and allow dead_code 2020-08-09 00:39:14 -06:00
Ryan1729
bc8d32d36b fix unary minus on usize and unused variable errors in .fixed file 2020-08-09 00:28:56 -06:00
Ryan1729
58b8b11791 fix unary minus on usize and unused variable errors in .fixed file 2020-08-09 00:28:56 -06:00
Ryan1729
84db238fa1 add a test example of where transmutes_expressible_as_ptr_casts should not suggest anything 2020-08-09 00:15:56 -06:00
Ryan1729
0fbf450afc add a test example of where transmutes_expressible_as_ptr_casts should not suggest anything 2020-08-09 00:15:56 -06:00
Esteban Küber
4dbe0ac928 Detect likely for foo of bar JS syntax
Fix #75311.
2020-08-08 20:53:40 -07:00
bors
f50f1c8e17 Auto merge of #75280 - overdrivenpotato:psp-unwind, r=dtolnay
Add back unwinding support for Sony PSP

This PR adds back unwinding support for the Sony PSP. The `mipsel-sony-psp` target works well with unwinding. In [rust-psp], we use the `panic_unwind` crate along with LLVM's libunwind to catch panics, run destructors, and print them to the debug screen without aborting all threads.

[rust-psp]: https://github.com/overdrivenpotato/rust-psp
2020-08-09 03:07:00 +00:00
Ryan1729
a1ca12581a update stderr for transmutes_expressible_as_ptr_casts 2020-08-08 21:03:41 -06:00
Ryan1729
b02bf05690 update stderr for transmutes_expressible_as_ptr_casts 2020-08-08 21:03:41 -06:00
Alex Crichton
b21a3de35f Don't try to use wasm intrinsics on vectors
This commit fixes an issue with #74695 where the fptosi and fptoui
specializations on wasm were accidentally used on vector types by the
`simd_cast` intrinsic. This issue showed up as broken CI for the stdsimd
crate. Here this commit simply skips the specialization on vector kinds
flowing into `fpto{s,u}i`.
2020-08-08 18:09:40 -07:00
bors
aced185592 Auto merge of #75306 - Amanieu:hashbrown8, r=Mark-Simulacrum
Update hashbrown to 0.8.2

Includes:
- Avoid closures to improve compile times (https://github.com/rust-lang/hashbrown/pull/183)
- Do not iterate to drop if empty (https://github.com/rust-lang/hashbrown/pull/182)

r? @Mark-Simulacrum
2020-08-09 01:05:56 +00:00
bors
dcf107728c Auto merge of #75308 - JohnTitor:rollup-vnnny43, r=JohnTitor
Rollup of 15 pull requests

Successful merges:

 - #74712 (Update E0271 explanation)
 - #74842 (adjust remaining targets)
 - #75151 (Consistent variable name alloc for raw_vec)
 - #75162 (Fix the documentation for move about Fn traits implementations)
 - #75248 (Add `as_mut_ptr` to `NonNull<[T]>`)
 - #75262 (Show multi extension example for Path in doctests)
 - #75266 (Add safety section to `NonNull::as_*` method docs)
 - #75284 (Show relative example for Path ancestors)
 - #75285 (Separate example for Path strip_prefix)
 - #75287 (Show Path extension example change multi extension)
 - #75288 (Use assert! for Path exists example to check bool)
 - #75289 (Remove ambiguity from PathBuf pop example)
 - #75290 (fix `min_const_generics` version)
 - #75291 (Clean up E0750)
 - #75292 (Clean up E0502)

Failed merges:

r? @ghost
2020-08-08 23:05:49 +00:00
Yuki Okushi
e6dfd308d3
Rollup merge of #75292 - slanterns:cleanup-E0502, r=GuillaumeGomez
Clean up E0502

`ref` on an entire `let` pattern is discouraged, take a reference with `&` instead.
2020-08-09 06:41:39 +09:00
Yuki Okushi
bc3ee48fd2
Rollup merge of #75291 - GuillaumeGomez:cleanup-e0750, r=pickfire
Clean up E0750

r? @Dylan-DPC
2020-08-09 06:41:37 +09:00
Yuki Okushi
55f2490a59
Rollup merge of #75290 - rust-lang:min_const_generics-version, r=jonas-schievink
fix `min_const_generics` version

https://github.com/rust-lang/rust/pull/74877#discussion_r467451813

> This should be 1.47.0
2020-08-09 06:41:35 +09:00