Commit Graph

90470 Commits

Author SHA1 Message Date
Matthew Jasper
168c14a1a5 Avoid propagating redundant outlives constraints from closures 2019-02-13 18:50:46 +00:00
Andy Russell
2f95299f6b
specify "upper camel case" in style lint
Also, fix an issue where internal upper case letters were converted to
lower case.
2019-02-13 13:41:32 -05:00
Simon Sapin
b2cf9a02b2 Add impl From<!> for Infallible
The reverse conversion unfortunately causes unexpected errors like:

```
error[E0277]: the trait bound `!: std::convert::From<()>` is not satisfied
   --> src/librustc_metadata/encoder.rs:105:9
    |
105 |         self.emit_usize(seq.len)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<()>` is not implemented for `!`
    |
    = help: the following implementations were found:
              <! as std::convert::From<std::convert::Infallible>>
    = note: the trait is implemented for `()`. Possibly this error has been caused by changes to Rust's type-inference algorithm (see: https://github.com/rust-lang/rust/issues/48950 for more info). Consider whether you meant to use the type `()` here instead.
    = note: required by `std::convert::From::from`
```

I don’t understand why this error happens.
If I’m reading the code correctly the return types of `emit_usize`
and of the method that contains line 105 are both `Result<(), !>`,
so the expansion of the `?` operator should involve `!: From<!>`,
not `From<()>`.

Is this a type inference bug?
2019-02-13 19:29:07 +01:00
Dan Robertson
285d4a7eb6
suggestion-diagnostics: as_ref improve snippet
Improve the code snippet suggested in suggestion-diagnostics when
suggesting the use of as_ref.
2019-02-13 17:52:22 +00:00
Ralf Jung
c154bf7db4 miri: test with slightly larger BTrees 2019-02-13 18:21:13 +01:00
Ralf Jung
767dadf8e0 review failures in heap, slice, vec 2019-02-13 18:21:13 +01:00
Ralf Jung
4c1a1c3830 review failures in btree, string 2019-02-13 18:21:13 +01:00
Ralf Jung
b17ca01077 review failures in binary_heap, str, vec_deque 2019-02-13 18:21:13 +01:00
Ralf Jung
e24af6c2b3 the formatting issue got fixed 2019-02-13 18:21:13 +01:00
Ralf Jung
72be9a607b review or fix remaining miri failures in libcore 2019-02-13 18:21:13 +01:00
Mazdak Farrokhzad
05cfcb5eb2
Rollup merge of #58420 - dvdhrm:target-uefi-comments, r=nagisa
target/uefi: clarify documentation

This clarifies why FP-units are disabled on UEFI targets, as well as
why we must opt into the NXCOMPAT feature.

I did find some time to investigate why GRUB and friends disable FP on
UEFI. The specification explicitly allows using MMX/SSE/AVX, but as it
turns out it does not mandate enabling the instruction sets explicitly.
Hence, any use of these instructions will trigger CPU exceptions,
unless an application explicitly enables them (which is not an option,
as these are global flags that better be controlled by the
kernel/firmware).

Furthermore, UEFI systems are allowed to mark any non-code page as
non-executable. Hence, we must make sure to never place code on the
stack or heap. So we better pass /NXCOMPAT to the linker for it to
complain if it ever places code in non-code pages.

Lastly, this fixes some typos in related comments.

r? @alexcrichton
2019-02-13 18:12:39 +01:00
Mazdak Farrokhzad
0178f31869
Rollup merge of #58400 - gnzlbg:fix_driver, r=oli-obk
Fix rustc_driver swallowing errors when compilation is stopped

r? @oli-obk
2019-02-13 18:12:37 +01:00
Mazdak Farrokhzad
fceb16911e
Rollup merge of #58386 - Zoxc:fix-54242, r=michaelwoerister
Fix #54242

r? @michaelwoerister
2019-02-13 18:12:36 +01:00
Mazdak Farrokhzad
8a4f8e6adc
Rollup merge of #58381 - davidtwco:issue-42944, r=estebank
Only suggest imports if not imported.

Fixes #42944 and fixes #53430.

This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.

r? @estebank
2019-02-13 18:12:35 +01:00
Mazdak Farrokhzad
b39b62534d
Rollup merge of #58354 - matthewjasper:mir-dump-fixes, r=wesleywiser
Fix ICE and invalid filenames in MIR printing code

* Don't panic when printing MIR for associated constants
* Don't use `<` and `>` in filenames, since they aren't allowed on Windows.

r? @eddyb

cc @RalfJung
2019-02-13 18:12:34 +01:00
Mazdak Farrokhzad
c6590e7dc7
Rollup merge of #58276 - varkor:missing-stability-attr-top-level, r=davidtwco
Improve the error messages for missing stability attributes

This makes the capitalisation consistent and provides more context (especially for missing top-level attributes).
2019-02-13 18:12:32 +01:00
Mazdak Farrokhzad
c0d507d73b
Rollup merge of #58272 - fitzgen:num-format-code-size, r=Mark-Simulacrum
Cut down on number formating code size

r? @alexcrichton
2019-02-13 18:12:31 +01:00
Mazdak Farrokhzad
193c3773c2
Rollup merge of #58202 - varkor:deprecated-future-external, r=GuillaumeGomez
Ignore future deprecations in #[deprecated]

The future deprecation warnings should only apply to `#[rustc_deprecated]` as they take into account rustc's version. Fixes #57952.

