85211 Commits

Author SHA1 Message Date
Ralf Jung
06a4911ce1 run-time validation: accept undef in int arrays, as we do for ints 2018-10-13 09:09:03 +02:00
Ralf Jung
b2ddd27c2e address nits 2018-10-13 09:09:03 +02:00
Ralf Jung
dc4b2771f8 validation: accept pointers in integer arrays 2018-10-13 09:09:03 +02:00
Ralf Jung
c96eb706f0 Fix and test upvar name printing for validity 2018-10-13 09:09:03 +02:00
Ralf Jung
69576fcdee make ENFORCE_VALIDITY a function
miri needs this extra flexibility
2018-10-13 09:09:03 +02:00
Ralf Jung
3272c9845c foreign types: use size and align from layout 2018-10-13 09:09:03 +02:00
Ralf Jung
d0c585c525 seems like for generators we cannot access the freevars 2018-10-13 09:09:03 +02:00
Ralf Jung
93f53e5113 size_and_align_of can return no result for extern types 2018-10-13 09:09:03 +02:00
Ralf Jung
f79a22c3d5 validate return value on stack pop 2018-10-13 09:09:02 +02:00
Ralf Jung
a05914e2dc check return type even for uninhabited case 2018-10-13 09:09:02 +02:00
Ralf Jung
5b75ec0a91 fix validation around transmuting copy_op 2018-10-13 09:09:02 +02:00
bors
fb3b47aa42 Auto merge of #54980 - zackmdavis:and_the_case_of_the_universal_call, r=oli-obk
structured suggestion for E0223 ambiguous associated type

