Commit Graph

93651 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
36b5724e0d
Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoerister
Fix incremental compilation of cdylib emitting spurious unused_attributes lint

fixes #60050
2019-05-20 23:03:00 +02:00
Mazdak Farrokhzad
a34dae3587
Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPC
Fix intra-doc link resolution failure on re-exporting libstd

Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366).
```rust
pub use std::*;
```

Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates.

Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.)

r? @QuietMisdreavus
2019-05-20 23:02:59 +02:00
Mazdak Farrokhzad
bf54251f90
Rollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colors, r=Dylan-DPC
Fix search sidebar width when no crate select is present

Fixes #60480.

I also fixed the box-shadow that seemed to have been kind of removed?

r? @QuietMisdreavus
2019-05-20 23:02:57 +02:00
Mazdak Farrokhzad
5a08ca38de
Rollup merge of #60453 - tbu-:pr_getrandom_enoperm, r=sfackler
Fall back to `/dev/urandom` on `EPERM` for `getrandom`

This can happen because of seccomp or some VMs.

Fixes #52609.
2019-05-20 23:02:55 +02:00
Mazdak Farrokhzad
daf8aca0e3
Rollup merge of #60383 - GuillaumeGomez:fix-position-source-code-files-toggle, r=Manishearth
Fix position source code files toggle

Fixes #60381.

The second commit is a big cleanup of the media queries.

r? @rust-lang/rustdoc

cc @Manishearth

screenshot of the fix:

<img width="501" alt="Screenshot 2019-04-29 at 23 42 56" src="https://user-images.githubusercontent.com/3050060/56929111-112b2b00-6ad9-11e9-9a23-e0a8e3641395.png">
2019-05-20 23:02:52 +02:00
William D. Jones
a775d11fff Fix MSP430 AsmPrinter and assembler syntax mismatch. 2019-05-20 16:50:00 -04:00
Petr Hosek
d8f764bbbf Set -funwind-tables and -fno-exceptions unconditionally for LLVM's libunwind
These are required otherwise libunwind will end up with undefined
references to __gxx_personality_v0 which is provided by C++ ABI
library and that's undesirable.
2019-05-20 12:29:58 -07:00
Esteban Küber
d320c7ceab Do not fail on child without DefId 2019-05-20 11:46:44 -07:00
Alexander Regueiro
ce2ee305f9 Fixed nits raised in review. 2019-05-20 16:46:15 +01:00
Alexander Regueiro
ce75a23c0d Reinstated shallow disallowing of maybe bounds in trait objects. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
a0a61904f4 Addressed more points raised in review. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
783b713b5d Addressed more points raised in review. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
20096628c6 Addressed points raised in review. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
fd7c253acc Update tests. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
aea954b74d Fixed detection of multiple non-auto traits. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
5f6c2127d7 Factored out part of conv_object_ty_poly_trait_ref method. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
16692f7b1a Addressed review points. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
72e5e8bfa7 Update tests. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
9f800457dd Ban multi-trait objects via trait aliases. 2019-05-20 16:12:49 +01:00
Alexander Regueiro
16ef295770 Accumulation of various drive-by cosmetic changes. 2019-05-20 16:12:48 +01:00
bors
d35181ad87 Auto merge of #60445 - RalfJung:maybe-uninit, r=Centril
stabilize core parts of MaybeUninit

and deprecate mem::uninitialized in the future (1.40.0). This is part of implementing https://github.com/rust-lang/rfcs/pull/1892.

Also expand the documentation a bit.

This type is currently primarily useful when dealing with partially initialized arrays. In libstd, it is used e.g. in `BTreeMap` (with some unstable APIs that however can all be replaced, less ergonomically, by stable ones). What we stabilize should also be enough for `SmallVec` (Cc @bluss).

Making this useful for structs requires https://github.com/rust-lang/rfcs/pull/2582 or a commitment that references to uninitialized data are not insta-UB.
2019-05-20 15:05:04 +00:00
Brent Kerby
178b753a4a Remove trailing whitespaces to satisfy tidy 2019-05-20 08:14:06 -06:00
Brent Kerby
a7e1431941 Update boxed::Box docs on memory layout 2019-05-20 08:14:06 -06:00
MaulingMonkey
0a423a70bb Fix CDB support tidy check line length failures. 2019-05-20 02:44:26 -07:00
Nicholas Nethercote
c5d9401756 Avoid symbol interning in file_metadata.
This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR #60467 improved this code somewhat; this is a further
improvement.
2019-05-20 18:56:53 +10:00
Ralf Jung
1916391ea8 update miri 2019-05-20 10:54:36 +02:00
Peter Todd
2a15dec5a2 Document layout guarantee of MaybeUninit 2019-05-20 10:44:02 +02:00
Ralf Jung
4bf500fea7 elliminate mem::uninitialize from docs in libcore 2019-05-20 10:44:02 +02:00
Ralf Jung
11fba52c07 add out-pointer example 2019-05-20 10:44:02 +02:00
Ralf Jung
30a43326d0 apply feedback 2019-05-20 10:44:02 +02:00
Ralf Jung
b7afe777f7 stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future
Also expand the documentation a bit
2019-05-20 10:44:02 +02:00
Michael Woerister
a79c06a9ce Document requirements for HashStable implementations better. 2019-05-20 10:36:31 +02:00
bors
589beb979c Auto merge of #60921 - cuviper:remove-mpsc_select, r=SimonSapin
Remove the unstable and deprecated mpsc_select

