Commit Graph

76134 Commits

Author SHA1 Message Date
ashtneoi
671d7e064f Change a method name and clarify a comment 2018-08-15 15:14:21 -07:00
ashtneoi
bd2b54c23c Bless tests 2018-08-15 15:14:21 -07:00
ashtneoi
a5b008c450 Test move-into-Fn/FnMut errors too 2018-08-15 15:14:21 -07:00
ashtneoi
6a24abbbc5 Fix compiletest JSON error message 2018-08-15 15:14:21 -07:00
ashtneoi
3c3a7bad49 Allocate fewer Strings at a time 2018-08-15 15:14:21 -07:00
ashtneoi
81c27c6af7 Add another FIXME about suggestions 2018-08-15 15:14:21 -07:00
ashtneoi
9a0020a879 Bless UI tests 2018-08-15 15:14:21 -07:00
ashtneoi
d6dbdee739 Remove incorrect space 2018-08-15 15:14:21 -07:00
ashtneoi
a583aa642e Remove unnecessary comment
Turns out I didn't read the original comment correctly and had some
confusion about how MIR uses temporaries.
2018-08-15 15:14:21 -07:00
ashtneoi
0a82abc47b Test patterns in tuples 2018-08-15 15:14:21 -07:00
ashtneoi
6cf4e14ac0 Coalesce var-is-not-Copy notes per move 2018-08-15 15:14:21 -07:00
ashtneoi
20ae08bda6 Dedup suggestions 2018-08-15 15:14:21 -07:00
ashtneoi
40b5118c8a Remove unnecessary underscore 2018-08-15 15:14:21 -07:00
ashtneoi
8135372ed1 Change TODOs to FIXMEs 2018-08-15 15:14:21 -07:00
ashtneoi
10aaba8dbe Make move errors more consistent with typeck errors 2018-08-15 15:14:21 -07:00
ashtneoi
701c74e067 Make move error suggestions clearer 2018-08-15 15:14:21 -07:00
ashtneoi
b05e9a7f77 Add backquotes around variable name 2018-08-15 15:14:21 -07:00
ashtneoi
8080bdf275 Fix move errors for index expressions
The suggestion logic gave up too early, which kept it from suggesting
borrowing index expressions.
2018-08-15 15:14:21 -07:00
ashtneoi
54ddb36ce7 Test move errors for index expressions 2018-08-15 15:14:21 -07:00
ashtneoi
1e87908c52 Accept whitespace between & and mut 2018-08-15 15:14:21 -07:00
ashtneoi
3a5812bdd9 Add more TODOs 2018-08-15 15:14:21 -07:00
ashtneoi
a05f82fd2d Suggest match ergonomics, not ref/ref mut 2018-08-15 15:14:21 -07:00
ashtneoi
7b10133297 Fix some random stuff 2018-08-15 15:10:43 -07:00
Felix S. Klock II
cd89fdbbc9 Removed ignore-test-compare-mode-nll from unboxed-closures tests
by strengthening the tests (by adding no-op references to the
closures doing the borrows after the conflicting borrows, thus
forcing the lifetimes to resemble lexical scopes even under NLL).
2018-08-15 23:47:29 +02:00
Felix S. Klock II
f8084c675e Removed ignore-test-compare-mode-nll from hashmap-lifetimes.rs
by strengthening the test there.
2018-08-15 23:47:28 +02:00
Felix S. Klock II
fb3ccb2aa2 Removed ignore-test-compare-mode-nll from borrowck-closures-two-mut-fail.rs
by strengthening the tests there.
2018-08-15 23:47:28 +02:00
Felix S. Klock II
dd9f84f2d3 Removed ignore-test-compare-mode-nll from borrowck-closures-unique.rs
by strengthening the tests there.