I've also slightly modified rustdoc's display of future deprecation notices to make it more consistent, so I'm assigning a rustdoc team member for review to make sure this is okay.

r? @GuillaumeGomez
2019-02-13 18:12:30 +01:00
Mazdak Farrokhzad
adb2bb6e61
Rollup merge of #58167 - ljedrz:HirIdify_body_id, r=Zoxc
HirId-ify hir::BodyId

Another step towards https://github.com/rust-lang/rust/pull/57578.
2019-02-13 18:12:28 +01:00
Mazdak Farrokhzad
78c60bb865
Rollup merge of #58110 - Centril:libpanic_unwind-2018, r=oli-obk
libpanic_unwind => 2018

Transitions `libpanic_unwind` to Rust 2018; cc #58099

r? @oli-obk
2019-02-13 18:12:27 +01:00
Mazdak Farrokhzad
bb08499626 libpanic_unwind => 2018: remove unused extern crate. 2019-02-13 18:09:09 +01:00
Mazdak Farrokhzad
f9e9c9196a libpanic_unwind => 2018: fix ICEs. 2019-02-13 18:09:09 +01:00
Mazdak Farrokhzad
f2fe12a8ab libpanic_unwind => 2018 2019-02-13 18:09:09 +01:00
Simon Sapin
c80a8f51dc Stabilize TryFrom and TryInto 2019-02-13 18:00:18 +01:00
Simon Sapin
2f7120397f Use convert::Infallible instead of never in the blanket TryFrom impl 2019-02-13 18:00:18 +01:00
Simon Sapin
85f13f0d42 Add a convert::Infallible empty enum, make string::ParseError an alias 2019-02-13 18:00:18 +01:00
Ralf Jung
7f5dc49214 review or fix miri failures in iter, slice, cell, time 2019-02-13 17:56:43 +01:00
Ralf Jung
26ade1cfaa mark failures expected due to panics 2019-02-13 17:56:43 +01:00
Clint Frederickson
755b320279 simplified conditional 2019-02-13 09:34:29 -07:00
Ralf Jung
719be246ae fix Box::into_unique effecitvely transmuting to a raw ptr 2019-02-13 17:26:08 +01:00
Ralf Jung
f0bef49cf1 fix invalidating references in BTree iterators 2019-02-13 17:25:41 +01:00
Ralf Jung
d87df696b1 fix overlapping mutable and shared references in BTreeMap's into_slices_mut 2019-02-13 17:25:41 +01:00
Clint Frederickson
96fd2181ba check if used_place and moved_place are equal when determining if the move was partial 2019-02-13 08:48:37 -07:00
Lzu Tao
e7f8e63ed4 Convert old doc links to current edition
Use footnote style to bypass the tidy check
2019-02-13 14:39:25 +00:00
bors
e544947278 Auto merge of #56951 - oli-obk:auto_toolstate_issue, r=kennytm
Automatically open an issue when a tool breaks