This removes macro `select!` and `std::sync::mpsc::{Handle, Select}`,
which were all unstable and have been deprecated since 1.32.

Closes #27800
r? @SimonSapin
2019-05-20 08:30:17 +00:00
Ralf Jung
b9be68ce2e remove confusing remarks about mixed volatile and non-volatile accesses 2019-05-20 09:50:37 +02:00
Nicholas Nethercote
88d29992bd Remove Symbol::gensym(). 2019-05-20 14:46:55 +10:00
Nicholas Nethercote
e57c0dbeb7 Eliminate Symbol::gensymed. 2019-05-20 14:46:30 +10:00
Nicholas Nethercote
f6637f3fcc Move is_gensymed from Symbol to Ident.
Note that the `is_gensymed` call on `primitive_types` is unnecessary
because that table only contains the name of primitive types (e.g.
`i32`) and never contains gensyms.
2019-05-20 14:46:30 +10:00
bors
caef1e833f Auto merge of #60815 - nnethercote:use-Symbol-more-2, r=petrochenkov
Use `Symbol` even more

These patches simplify the code a bit (fewer conversions) and also speed things up a bit (fewer `with_interner` calls).

r? @petrochenkov
2019-05-20 03:36:43 +00:00
bors
128b4c8035 Auto merge of #60969 - Centril:rollup-3j71mqj, r=Centril
Rollup of 6 pull requests

Successful merges:

 - #60590 (Test interaction of unions with non-zero/niche-filling optimization)
 - #60745 (Perform constant propagation into terminators)
 - #60895 (Enable thumbv7a-pc-windows-msvc target build end to end in rust/master)
 - #60908 (Fix lints handling in rustdoc)
 - #60960 (Stop using gensyms in HIR lowering)
 - #60962 (Fix data types indication)

Failed merges:

r? @ghost
2019-05-20 00:37:48 +00:00
MaulingMonkey
e33c4415b3 Add basic CDB support to debuginfo compiletest s, to help catch *.natvis regressions, like those fixed in #60687.
Several Microsoft debuggers (VS, VS Code, WinDbg, CDB, ...) consume the `*.natvis` files we embed into rust `*.pdb` files.
While this only tests CDB, that test coverage should help for all of them.

CHANGES

src\bootstrap
  - test.rs:  Run CDB debuginfo tests on MSVC targets

src\test\debuginfo
  - issue-13213.rs:  CDB has trouble with this, skip for now (newly discovered regression?)
  - pretty-std.rs:  Was ignored, re-enable for CDB only to start with, add CDB tests.
  - should-fail.rs:  Add CDB tests.

src\tools\compiletest:
  - Added "-cdb" option
  - Added Mode::DebugInfoCdb ("debuginfo-cdb")
  - Added run_debuginfo_cdb_test[_no_opt]
  - Renamed Mode::DebugInfoBoth -> DebugInfoGdbLldb ("debuginfo-gdb+lldb") since it's no longer clear what "Both" means.
  - Find CDB at the default Win10 SDK install path "C:\Program Files (x86)\Windows Kits\10\Debugger\*\cdb.exe"
  - Ignore CDB tests if CDB not found.

ISSUES

  - `compute_stamp_hash`: not sure if there's any point in hashing `%ProgramFiles(x86)%`
  - `OsString` lacks any `*.natvis` entries (would be nice to add in a followup changelist)
  - DSTs (array/string slices) which work in VS & VS Code fail in CDB.
  - I've avoided `Mode::DebugInfoAll` as 3 debuggers leads to pow(2,3)=8 possible combinations.

REFERENCE

CDB is not part of the base Visual Studio install, but can be added via the Windows 10 SDK:
  https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
Installing just "Debugging Tools for Windows" is sufficient.

CDB appears to already be installed on appveyor CI, where this changelist can find it, based on it's use here:
  0ffc573110/appveyor.yml (L227)

CDB commands and command line reference:
  https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/debugger-reference
2019-05-19 17:10:48 -07:00
Nicholas Nethercote
c06cdbeac5 Introduce LocalInternedString::intern.
`LocalInternedString::intern(x)` is preferable to
`Symbol::intern(x).as_str()`, because the former involves one call to
`with_interner` while the latter involves two.
2019-05-20 09:17:02 +10:00
Nicholas Nethercote
257eaf523f Introduce InternedString::intern.
`InternedString::intern(x)` is preferable to
`Symbol::intern(x).as_interned_str()`, because the former involves one
call to `with_interner` while the latter involves two.