(routine (and when are we going to be done finding these, anyway?) but something that stuck out to me while glancing at #54970)

r? @estebank
2018-10-13 06:48:17 +00:00
Zack M. Davis
ab91a6b4df #[must_use] for associated functions is supposed to actually work
In the comments of (closed, defunct) pull request #54884, Mazdak
"Centril" Farrokhzad noted that must-use annotations didn't work on an
associated function (what other communities might call a "static
method"). Subsequent logging revealed that in this case we have a
`Def::Method`, whereas the lint pass was only matching on
`Def::Fn`. (One could argue that those def-names are thereby
misleading—must-use for self-ful methods have always worked—but
documenting or reworking that can be left to another day.)
2018-10-12 22:01:43 -07:00
bors
c47785f6be Auto merge of #54945 - estebank:asm-span, r=petrochenkov
Point to variable in `asm!` macro when failing borrowck

Fix #34940.
2018-10-13 00:56:30 +00:00
Eric Huss
09f42dd902 Add missing lifetime fragment specifier to error message.
A very minor issue, `lifetime` was missing from the error list.
I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-12 17:51:48 -07:00
Alex Crichton
9562b69b4f rustc: Allow targets to specify SIMD args are by-val
The upcoming SIMD support in the wasm target is unique from the other
platforms where it's either unconditionally available or not available,
there's no halfway where a subsection of the program can use it but no
other parts of the program can use it. In this world it's valid for wasm
SIMD args to always be passed by value and there's no need to pass them
by reference.

This commit adds a new custom target specification option
`simd_types_indirect` which defaults to `true`, but the wasm backend
disables this and sets it to `false`.
2018-10-12 17:04:31 -07:00
Andy Russell
1811f1322a
raise ICE if LLVM worker threads panic 2018-10-12 17:30:13 -04:00
Andy Russell
00e1f5b8df
exit with status code 101 on fatal LLVM error
Fixes #54992.
2018-10-12 17:29:40 -04:00
bors
2c2e2c57dc Auto merge of #54942 - matthewjasper:wf-type-annotations, r=nikomatsakis
[NLL] Check user types are well-formed

Also contains a change of span for AscribeUserType.
I'm not quite sure if this was what @nikomatsakis was thinking.

Closes #54620

r? @nikomatsakis
2018-10-12 21:28:42 +00:00
memoryruins
ba446d72be Add nll stderr to #52240 2018-10-12 14:33:38 -04:00
memoryruins
b041a79f26 Add test for issue #52240
Closes #52240
2018-10-12 13:08:44 -04:00
Andy Russell
0e268d9e89
add test for #24421
Fixes #24421.
2018-10-12 13:07:39 -04:00
memoryruins
146fbc6a96 Add test for issue #54966
Closes #54966
2018-10-12 12:42:33 -04:00
Andy Russell
3855af5734
add test for #23189
Fixes #23189.
2018-10-12 12:21:22 -04:00
bors
945372d268 Auto merge of #55012 - kennytm:rollup, r=kennytm
Rollup of 16 pull requests

Successful merges:

 - #54755 (Documents reference equality by address (#54197))
 - #54811 (During rustc bootstrap, make default for `optimize` independent of `debug`)
 - #54825 (NLL says "borrowed content" instead of more precise "dereference of raw pointer")
 - #54860 (Add doc comments about safest way to initialize a vector of zeros)
 - #54869 (Fix mobile docs)
 - #54891 (Fix tracking issue for Once::is_completed)
 - #54913 (doc fix: it's auto traits that make for automatic implementations)
 - #54920 (Fix handling of #[must_use] on unit and uninhabited types)
 - #54932 (A handful of random string-related improvements)
 - #54936 (impl Eq+Hash for TyLayout)
 - #54950 (std: Synchronize global allocator on wasm32)
 - #54956 ("(using ..." doesn't have the matching ")")
 - #54958 (add a macro for static (compile-time) assertions)
 - #54967 (Remove incorrect span for second label inner macro invocation)
 - #54983 (Fix slice's benchmarks)
 - #54989 (Fix spelling in the documentation to htmldocck.py)

Failed merges:

r? @ghost
2018-10-12 15:00:24 +00:00
kennytm
d64c77a671
Rollup merge of #54989 - Munksgaard:fix-htmldocck-typos, r=tmandry
Fix spelling in the documentation to htmldocck.py

I was reading through htmldocck.py, and decided to attempt to clean it up a little bit. Let me know if you disagree with my edits.
2018-10-12 22:04:19 +08:00
kennytm
9eae552a44
Rollup merge of #54983 - kzys:rand-bench, r=tmandry
Fix slice's benchmarks

Fixes #54013.
2018-10-12 22:04:18 +08:00
kennytm
644dbf99ed
Rollup merge of #54967 - holmgr:master, r=estebank
Remove incorrect span for second label inner macro invocation

A fix for issue #54841
2018-10-12 22:04:16 +08:00
kennytm
0187e81da9
Rollup merge of #54958 - RalfJung:static-assert, r=oli-obk
add a macro for static (compile-time) assertions

Cc @oli-obk
2018-10-12 22:04:15 +08:00
kennytm
8e3f189180
Rollup merge of #54956 - kzys:close-paren, r=varkor
"(using ..." doesn't have the matching ")"

Fixes #54948.
2018-10-12 22:04:14 +08:00
kennytm
8d3d96f08a
Rollup merge of #54950 - alexcrichton:wasm-sync-allocator, r=sfackler
std: Synchronize global allocator on wasm32

We originally didn't have threads, and now we're starting to add them!
Make sure we properly synchronize access to dlmalloc when the `atomics`
feature is enabled for `wasm32-unknown-unknown`.
2018-10-12 22:04:13 +08:00
kennytm
4f1a618e5d
Rollup merge of #54936 - RalfJung:layout-hash, r=oli-obk
impl Eq+Hash for TyLayout

As proposed by @eddyb at https://github.com/rust-lang/rust/pull/53671#pullrequestreview-159761136.

I have an upcoming PR that would also significantly benefit from this.
2018-10-12 22:04:12 +08:00
kennytm
fcb3ce4f53
Rollup merge of #54932 - ljedrz:a_handful_of_string_improvements, r=alexcrichton
A handful of random string-related improvements

- remove a few allocations in `errors/diagnostic`
- make `build_helper::gnu_target` return `Cow<str>`
2018-10-12 22:04:10 +08:00
kennytm
b39535d157
Rollup merge of #54920 - varkor:must_use-unit, r=estebank
Fix handling of #[must_use] on unit and uninhabited types

Fixes https://github.com/rust-lang/rust/issues/54828.
2018-10-12 22:04:09 +08:00
kennytm
80ee322a20
Rollup merge of #54913 - RalfJung:unwind-safe, r=alexcrichton
doc fix: it's auto traits that make for automatic implementations

Being a marker trait is not good enough (that just means "no items in the trait").

r? @alexcrichton who [originally wrote these docs](0a13f1abaf).
2018-10-12 22:04:08 +08:00
kennytm
ef7f77d53d
Rollup merge of #54891 - rust-lang:SimonSapin-patch-1, r=nagisa
Fix tracking issue for Once::is_completed

https://github.com/rust-lang/rust/pull/53027 was merged without a tracking issue. I just filed https://github.com/rust-lang/rust/issues/54890. CC @matklad
2018-10-12 22:04:07 +08:00
kennytm
8d85b893d8
Rollup merge of #54869 - GuillaumeGomez:fix-mobile-docs, r=QuietMisdreavus
Fix mobile docs

Fixes #54836.

<img width="1440" alt="screen shot 2018-10-06 at 18 53 19" src="https://user-images.githubusercontent.com/3050060/46573683-1b4cd700-c999-11e8-9e6b-86a23b332e22.png">

r? @QuietMisdreavus
2018-10-12 22:04:05 +08:00
kennytm
365d4c94f6
Rollup merge of #54860 - mandeep:vec-initialize, r=alexcrichton
Add doc comments about safest way to initialize a vector of zeros

This adds more information about the vec! macro as discussed in #54628. I think this is a good starting point, but I think additional detail is needed so that we can explain why vec! is safer than the alternatives.
2018-10-12 22:04:04 +08:00
kennytm
44a527a27a
Rollup merge of #54825 - davidtwco:issue-52663-deref-raw-pointer, r=pnkfelix
NLL says "borrowed content" instead of more precise "dereference of raw pointer"

Part of #52663.

Previously, move errors involving the dereference of a raw pointer would
say "borrowed content". This commit changes it to say "dereference of
raw pointer".

r? @nikomatsakis
cc @pnkfelix
2018-10-12 22:04:03 +08:00
kennytm
e03db2301e
Rollup merge of #54811 - pnkfelix:issue-24840-separate-bootstrap-default-for-optimize-from-debug-setting, r=nikomatsakis
During rustc bootstrap, make default for `optimize` independent of `debug`

It may have taken me three and a half years, but I'm following through on my ["threat"](https://github.com/rust-lang/rust/issues/24840#issuecomment-97911700)

Fix #24840
2018-10-12 22:04:01 +08:00
kennytm
8455468d0d
Rollup merge of #54755 - lucasloisp:document-reference-address-eq, r=QuietMisdreavus
Documents reference equality by address (#54197)

Clarification of the use of `ptr::eq` to test equality of references via address by pointer coercion,  regarding issue #54197 .

The same example as in `ptr::eq` docs is shown here to clarify that
`PartialEq` compares values pointed-to instead of via address (which can be desired in some cases)
2018-10-12 22:04:00 +08:00
ljedrz
39753c8973 rustc/driver: improve macro calls 2018-10-12 14:01:25 +02:00
bors
e9e27e6a62 Auto merge of #54715 - oli-obk:nll_deref_promotion, r=RalfJung
Fix #54224 (const promotion regression)

r? @eddyb
2018-10-12 12:00:50 +00:00
ljedrz
5bfe08fc71 rustc/driver: simplify profile::trace::cons 2018-10-12 13:55:35 +02:00
bors
849a0e9c40 Auto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavus
Improve error display for codeblocks in rustdoc

Part of #53919.

r? @QuietMisdreavus
2018-10-12 09:23:10 +00:00
Oliver Scherer
76f8a90d53 Add comments explaining why some operations are not constant inside normal functions 2018-10-12 09:30:28 +02:00
bors
8dc554a325 Auto merge of #54534 - nagisa:align-offset-simplification, r=alexcrichton
Simplify implementation of align_offset slightly
2018-10-12 06:38:11 +00:00
Zack M. Davis
a5de379b55 structured suggestion for E0223 ambiguous associated type
It looks like we tend to use angle-brackets around the placeholder in
the few other places we use `Applicability::HasPlaceholders`, but that
would be confusing here, so ...
2018-10-11 21:10:35 -07:00
bors
567557f630 Auto merge of #54924 - RalfJung:use-maybe-uninit2, r=cramertj
Use MaybeUninit in liballoc

All code by @japaric. This is a re-submission of a part of https://github.com/rust-lang/rust/pull/53508 that hopefully does not regress performance.
2018-10-12 02:14:47 +00:00
Esteban Küber
5beeb535e1 Reword Range*/[Range*]: Iterator E0277 messages 2018-10-11 13:44:07 -07:00