In almost all cases the strengthening amount to just encoding a use
that models the original lexical lifetime. A more invasive revision
was made in one case where it seems the actual issue is MIR-borrowck's
greater "knowledge" of unreachable code in the control flow...
2018-08-15 23:47:28 +02:00
Esteban Küber
1b5e29ae6f Do not emit "incorrect close delimiter" twice in the same place 2018-08-15 14:26:03 -07:00
Esteban Küber
2a74d7924a Tweak unclosed delimiter parser error 2018-08-15 13:18:34 -07:00
Esteban Küber
5a0a38a46f Do not suggest conversion method that is already there 2018-08-15 13:04:24 -07:00
bors
d767ee1161 Auto merge of #53400 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #52453 (improve diagnostics for tests with custom return values)
 - #53271 (use ? to simplify `TransitiveRelation.maybe_map`)
 - #53279 (Extend documentation of `rustc_on_unimplemented`)
 - #53342 (fix error for unsized packed struct field)
 - #53344 (Add doc examples for std::alloc::{alloc,alloc_zeroed}.)
 - #53368 (Ignore test that fails on stage1)
 - #53388 (Fix links' color)
 - #53396 (Fix since of Iterator::flatten to be a proper semver)

Failed merges:

r? @ghost
2018-08-15 19:39:54 +00:00
Pazzaz
b063bd4616 Test VecDeque append not dropping twice 2018-08-15 19:42:07 +02:00
Guillaume Gomez
b9a51ce2f6
Rollup merge of #53396 - matklad:fix-flatten-since, r=varkor
Fix since of Iterator::flatten to be a proper semver

r? @kennytm
2018-08-15 19:20:29 +02:00
Guillaume Gomez
7acfa8615a
Rollup merge of #53388 - GuillaumeGomez:fix-links-color, r=frewsxcv
Fix links' color

Fixes #53375.

Problem was coming from the minifier.

r? @frewsxcv
2018-08-15 19:20:28 +02:00
Guillaume Gomez
a9a67a3a76
Rollup merge of #53368 - matthewjasper:only-stage-2, r=varkor
Ignore test that fails on stage1

The error code is not emitted on stage1, so ignore this test there.
2018-08-15 19:20:26 +02:00
Guillaume Gomez
25839dd9c6
Rollup merge of #53344 - frewsxcv:frewsxcv-doc-ptr, r=ollie27
Add doc examples for std::alloc::{alloc,alloc_zeroed}.

None
2018-08-15 19:20:25 +02:00
Guillaume Gomez
6bea743d56
Rollup merge of #53342 - RalfJung:unsized-packed, r=cramertj
fix error for unsized packed struct field

It was really confusing to be told "only the last field of a struct may have a dynamically sized type" when only the last field *was* unsized.
2018-08-15 19:20:23 +02:00
Guillaume Gomez
8e4f2d115a
Rollup merge of #53279 - estebank:on-unimplemented-doc, r=GuillaumeGomez
Extend documentation of `rustc_on_unimplemented`
2018-08-15 19:20:22 +02:00
Guillaume Gomez
b941c8e7fb
Rollup merge of #53271 - llogiq:simplify-maybe-map, r=joshtriplett
use ? to simplify `TransitiveRelation.maybe_map`

I think this looks much clearer than the original.
2018-08-15 19:20:21 +02:00
Guillaume Gomez
d8815cfe7d
Rollup merge of #52453 - srijs:fix-52436, r=TimNN
improve diagnostics for tests with custom return values