The case within InternedString::decode() is particularly hot, and this
change reduces the number of `with_interner` calls by up to 13%.
2019-05-20 09:17:00 +10:00
Nicholas Nethercote
b96be5b188 Avoid as_str() in ParamTy::is_self.
It's a hot function, and a direct `Symbol` comparison is faster.

The patch also converts some `&InternedString`s to `InternedString`.
2019-05-20 09:16:26 +10:00
Mazdak Farrokhzad
614ffe56c6
Rollup merge of #60962 - VeryTastyTomato:patch-1, r=jonas-schievink
Fix data types indication

Fix the data types indication in basic examples of the Trait std::fmt::LowerExp and std::fmt::UpperExp.
Since there aren’t any type annotation on the let statement using the number 42.0, they are of type f64 according to The Book:
https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types
2019-05-20 01:01:44 +02:00
Mazdak Farrokhzad
787d49e4cb
Rollup merge of #60960 - matthewjasper:remove-lowering-gensym, r=petrochenkov
Stop using gensyms in HIR lowering

These names aren't ever handled by resolve, so there's no reason to
make them gensyms.

Diagnostics wanting to behave differently for these variables should
inspect either the `MatchSource`/`LocalSource` or the `Span`. All
current diagnostics appear to do this.

r? @petrochenkov
2019-05-20 01:01:42 +02:00
Mazdak Farrokhzad
986aa36ed1
Rollup merge of #60908 - GuillaumeGomez:errors, r=oli-obk
Fix lints handling in rustdoc

Part of #60664: now lints are handled just like any other lints you would setup in rustc. Still remains to handle `missing code examples` and `missing_docs` as part of the same group.

r? @oli-obk
2019-05-20 01:01:41 +02:00
Mazdak Farrokhzad
815d3ba883
Rollup merge of #60895 - chandde:master, r=alexcrichton
Enable thumbv7a-pc-windows-msvc target build end to end in rust/master

With this PR, plus another commit cf98161da7, I'm able to build the target thumbv7a-pc-windows-msvc successfully, and I'm able to use the stage2 artifacts to build arm32 projects. The commit in compiler_builtins is in release 0.1.14, the current cargo.lock in rust master still uses 0.1.12, so I bumped the compiler_builtins version in cargo.lock to 0.1.15

The command I used to build rust
```
c:\python27\python.exe x.py build --host x86_64-pc-windows-msvc --build x86_64-pc-windows-msvc --target thumbv7a-pc-windows-msvc --verbose
```

**Changes**
1. update cargolock to use compiler_builtins 0.1.15
2. handle libunwind in libtest for thumv7a the same as what we have for aarch64
3. in llvm codegen add a field in CodegenContext to carry the arch, so later in create_msvc_imps function, the arch can be used to check against "x86", instead of 32 pointer width. Apparently Thumv7a is handled differently than x86.

**Background**
I'm from Microsoft working on enabling Azure IoTEdge on ARM32 Windows IoTCore, Azure IoTEdge has a component called IoTEdged written in rust as a NT service running on Windows, so we need to enable rust on thumbv7a in order to have full IoTEdge. My colleague had made some heavy lifting and we've been using our private toolchain to build IoTEdged in our devops pipeline, because at that time we cannot build thumbv7a target end to end successfully. This change is a followup to enable the end to end build for thumbv7a-pc-windows-msvc target.

**Next step**
I'll submit more changes to have this target built nightly in rust/master, to achieve the same availability for aarch64-pc-windows-msvc, indexed here https://rust-lang.github.io/rustup-components-history/aarch64-pc-windows-msvc.html and can be manually installed. **Please do share what takes to make this happen, is there a formal process I need to follow\?**
2019-05-20 01:01:39 +02:00
Mazdak Farrokhzad
5c84d779b2
Rollup merge of #60745 - wesleywiser:const_prop_into_terminators, r=oli-obk
Perform constant propagation into terminators

Perform constant propagation into MIR `Assert` and `SwitchInt` `Terminator`s which in some cases allows them to be removed by the branch simplification pass.

r? @oli-obk
2019-05-20 01:01:38 +02:00
Mazdak Farrokhzad
f9d65c000d
Rollup merge of #60590 - petertodd:2018-test-union-nonzero, r=nikomatsakis,Centril
Test interaction of unions with non-zero/niche-filling optimization

Notably this nails down part of the behavior that MaybeUninit assumes, e.g. that a Option<MaybeUninit<&u8>> does not take advantage of non-zero optimization, and thus is a safe construct.

It also verifies the status quo: that even unions that could theoretically take advantage of niches don't. (relevant: https://github.com/rust-lang/rust/issues/36394)
2019-05-20 01:01:37 +02:00
bors
a5000c5098 Auto merge of #60272 - Jakst:patch-1, r=Manishearth
Explicitly set height on rust logo <img> element in docs

The layout of the left side menu in docs reflows when navigating between pages because of missing height on the <img> element of rust logo.

Setting height='100' tells the browser to reserve that vertical space, leading to a less janky experience.
2019-05-19 21:36:15 +00:00