cc @nikomatsakis

fixes https://github.com/rust-lang-nursery/rust-toolstate/issues/6

documentation about issue opening via the github api: https://developer.github.com/v3/issues/#create-an-issue
2019-02-13 13:08:30 +00:00
Valentin Tolmer
26bd43355f Move the intrinsics into a submodule 2019-02-13 13:31:11 +01:00
Vitaly _Vi Shukela
91f67fd1a7
Add Instant::saturating_duration_since 2019-02-13 15:08:44 +03:00
Anthony Ramine
ac32359f08 Relax some Ord bounds on BinaryHeap<T>
Notably, iterators don't require any trait bounds to be iterated.
2019-02-13 12:35:23 +01:00
Anthony Ramine
95840b35fc Relax Read bounds on a bunch of BufReader<R> methods 2019-02-13 12:30:53 +01:00
Anthony Ramine
d9e2259d65 Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S>
Notably, hash iterators don't require any trait bounds to be iterated.
2019-02-13 12:23:14 +01:00
David Rheinsberg
15e4bd3bf4 target/uefi: clarify documentation
This clarifies why FP-units are disabled on UEFI targets, as well as
why we must opt into the NXCOMPAT feature.

I did find some time to investigate why GRUB and friends disable FP on
UEFI. The specification explicitly allows using MMX/SSE/AVX, but as it
turns out it does not mandate enabling the instruction sets explicitly.
Hence, any use of these instructions will trigger CPU exceptions,
unless an application explicitly enables them (which is not an option,
as these are global flags that better be controlled by the
kernel/firmware).

Furthermore, UEFI systems are allowed to mark any non-code page as
non-executable. Hence, we must make sure to never place code on the
stack or heap. So we better pass /NXCOMPAT to the linker for it to
complain if it ever places code in non-code pages.

Lastly, this fixes some typos in related comments.
2019-02-13 11:55:17 +01:00
bors
c005afcb1e Auto merge of #58238 - Mark-Simulacrum:doctest-fix, r=alexcrichton
Fixes rustdoc in stage 0, stage 1

When a request for rustdoc is passed for stage 0, x.py build --stage 0
src/tools/rustdoc or ensure(tool::Rustdoc { .. }) with top_stage = 0, we
return the rustdoc for that compiler (i.e., the beta rustdoc).

This fixes stage 0 of https://github.com/rust-lang/rust/issues/52186 as well as being part of general workflow improvements (making stage 0 testing for std work) for rustbuild.

The stage 1 fix (second commit) completely resolves the problem, so this fixes https://github.com/rust-lang/rust/issues/52186.
2019-02-13 10:27:50 +00:00
Vitaly _Vi Shukela
d15c358000
Fix tests for checked_duration_since 2019-02-13 13:17:33 +03:00
Ralf Jung
22d5e6a37a fix rebase fallout 2019-02-13 11:14:40 +01:00
Mazdak Farrokhzad
a4964500a2
Update RELEASES.md
Co-Authored-By: Aaronepower <Aaronepower@users.noreply.github.com>
2019-02-13 10:54:13 +01:00
Ralf Jung
1a5304ae93 fix whitespace 2019-02-13 10:14:56 +01:00
Ralf Jung
b376ae6671 make bin_op and unary_op APIs consistently work on ImmTy 2019-02-13 10:14:56 +01:00
Ralf Jung
e73f96abe7 make OpTy.op private, and ImmTy.imm public instead 2019-02-13 10:14:56 +01:00
ljedrz
eac43ccda4 HirId-ify hir::BodyId 2019-02-13 09:54:58 +01:00
bors
ccd23b95e5 Auto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcrichton
SGX target: simplify usercall internals

This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling.

Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.

cc @VardhanThigle

r? @alexcrichton
2019-02-13 07:46:21 +00:00