This is an attempt at getting the ball rolling to improve the diagnostics for test functions that return custom `impl Termination` values (see #52436).

An alternative could be to use `eprintln!`, but including this in the panic message felt nicely consistent with how failing test assertions would be reported.

Let me know what you think!
2018-08-15 19:20:19 +02:00
bors
d679b57a3a Auto merge of #53164 - davidtwco:issue-52663-span-decl-captured-variables, r=nikomatsakis
Provide span for declaration of captured variables

Part of #52663.

r? @nikomatsakis
2018-08-15 17:03:39 +00:00
varkor
35a03c8052 Tidy: ignore non-Markdown files when linting for the Unstable Book 2018-08-15 18:01:37 +01:00
varkor
27f2a8420f Remove outdated Unstable Book sections 2018-08-15 17:56:53 +01:00
varkor
23d10ec4cc Visit all attributes for feature collection 2018-08-15 17:34:56 +01:00
Aleksey Kladov
1a0d3f0979 Fix since of Iterator::flatten to be a proper semver 2018-08-15 19:28:42 +03:00
varkor
f541ab226c Make cloudapi enums #[non_exhaustive] 2018-08-15 17:16:48 +01:00
varkor
ea505fd60b Make std::io::Error #[non_exhaustive] 2018-08-15 17:16:48 +01:00
varkor
a50224804d Make proc_macro Level #[non_exhaustive] 2018-08-15 17:11:42 +01:00
varkor
bbf0b159b7 Make core::sync::atomic::Ordering #[non_exhaustive] 2018-08-15 17:11:42 +01:00
Pazzaz
76625280b2 Clarify unused_as_mut_slices 2018-08-15 18:01:42 +02:00
bors
0f4b4987cd Auto merge of #53237 - overdrivenpotato:wasm-export-table, r=alexcrichton
Export WASM table by default

This allows loading a rust-generated `.wasm` binary in a host and using the exported table much like the `memory` export.
2018-08-15 14:40:46 +00:00
Guillaume Gomez
cf5ee8f59b Fix links' color 2018-08-15 15:07:07 +02:00
Michael Woerister
d662083a6c Use CGU name as LLVM module name and add some caching to CGU name generation. 2018-08-15 14:50:54 +02:00
bors
5db71dbae8 Auto merge of #53133 - Zoxc:gen-int, r=eddyb
Record adjustments and original type for expressions in the generator interior

Fixes https://github.com/rust-lang/rust/issues/50878 and https://github.com/rust-lang/rust/issues/52398.

r? @eddyb
2018-08-15 12:02:00 +00:00
Andre Bogus
4cae6650fd Two small improvements
In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to
simplify the code. In `libserialize/json.rs`, make use of the fact
that `Vec.last` on an empty `Vec` returns `None` to simplify the
code to a single match.
2018-08-15 13:54:47 +02:00
Michael Woerister
e192e498ab Fix some run-make tests after object file naming has changed. 2018-08-15 13:47:39 +02:00
Michael Woerister
c09a8e5223 Adapt codegen-unit tests to new CGU naming scheme. 2018-08-15 13:47:39 +02:00
Michael Woerister
2d2cd21f95 Clean up CodegenUnit name generation. 2018-08-15 13:47:39 +02:00
bors
18a4c38a1d Auto merge of #53367 - ehuss:update-cargo, r=alexcrichton
Update cargo

- Update transitioning url (rust-lang/cargo#5889)
- Resolve some clippy lint warnings (rust-lang/cargo#5884)
- Don't kill child processes on normal exit on Windows (rust-lang/cargo#5887)
- fix a bunch of clippy warnings (rust-lang/cargo#5876)
- Add support for rustc's --error-format short (rust-lang/cargo#5879)
- Support JSON with rustdoc. (rust-lang/cargo#5878)
- Fix rustfmt instructions in CONTRIBUTING.md (rust-lang/cargo#5880)
- Allow `cargo run` in workspaces. (rust-lang/cargo#5877)
- Change target filters in workspaces. (rust-lang/cargo#5873)
- Improve verbose console and log for finding git repo in package check (rust-lang/cargo#5858)
- Meta rename (rust-lang/cargo#5871)
- fetch: skip target tests when cross_compile is disabled (rust-lang/cargo#5870)
- Fully capture rustc and rustdoc output when -Zcompile-progress is passed (rust-lang/cargo#5862)
- Fix test --example docs. (rust-lang/cargo#5867)
- Add a feature to build a vendored OpenSSL (rust-lang/cargo#5865)
2018-08-15 09:08:35 +00:00
Ralf Jung
2fd2f9cfaf fix error for unsized packed struct field 2018-08-15 10:53:26 +02:00
bors
81cfaad030 Auto merge of #53212 - sunjay:nll-raw-cast, r=nikomatsakis
NLL - Prevent where clauses from extending the lifetime of bindings

Fixes https://github.com/rust-lang/rust/issues/53123

r? @nikomatsakis
2018-08-15 06:54:18 +00:00
Eric Huss
9730871773 Update cargo 2018-08-14 22:24:41 -07:00
Unknown
0d0c08f9bb pretty printing for btreemap 2018-08-15 13:48:10 +09:00
Josh Stone
e0d8364dad std: Use target_pointer_width for BACKTRACE_ELF_SIZE
The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:

- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit

Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.

Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122.
2018-08-14 21:08:42 -07:00
bors
afd0a2f249 Auto merge of #52716 - tromey:rustup-lldb, r=alexcrichton
Add lldb to the build

This optionally adds lldb (and clang, which it needs) to the build.

Because rust uses LLVM 7, and because clang 7 is not yet released, a
recent git master version of clang is used.

The lldb that is used includes the Rust plugin.

lldb is only built when asked for, or when doing a nightly build on
macOS.  Only macOS is done for now due to difficulties with the Python
dependency.
2018-08-15 02:52:08 +00:00
Corey Farwell
d1193bf95e Add doc examples for std::alloc::{alloc,alloc_zeroed}. 2018-08-14 21:32:11 -04:00
varkor
bc8cead070 Account for warning in existing GAT tests 2018-08-15 02:08:20 +01:00
varkor
d305f68cb9 Warn when generic_associated_types feature gate is enabled 2018-08-15 02:02:52 +01:00
Tom Tromey
6e3a4f4ddd Add lldb to the build
This optionally adds lldb (and clang, which it needs) to the build.

Because rust uses LLVM 7, and because clang 7 is not yet released, a
recent git master version of clang is used.

The lldb that is used includes the Rust plugin.

lldb is only built when asked for, or when doing a nightly build on
macOS.  Only macOS is done for now due to difficulties with the Python
dependency.
2018-08-14 18:59:23 -06:00
Jacob
352b2e72f4
Corrected typing description in doc 2018-08-14 21:48:46 -03:00
bors
fa23350a46 Auto merge of #52928 - Mark-Simulacrum:borrowck-cleanup, r=cramertj
(old) borrowck cleanup

Primarily moves dataflow code based on CFG to borrowck; this is mostly so we don't forget to delete it once it becomes unused after we fully move to MIR borrowck.
2018-08-15 00:37:52 +00:00
Felix S. Klock II
c7041a60a5 Updated the most glaring instances of weak tests w.r.t. NLL that came from #53196.
See also the bulletpoint list on #53351.
2018-08-15 01:16:05 +02:00
bors
5bb2094d89 Auto merge of #52936 - felixrabe:patch-1, r=alexcrichton
Document #39364 – Panic in mpsc::Receiver::recv_timeout

I can still reproduce #39364 with the example code at https://github.com/rust-lang/rust/issues/39364#issuecomment-320637702.

I'm opening this PR in an attempt to document this bug as a known issue in [libstd/sync/mpsc/mod.rs](https://github.com/rust-lang/rust/blob/master/src/libstd/sync/mpsc/mod.rs).

Inputs very much welcome. ([Nightly docs for `recv_timeout`.](https://doc.rust-lang.org/nightly/std/sync/mpsc/struct.Receiver.html?search=#method.recv_timeout))
2018-08-14 22:22:18 +00:00
Matthew Jasper
0e43e6fef2 Ignore test that fails on stage1 2018-08-14 22:42:16 +01:00
Vadim Petrochenkov
097c40cf6e syntax: Enforce attribute grammar in the parser 2018-08-15 00:05:55 +03:00
Matthew Jasper
a19db49c86 Update former compile-fail tests 2018-08-14 21:26:33 +01:00
bors
67390c0c31 Auto merge of #53361 - Manishearth:clippyup, r=nrc
Update clippy

r? @kennytm @nrc
2018-08-14 19:38:45 +00:00
Matthew Jasper
3c8eb4eac4 Name the right expected and actual return lifetimes 2018-08-14 20:35:47 +01:00
Matthew Jasper
371c23fe34 Update tests 2018-08-14 20:35:47 +01:00
Matthew Jasper
372e4aee1d Tweek best_blame_constraint to slightly prefer specific explanations 2018-08-14 20:35:46 +01:00
Matthew Jasper
7710d959f4 Change "return" to "returning this value" when explaining free regions 2018-08-14 20:35:46 +01:00
Matthew Jasper
74ce76a009 Treat assigning the destination of a call as an assignment 2018-08-14 20:35:46 +01:00
Matthew Jasper
092f03a07a Make assigning to the return type interesting 2018-08-14 20:35:46 +01:00
Pramod Bisht
b70be5bc79 Adddressed #51602 2018-08-14 19:05:27 +00:00
Pazzaz
ae0f254311 Clarify dst condition 2018-08-14 20:56:22 +02:00
Pazzaz
8d3554c48d Don't drop values in other, just move the tail 2018-08-14 20:54:25 +02:00
Manish Goregaokar
f4017a8453 Update clippy 2018-08-14 11:29:00 -07:00
bors
a5733050de Auto merge of #53354 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #53112 (pretty print BTreeSet)
 - #53208 (Don't panic on std::env::vars() when env is null.)
 - #53226 (driver: set the syntax edition in phase 1)
 - #53229 (Make sure rlimit is only ever increased)
 - #53233 (targets: aarch64: Add bare-metal aarch64 target)
 - #53239 (rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.)
 - #53246 (A few cleanups)
 - #53257 (Idiomatic improvements to IP method)
 - #53274 (Remove statics field from CodegenCx)
 - #53290 (Make LLVM emit assembly comments with -Z asm-comments)
 - #53317 (Mark prior failure to avoid ICE)
2018-08-14 17:24:18 +00:00
Simon Sapin
8defd152b3 {to,from}_{ne,le,be}_bytes for unsigned integer types
Same as https://github.com/rust-lang/rust/pull/51919 did for signed integers.

Tracking issue: https://github.com/rust-lang/rust/issues/52963
2018-08-14 18:46:04 +02:00
David Wood
5532e9dec5
Improved how upvars are detected when presenting errors using prefixes. 2018-08-14 18:38:57 +02:00
kennytm
8e7f69af9c
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
Mark prior failure to avoid ICE

Fix #53251
2018-08-14 23:59:17 +08:00
kennytm
47f66e7372
Rollup merge of #53290 - whitequark:fix-35741, r=nagisa
Make LLVM emit assembly comments with -Z asm-comments

Fixes #35741, and makes `-Z asm-comments` actually do something useful.

Before:
```
	.section	.text.main,"ax",@progbits
	.globl	main
	.p2align	4, 0x90
	.type	main,@function
main:
	.cfi_startproc
	pushq	%rax
	.cfi_def_cfa_offset 16
	movslq	%edi, %rax
	leaq	_ZN1t4main17he95a7d4f1843730eE(%rip), %rdi
	movq	%rsi, (%rsp)
	movq	%rax, %rsi
	movq	(%rsp), %rdx
	callq	_ZN3std2rt10lang_start17h3121da83b2bc3697E
	movl	%eax, %ecx
	movl	%ecx, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	main, .Lfunc_end8-main
	.cfi_endproc
```

After:
```
	.section	.text.main,"ax",@progbits
	.globl	main                    # -- Begin function main
	.p2align	4, 0x90
	.type	main,@function
main:                                   # @main
	.cfi_startproc
# %bb.0:
	pushq	%rax
	.cfi_def_cfa_offset 16
	movslq	%edi, %rax
	leaq	_ZN1t4main17he95a7d4f1843730eE(%rip), %rdi
	movq	%rsi, (%rsp)            # 8-byte Spill
	movq	%rax, %rsi
	movq	(%rsp), %rdx            # 8-byte Reload
	callq	_ZN3std2rt10lang_start17h3121da83b2bc3697E
	movl	%eax, %ecx
	movl	%ecx, %eax
	popq	%rcx
	.cfi_def_cfa_offset 8
	retq
.Lfunc_end8:
	.size	main, .Lfunc_end8-main
	.cfi_endproc
                                        # -- End function
```
2018-08-14 23:59:16 +08:00
kennytm
e862efa65d
Rollup merge of #53274 - bjorn3:remove_statics_field, r=nagisa
Remove statics field from CodegenCx

It doesnt seem to be used anywhere.
2018-08-14 23:59:15 +08:00
kennytm
11484c6a6a
Rollup merge of #53257 - faern:ip-method-idiomatic-improvement, r=TimNN
Idiomatic improvements to IP method

Since match ergonomics and slice patterns are stable this might be more idiomatic modern Rust implementations of these methods? Or well, slice patterns with `..` are not stabilized yet, so maybe we want to specify all fields but with `_`?
2018-08-14 23:59:13 +08:00
kennytm
e77d9955a0
Rollup merge of #53246 - ljedrz:cleanup_various, r=kennytm
A few cleanups

- change `skip(1).next()` to `nth(1)`
- collapse some `if-else` expressions
- remove a few explicit `return`s
- remove an unnecessary field name
- dereference once instead of matching on multiple references
- prefer `iter().enumerate()` to indexing with `for`
- remove some unnecessary lifetime annotations
- use `writeln!()` instead of `write!()`+`\n`
- remove redundant parentheses
- shorten some enum variant names
- a few other cleanups suggested by `clippy`
2018-08-14 23:59:12 +08:00
kennytm
764755b0b0
Rollup merge of #53239 - cuviper:llvm5-closure-alloca, r=eddyb
rustc_codegen_llvm: Restore the closure env alloca hack for LLVM 5.

This hack was removed in #50949, but without it I found that building
`std` with full debuginfo would print many LLVM `DW_OP_LLVM_fragment`
errors, then die `LLVM ERROR: Failed to strip malformed debug info`.

It doesn't seem to be a problem for LLVM 6, so we can re-enable the hack
just for older LLVM.

This reverts commit da579ef75e.
Fixes #53204.
r? @eddyb
2018-08-14 23:59:11 +08:00
kennytm
2ae5f64daf
Rollup merge of #53233 - andre-richter:master, r=alexcrichton
targets: aarch64: Add bare-metal aarch64 target

A generic AArch64 target that can be used for writing bare-metal code
for 64-bit ARM architectures.
2018-08-14 23:59:09 +08:00
kennytm
4fb40588ae
Rollup merge of #53229 - varkor:rlimits_min, r=nikomatsakis
Make sure rlimit is only ever increased

`libc::setrlimit` will fail if we try to set the rlimit to a value lower than it is currently, so make sure we're never trying to do this. Fixes #52801.
2018-08-14 23:59:08 +08:00
kennytm
eeab08e97a
Rollup merge of #53226 - QuietMisdreavus:editions-for-all, r=estebank
driver: set the syntax edition in phase 1

Fixes https://github.com/rust-lang/rust/issues/53203

It seems the way libsyntax handles the desired edition is to use a global, set via `syntax_pos::hygiene::set_default_edition`. Right now, this is set in the driver in `run_compiler`, which is the entry point for running the compiler all the way through to emitting files. Since rustdoc doesn't use this function, it wasn't properly setting this global. (When initially setting up editions in rustdoc, i'd assumed that setting `sessopts.edition` would have done this... `>_>`) This was "fixed" for doctests in https://github.com/rust-lang/rust/pull/52385, but rather than patching in a call to `set_default_edition` in all the places rustdoc sets up the compiler, i've instead moved the call in the driver to be farther in the process. This means that any use of `phase_1_parse_input` with the right session options will have the edition properly set without having to also remember to set libsyntax up separately.

r? @rust-lang/compiler
2018-08-14 23:59:07 +08:00
kennytm
700c5e89f2
Rollup merge of #53208 - BurntPizza:protect-the-environment, r=alexcrichton
Don't panic on std::env::vars() when env is null.

Fixes #53200.

Reviewer(s):
* Do I need to do any `#[cfg()]` here?
* Is this use of libc ok for a dev-dependency?
2018-08-14 23:59:05 +08:00
kennytm
e401638d08
Rollup merge of #53112 - fukatani:pretty-print-btreeset, r=michaelwoerister
pretty print BTreeSet

I want pretty printing for BTreeSet.
```rust
use std::collections::*;

fn main() {
  let mut s = BTreeSet::new();
  s.insert(5);
  s.insert(3);
  s.insert(7);
  s.remove(&3);
  println!("{:?}", s);
}
```

```
(gdb) b 9
(gdb) p s
$1 = BTreeSet<i32> with 2 elements = {[0] = 5, [1] = 7}
```
This is analogy of pretty printing for C++ std::set.
2018-08-14 23:59:04 +08:00
David Wood
2c6b0e5cf7
Label definition of captured variables in errors. 2018-08-14 17:36:03 +02:00
David Wood
51b0552bd7
Added some debug logging. 2018-08-14 17:36:00 +02:00
bors
23f09bbed4 Auto merge of #53085 - ljedrz:cleanup_syntax_structures, r=ljedrz
Move SmallVector and ThinVec out of libsyntax

- move `libsyntax::util::SmallVector` tests to `librustc_data_structures::small_vec`
- remove `libsyntax::util::SmallVector`
- move `libsyntax::util::thin_vec` to `librustc_data_structures::thin_vec`

Other than moving these data structures where they belong it allows modules using `SmallVector<T>` (`SmallVec<[T; 1]>`) to specify their own length (e.g. 8 or 32) independently from `libsyntax`.
2018-08-14 15:09:37 +00:00
memoryruins
f4bed39c5c Add regression test for issue #30104
#30104
2018-08-14 10:26:47 -04:00
memoryruins
a7e877ebdd Add regression test for issue #48697
#48697
2018-08-14 10:25:54 -04:00
Hideki Sekine
ad78c2fc55 add copyright from template 2018-08-14 23:19:12 +09:00
Hideki Sekine
e9c2de89c1 shorten the url to fix tidy error. 2018-08-14 22:54:56 +09:00
Hideki Sekine
10395f3137 change variable definition order (basic thing first). 2018-08-14 22:40:30 +09:00
Hideki Sekine
62b3935298 use TMPDIR instead of custom directory. 2018-08-14 22:38:27 +09:00
Hideki Sekine
5c654f27b7 use a simple script instead of cargo clone. 2018-08-14 22:35:11 +09:00
bors
f45f52532a Auto merge of #53196 - davidtwco:compile-fail-to-ui, r=nikomatsakis
Move `compile-fail` tests to `ui`

Fixes #46841, #52531, #44844.

r? @nikomatsakis
2018-08-14 12:55:23 +00:00
bors
d67ba90dab Auto merge of #53335 - eddyb:issue-53333, r=petrochenkov
rustc_resolve: crates only exist in the type namespace.

Fixes #53333 by resolving `::crate_name` in `TypeNS` alone, which was overlooked in #52923 and didn't break tests, since having `use crate_name;` and a `crate_name` value in the same scope is rare.
2018-08-14 10:41:55 +00:00
David Wood
7b026568f7
Moved problematic tests on x86_64-gnu-nopt back to compile-fail. 2018-08-14 11:12:13 +02:00
David Wood
d775e6132c
Moved problematic tests on x86_64-pc-windows-gnu back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood
67ec37b608
Moved problematic tests on armhf-gnu back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood
4b2464592c
Moved problematic tests on wasm32-unknown back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood
f7f7c1eef3
Moved problematic tests on dist-x86_64-musl back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood
b8b7a3c30e
Moved problematic tests on i586-unknown-linux-gnu back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood
768998a8de
Normalize tests for i686 Windows. 2018-08-14 11:12:11 +02:00
David Wood
cd12c82210
Fixed 'no such file or directory' mismatch between Windows and Linux. 2018-08-14 11:12:11 +02:00
David Wood
0cfc17358a
Moved problematic tests on Windows back to compile-fail. 2018-08-14 11:12:11 +02:00
David Wood
a922642455
Moved tests back to compile-test if they don't work on ui. 2018-08-14 11:12:11 +02:00
David Wood
7c13eb42d4
Fix no-link-with-link-args by introducing another normalization. 2018-08-14 11:12:10 +02:00
David Wood
003b5a8b0f
Normalize crateresolve1.rs to support different candidate ordering between executions. 2018-08-14 11:12:10 +02:00
David Wood
8e7b9b8117
Suggested trait implementation ordering is now deterministic. 2018-08-14 11:12:10 +02:00
David Wood
dc5a6571a6
Fixed truncated path not being normalized. 2018-08-14 11:12:10 +02:00
David Wood
2ad663c1cd
Normalize test build directory and root build directory. 2018-08-14 11:12:10 +02:00
David Wood
ed79c31f09
Tidy no longer fails when there are no files or subdirectories in a test directory. 2018-08-14 11:12:09 +02:00
David Wood
3fc7ab2373
Merged migrated compile-fail tests and ui tests. Fixes #46841. 2018-08-14 11:12:09 +02:00
David Wood
3e0a407988
Updated new UI tests to pass with NLL compare-mode
These tests need a review to ensure that those marked as
ignore-compare-mode-nll should be ignored and that this isn't a bug in NLL.
2018-08-14 10:38:00 +02:00
David Wood
b16a30677f
Moved compile-fail tests to ui tests. 2018-08-14 10:38:00 +02:00
David Wood
fe28bcf1db
Check error-patterns on UI tests. Fixes #52531.
Previously, even if no expected errors were supplied, if a test execution failed
then supplied error patterns would not be checked. This commit modifies the
conditional that determines whether error patterns or expected errors are checked
to remedy this.

Further, this commit modifies the error pattern checking logic so that each pattern
is checked against all lines of the string. This is required for UI tests as the
stderr is in JSON format - all on one line - so in the previous implementation when the
first pattern was found on the first line (which was actually the entire error) then
no other patterns would be found on subsequent lines (as there weren't any).
2018-08-14 10:37:54 +02:00
bors
5bb923988f Auto merge of #53033 - RalfJung:manually_dro, r=SimonSapin
unsized ManuallyDrop

I think this matches what @eddyb had in https://github.com/rust-lang/rust/pull/52711 originally.

~~However, I have never added a `CoerceUnsized` before so I am not sure if I did this right. I copied the `unstable` attribute on the `impl` from elsewhere, but AFAIK it is useless because `impl`'s are insta-stable... so shouldn't this rather say "stable since 1.30"?~~

This is insta-stable and hence requires FCP, at least.

Fixes https://github.com/rust-lang/rust/issues/47034
2018-08-14 08:32:59 +00:00
Eduard-Mihai Burtescu
262392cd32 rustc_resolve: crates only exist in the type namespace. 2018-08-14 11:26:44 +03:00
bors
a8763b5370 Auto merge of #52895 - draganmladjenovic:minmax_qnan, r=alexcrichton
run-pass/simd-intrinsic-float-minmax: Force use of qNaN on Mips

Workaround for #52746.
r? @gnzlbg
2018-08-14 06:31:10 +00:00
Eduard-Mihai Burtescu
13bc0b5a48 rustc_resolve: also inject canaries to detect block scopes shadowing uniform_paths imports. 2018-08-14 07:06:50 +03:00
Eduard-Mihai Burtescu
2ad865d601 rustc_resolve: inject ambiguity "canaries" when #![feature(uniform_paths)] is enabled. 2018-08-14 07:06:50 +03:00
Taylor Cramer
39ce9ef00e #[feature(uniform_paths)]: allow use x::y; to resolve through self::x, not just ::x. 2018-08-14 07:06:50 +03:00
Eduard-Mihai Burtescu
f9b1176eef rustc_resolve: fix special-case for one-segment import paths. 2018-08-14 07:06:50 +03:00
Eduard-Mihai Burtescu
cd47831bf0 syntax: gensym the injected std/core extern crates in the Rust 2018 edition. 2018-08-14 07:06:46 +03:00
memoryruins
e390182602 [nll] add regression test for issue #27868 2018-08-13 22:45:02 -04:00
Alex Crichton
2438cfc755 Fix usage of wasm_target_feature 2018-08-13 18:03:06 -07:00
David Tolnay
69b9c23b38
Address review of RcVec 2018-08-13 17:09:13 -07:00
Esteban Küber
397db46ae3 Mark prior failure to avoid ICE
Fix #53251
2018-08-13 15:28:18 -07:00
Eduard-Mihai Burtescu
5218a5cf35 syntax: add uniform_paths feature-gate. 2018-08-14 01:18:05 +03:00
Tristan Burgess
8895e3bcb0 52985: cause cycle err on inf trait normalization
- If an existential type is defined, but no user code infers the
concrete type behind the existential type, normalization would
infinitely recurse on this existential type which is only defined in
terms of itself.
  - Instead of raising an inf recurse error, we cause a cycle error to
help highlight that the issue is that the type is only defined in terms
of itself.
  - Three known potential improvements:
    - If type folding itself was exposed as a query, used by
normalization and other mechanisms, cases that would cause infinite recursion would
automatically cause a cycle error.
    - The span for the cycle error should be improved to point to user
code that fails to allow inference of the concrete type of the existential type,
assuming that this error occurs because no user code can allow inference the
concrete type.
    - A mechanism to extend the cycle error with a helpful note would be nice. Currently,
the error is built and maintained by src/librustc/ty/query/plumbing,
with no known way to extend the information that the error gets built
with.
2018-08-13 18:09:45 -04:00
Andre Bogus
05ddad37d1 use ? to simplify TransitiveRelation.maybe_map 2018-08-13 23:12:36 +02:00
ljedrz
e5e6375352 Move SmallVec and ThinVec out of libsyntax 2018-08-13 22:11:57 +02:00
Esteban Küber
d35e2677fc review comment 2018-08-13 12:57:21 -07:00