Commit Graph

72780 Commits

Author SHA1 Message Date
kennytm
b60e6f8285 Rollup merge of #46898 - tspiteri:int-overflow-not-underflow, r=steveklabnik
docs: do not call integer overflows as underflows

In the API docs, integer overflow is sometimes called underflow. Underflow is really when the magnitude of a floating-point number is too small so the number underflows to subnormal or zero. With integers it is always overflow, even if the expected result is less than the minimum number that can be represented.
2017-12-22 02:50:57 +08:00
kennytm
8acc406cf6 Rollup merge of #46890 - arielb1:contributing-improvements, r=steveklabnik
A few small improvements to the contributing docs

r? @steveklabnik
2017-12-22 02:50:56 +08:00
kennytm
7767d84a68 Rollup merge of #46884 - Manishearth:vec-docs, r=steveklabnik
Clarify vec docs on deallocation (fixes #46879)

r? @steveklabnik
2017-12-22 02:50:55 +08:00
kennytm
4802a85392 Rollup merge of #46878 - malbarbo:fix-armv5te, r=alexcrichton
Update compiler_builtins

Fixes https://github.com/rust-lang/rust/issues/46822 (See https://github.com/rust-lang-nursery/compiler-builtins/pull/218)
2017-12-22 02:50:54 +08:00
kennytm
696e951fe9 Rollup merge of #46858 - QuietMisdreavus:external-doc-error, r=estebank
tweaks and fixes for doc(include)

This PR makes a handful of changes around `#[doc(include="file.md")]` (https://github.com/rust-lang/rust/issues/44732):

* Turns errors when loading files into full errors. This matches the original RFC text.
* Makes the `missing_docs` lint check for `#[doc(include="file.md")]` as well as regular `#[doc="text"]` attributes.
* Loads files included by `#[doc(include="file.md")]` into dep-info, mirroring the behavior of `include_str!()` and friends.
* Adds or modifies tests to check for all of these.
2017-12-22 02:50:53 +08:00
kennytm
256bf2be62 Rollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavus
Escape more items in the sidebar when needed

Fixes #46724.

r? @QuietMisdreavus
2017-12-22 02:50:52 +08:00
kennytm
614e285fa9 Rollup merge of #46839 - michaelwoerister:faster-span-hashing-2, r=nikomatsakis
incr.comp.: Precompute small hash for filenames to save some work.

For each span we hash the filename of the file it points to. Since filenames can be quite long, especially with absolute paths, this PR pre-computes a hash of the filename and we then only hash the hash.

r? @nikomatsakis
2017-12-22 02:50:51 +08:00
kennytm
dc00aa4983 Rollup merge of #46820 - nodakai:simplify-int-impl, r=alexcrichton
libcore/num/mod.rs: simplify the int_impl! macro.

We can simply use generic intrinsics since cd1848a1a6 by @alexcrichton

Also, minimize unsafe blocks.
2017-12-22 02:50:50 +08:00
kennytm
0ee069c70a Rollup merge of #46814 - varkor:contrib-7, r=alexcrichton
Prevent rustc overwriting input files

If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019. Kudos to @estebank, whose patch I finished off.
2017-12-22 02:50:49 +08:00
kennytm
d4981e9742 Rollup merge of #46809 - eddyb:issue-46769-optimal, r=arielb1
rustc: do not raise the alignment of optimized enums to the niche's alignment.

This is the improved fix for #46769 that does not increase the size of any types (see also #46808).
2017-12-22 02:50:49 +08:00
kennytm
9341321be4 Rollup merge of #46784 - bjorn3:patch-1, r=pnkfelix
Cleanup for libgraphviz
2017-12-22 02:50:48 +08:00
kennytm
44670448b2 Rollup merge of #46780 - varkor:contrib-5, r=arielb1
Fix ICE when calling non-functions within closures

The visitor for walking function bodies did not previously properly
handle error-cases for function calls. These are now ignored,
preventing the panic. This fixes #46771.
2017-12-22 02:50:47 +08:00
kennytm
71c6d23612 Rollup merge of #46636 - frewsxcv:frewsxcv-fn-box, r=estebank
Replace libtest/lib.rs:FnBox with std::boxed::FnBox.

Fixes https://github.com/rust-lang/rust/issues/41810.
2017-12-22 02:50:45 +08:00
bors
eff3de0927 Auto merge of #46904 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 5 pull requests

- Successful merges: #46827, #46853, #46860, #46861, #46887
- Failed merges:
2017-12-21 13:34:09 +00:00
Guillaume Gomez
bdd3f5b240 Rollup merge of #46887 - pnkfelix:ensure-activations-are-from-assignments-to-locals, r=arielb1
Ensure separate activations only occur for assignments to locals

Ensure separate activations only occur for assignments to locals, not projections.

Fix #46746.

(I didn't make a regression test because we do not really have a good way to directly express the case that we are trying to catch, because we cannot write MIR directly.)
2017-12-21 13:18:21 +01:00
Guillaume Gomez
1219494f6f Rollup merge of #46861 - GuillaumeGomez:fix-ios-sidebar, r=QuietMisdreavus
Fix sidebar on ios

r? @QuietMisdreavus
2017-12-21 13:18:21 +01:00
Guillaume Gomez
2770fdfaaa Rollup merge of #46860 - estebank:candidate-def-sp, r=petrochenkov
Use def span for associated function suggestions
2017-12-21 13:18:20 +01:00
Guillaume Gomez
365f7574b2 Rollup merge of #46853 - GuillaumeGomez:fix-rustdoc-warning, r=QuietMisdreavus
Fix some rustdoc warnings

r? @QuietMisdreavus

cc @steveklabnik
2017-12-21 13:18:19 +01:00
Guillaume Gomez
2917ac6b59 Rollup merge of #46827 - petrochenkov:assocrecov2, r=estebank
syntax: Follow-up to the incorrect qpath recovery PR

cc https://github.com/rust-lang/rust/pull/46788

Add tests checking that "priority" of qpath recovery is higher than priority of unary and binary operators
Fix regressed parsing of paths with fn-like generic arguments
r? @estebank
2017-12-21 13:18:18 +01:00
Guillaume Gomez
d4424d84fb Escape more items in the sidebar when needed 2017-12-21 13:17:15 +01:00
bors
de38f49528 Auto merge of #46772 - alexcrichton:thinlto-passes, r=michaelwoerister
rustc: Work around `DICompileUnit` bugs in LLVM

This commit implements a workaround for #46346 which basically just
avoids triggering the situation that LLVM's bug
https://bugs.llvm.org/show_bug.cgi?id=35562 arises. More details can be
found in the code itself but this commit is also intended to ...

Closes #46346
2017-12-21 10:56:44 +00:00
bors
ab7abfcf34 Auto merge of #46754 - cramertj:refactor-arg-impl, r=nikomatsakis
Refactor argument-position impl Trait

Fixes https://github.com/rust-lang/rust/issues/46685, https://github.com/rust-lang/rust/issues/46470

r? @nikomatsakis
cc @chrisvittal
2017-12-21 08:04:57 +00:00
bors
957dc8de63 Auto merge of #46531 - cramertj:no-mo-modrs, r=nikomatsakis
Implement non-mod.rs mod statements

Fixes https://github.com/rust-lang/rust/issues/45385, cc https://github.com/rust-lang/rust/issues/44660

This will fail tidy right now because it doesn't recognize my UI tests as feature-gate tests. However, I'm not sure if compile-fail will work out either because compile-fail usually requires there to be error patterns in the top-level file, which isn't possible with this feature. What's the recommended way to handle this?
2017-12-21 05:24:45 +00:00
bors
a12706ca71 Auto merge of #46083 - petrochenkov:morepriv, r=nikomatsakis
Type privacy polishing

Various preparations before implementing https://github.com/rust-lang/rfcs/pull/2145 containing final minor breaking changes (mostly for unstable code or code using `allow(private_in_public)`).
(Continuation of https://github.com/rust-lang/rust/pull/42125, https://github.com/rust-lang/rust/pull/44633 and https://github.com/rust-lang/rust/pull/41332.)

It would be good to run crater on this.
r? @eddyb
2017-12-21 02:48:17 +00:00
Trevor Spiteri
9d6bd0536a docs: do not call integer overflows as underflows 2017-12-21 02:39:01 +01:00
Vadim Petrochenkov
c6209a36bb Always report private-in-public in associated types as hard errors
according to RFC 2145.

Fix a silly label message.
2017-12-21 03:19:05 +03:00
Vadim Petrochenkov
020961d880 Prohibit access to private statics from other crates through macros 2.0 2017-12-21 03:17:19 +03:00
Vadim Petrochenkov
190adc0e19 Properly check traits in type privacy 2017-12-21 03:17:19 +03:00
Vadim Petrochenkov
53779ed5ec Check associated type bindings for privacy and stability 2017-12-21 03:17:19 +03:00
Vadim Petrochenkov
8dcd26a6df Add tests for associated item privacy 2017-12-21 03:17:19 +03:00
bors
fdfb007109 Auto merge of #46862 - nikomatsakis:nll-master, r=arielb1
NLL feature complete (adds `feature(nll)`)!

This is the final PR for the nll-master branch; it brings over all remaining content.

The contents of the branch include:

- track causal information and use it to report extended errors
- handle `impl Trait` in NLL code
- improve printing of outlives errors
- add `#![feature(nll)]` and some more sample tests

The commits should for the most part build independently.

r? @pnkfelix (and/or @arielb1)
2017-12-20 23:26:20 +00:00
Niko Matsakis
d925f4d1dd fix truncated comment 2017-12-20 16:51:33 -05:00
Niko Matsakis
4f549fe4fe improve comment about instantiating anon types 2017-12-20 16:48:41 -05:00
Ariel Ben-Yehuda
f68e11b440 A few small improvements to the contributing docs 2017-12-20 22:18:13 +02:00
Vadim Petrochenkov
d333752f5c Fix parsing of paths with fn-like generic arguments 2017-12-20 22:55:57 +03:00
Vadim Petrochenkov
eef85cf0ff Add tests checking taht "priority" of qpath recovery is higher than unary and binary operators 2017-12-20 22:43:47 +03:00
Vadim Petrochenkov
9a68098e87 Move impls for qpath recovery trait from ast.rs 2017-12-20 22:43:47 +03:00
Niko Matsakis
3f490ca4bd convert region-liveness-drop{-,-no-}may-dangle.rs into ui tests
The "match exact bits of CFG" approach was fragile and uninformative.
2017-12-20 14:38:13 -05:00
Niko Matsakis
cba82561cf add some run-pass tests for NLL showing that things work as expected 2017-12-20 14:38:13 -05:00
Niko Matsakis
80c510e353 when using feature(nll), don't warn about AST-based region errors
Also, keep reporting AST-based region errors that are not occuring in
a fn body.
2017-12-20 14:38:13 -05:00
Niko Matsakis
cfa4ffa374 document and tweak the nll, use_mir, etc helpers
In particular, -Znll might as well imply -Zborrowck=mir by default,
just like `#![feature(nll)]` does.

Also, if NLL is in use, no reason to emit end regions. The NLL pass
just strips them out anyway.
2017-12-20 14:38:13 -05:00
Santiago Pastorino
e980fb8bef feature nll implies borrowck=mir 2017-12-20 14:38:13 -05:00
Santiago Pastorino
2019d69f61 feature nll implies two-phase-borrows 2017-12-20 14:38:13 -05:00
Santiago Pastorino
0b2db1e616 Add nll feature and make nll imply nll_dump_cause 2017-12-20 14:38:12 -05:00
Santiago Pastorino
95b6148e31 Add nll_dump_cause helper to Session 2017-12-20 14:38:12 -05:00
Niko Matsakis
508a831dca use report_generic_bound_failure when we can in the compiler 2017-12-20 14:38:12 -05:00
Niko Matsakis
3788f4207d refactor report_generic_bound_failure to be usable by NLL code 2017-12-20 14:38:12 -05:00
Niko Matsakis
6b39781df6 connect NLL machinery to the NiceRegionError code 2017-12-20 14:38:12 -05:00
Niko Matsakis
94e7072d0b give precedence to try_report_named_anon_conflict method 2017-12-20 14:38:12 -05:00
Niko Matsakis
de563082c8 use Option<ErrorReported> instead of bool
Also allows us to replace `or_false` with `?`.

No functional change
2017-12-20 14:38:11 -05:00