Commit Graph

82283 Commits

Author SHA1 Message Date
Pazzaz
894c9ca1a7 Add benchmark for VecDeque append 2018-08-10 21:52:00 +02:00
bors
0aa8d03202 Auto merge of #53177 - nikomatsakis:nll-redundant-borrows-and-escaping-values, r=pnkfelix
optimize redundant borrows and escaping paths in NLL

This builds on https://github.com/rust-lang/rust/pull/53168 and adds a commit that addresses https://github.com/rust-lang/rust/issues/53176 -- or at least I think it does. I marked this as WIP because I want to see the test results (and measure the performance). I also want to double check we're not adding in any unsoundness here.
2018-08-10 19:18:22 +00:00
Linus Färnstrand
f0eed1e3ff Make use of match ergonomics in ip methods 2018-08-10 21:06:37 +02:00
Linus Färnstrand
2f1f43fcd4 Use slice patterns to check IP octets 2018-08-10 21:06:36 +02:00
Oliver Middleton
7b0bafe749 Don't accept none str literals for the format string in writeln 2018-08-10 19:01:54 +01:00
Guillaume Gomez
e37391b389 Remove unwanted console log 2018-08-10 18:48:36 +02:00
Tom Tromey
8a76656435 Link compiler test documentation to rustc-guide
Update the compiler test documentation to point to the relevant
rustc-guide page.
2018-08-10 08:05:48 -06:00
Niko Matsakis
1341e669b1 skip trivial T: Sized predicates 2018-08-10 10:00:05 -04:00
memoryruins
0123ac12e2 [nll] librustc_codegen_llvm: remove unused mut annotation 2018-08-10 06:31:40 -04:00
memoryruins
085535bbe1 [nll] librustc_codegen_llvm: change Child signature to fix error pointed out by nll
As explained by eddyb in #53221, "An &ArchiveChild doesn't point into the archive itself, it points to an owned object that itself points to the archive, and LLVMRustArchiveMemberNew copies the ArchiveChild (whereas the current signature suggests it keeps the &ArchiveChild)."
2018-08-10 06:31:10 -04:00
memoryruins
46b818e276 [nll] librustc_codegen_llvm: enable feature(nll) for bootstrap 2018-08-10 06:28:24 -04:00
memoryruins
5d6ca8e4c5 [nll] librustc_mir: enable feature(nll) for bootstrap 2018-08-10 06:27:35 -04:00
memoryruins
e8d95a5ba1 [nll] libstd: enable feature(nll) for bootstrap 2018-08-10 06:27:10 -04:00
Andre Bogus
945f0325e3 Add individual documentation for <integer>.swap_bytes/.reverse_bits 2018-08-10 12:10:07 +02:00
Michael Woerister
88d84b38f1 Introduce SmallCStr and use it where applicable. 2018-08-10 11:13:00 +02:00
Michael Woerister
9585c5dc1f Introduce const_cstr!() macro and use it where applicable. 2018-08-10 10:22:44 +02:00
Niko Matsakis
ff7f6d57de don't walk MIR if no local variables need liveness
This is true for tuple-stress and html5ever
2018-08-10 04:17:46 -04:00
bors
a77dfcc79f Auto merge of #53131 - davidtwco:issue-52663-thread-local-static, r=nikomatsakis
NLL says something "does not live long enough" when talking about a (thread-local) static

Part of #52663.

r? @nikomatsakis
2018-08-10 06:54:11 +00:00
ljedrz
b187c4268c Consider changing assert! to debug_assert! when it calls visit_with 2018-08-10 08:40:30 +02:00
Hideki Sekine
c2b612ac0c [CI] run-make/thumb: remove -j 1 from cargo run 2018-08-10 13:35:12 +09:00
bors
f6d43ed842 Auto merge of #53124 - davidtwco:issue-52742, r=nikomatsakis
region error messages involving impls are confusing

Part of #52742.

r? @nikomatsakis
2018-08-10 02:18:21 +00:00
bors
db1acaac7f Auto merge of #53073 - Mark-Simulacrum:data-structures, r=pnkfelix
Cleanup to librustc::session and related code

No functional changes, just some cleanup.

This also creates the `rustc_fs_util` crate, but I can remove that change if desired. It felt a little odd to force crates to depend on librustc for some fs utilities; and also seemed good to generally keep the size of librustc lower (for compile times); fs_util will compile in parallel with essentially the first crate since it has no dependencies beyond std.
2018-08-10 00:14:52 +00:00
Josh Stone
763e72110a 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-09 16:35:25 -07:00
bors
fb65d7563c Auto merge of #52788 - LukasKalbertodt:improve-index-mut-error, r=estebank
Add help message for missing `IndexMut` impl

Code:
```rust
let mut map = HashMap::new();
map.insert("peter", 23);
map["peter"] = 27;
```

Before:
```
error[E0594]: cannot assign to immutable indexed content
 --> src/main.rs:7:5
  |
7 |     map["peter"] = 27;
  |     ^^^^^^^^^^^^^^^^^ cannot borrow as mutable
```

With this change (just the `help` was added):
```
error[E0594]: cannot assign to immutable indexed content
 --> index-error.rs:7:5
  |
7 |     map["peter"] = 27;
  |     ^^^^^^^^^^^^^^^^^ cannot borrow as mutable
  |
  = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for std::collections::HashMap<&str, i32>
```

---

Yesterday I did some pair programming with a Rust-beginner. We created a type and implemented `Index` for it. Trying to modify the value returned by the index operation returns in a rather vague error that was not very clear for the Rust beginner. So I tried to improve the situation.

## Notes/questions for reviewers:
- Is the formulation OK like that? I'm fine with changing it.
- Can we be absolutely sure that `IndexMut` is actually not implemented in the case my `help` message is added? I'm fairly sure myself, but there could be some cases I didn't think of. Also, I don't know the compiler very well, so I don't know what exactly certain enum variants are used for.
  - It would be nice to test if `IndexMut` is in fact not implemented for the type, but I couldn't figure out how to check that. If you think that additional check would be beneficial, could you tell me how to check if a trait is implemented?
- Do you think I should change the error message instead of only adding an additional help message?
2018-08-09 22:05:18 +00:00
memoryruins
ef34a16c61 [nll] librustc_data_structures: remove unused mut annotation in test 2018-08-09 17:31:15 -04:00
Sunjay Varma
644765197a Preferring BuiltInCandidate { has_nested: false } in all cases 2018-08-09 15:05:24 -06:00
Marko Mijalkovic
c7a39b190e Export WASM table by default 2018-08-09 16:19:16 -04:00
Andre Richter
898950caf1
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-09 22:10:11 +02:00
memoryruins
4aced68e18 [nll] librustdoc: enable feature(nll) for bootstrap 2018-08-09 15:35:06 -04:00
memoryruins
ac9b7be50b [nll] librustc_typeck: enable feature(nll) for bootstrap 2018-08-09 15:34:54 -04:00
memoryruins
58407351dd [nll] librustc_platform_intrinsics: enable feature(nll) for bootstrap 2018-08-09 15:34:31 -04:00
memoryruins
d9f2b51a89 [nll] librustc_msan: enable feature(nll) for bootstrap 2018-08-09 15:34:05 -04:00
memoryruins
588dbed392 [nll] librustc_lsan: enable feature(nll) for bootstrap 2018-08-09 15:33:50 -04:00
memoryruins
8172485b4d [nll] librustc_llvm: enable feature(nll) for bootstrap 2018-08-09 15:33:24 -04:00
memoryruins
4b42a2100b [nll] librustc_codegen_utils: enable feature(nll) for bootstrap 2018-08-09 15:33:06 -04:00
memoryruins
48616432ba [nll] libproc_macro: enable feature(nll) for bootstrap 2018-08-09 15:32:45 -04:00
memoryruins
ce5b9c662f [nll] libsyntax_ext: remove unnecessary mut annotation on variable
Pointed out by nll. It is correct that the mut annotation is not needed.
2018-08-09 15:32:23 -04:00
memoryruins
2cb91dad9f [nll] libsyntax_ext: enable feature(nll) for bootstrap 2018-08-09 15:28:39 -04:00
bors
8958ed6722 Auto merge of #53216 - kennytm:rollup, r=kennytm
Rollup of 15 pull requests

Successful merges:

 - #52773 (Avoid unnecessary pattern matching against Option and Result)
 - #53082 (Fix doc link (again))
 - #53094 (Automatically expand section if url id point to one of its component)
 - #53106 (atomic ordering docs)
 - #53110 (Account for --remap-path-prefix in save-analysis)
 - #53116 (NetBSD: fix signedess of char)
 - #53179 (Whitelist wasm32 simd128 target feature)
 - #53183 (Suggest comma when missing in macro call)
 - #53207 (Add individual docs for rotate_{left, right})
 - #53211 ([nll] enable feature(nll) on various crates for bootstrap)
 - #53214 ([nll] enable feature(nll) on various crates for bootstrap: part 2)
 - #53215 (Slightly refactor syntax_ext/format)
 - #53217 (inline some short functions)
 - #53219 ([nll] enable feature(nll) on various crates for bootstrap: part 3)
 - #53222 (A few cleanups for rustc_target)
2018-08-09 19:05:14 +00:00
varkor
82a704abe7 Add a safety check for compiletest rlimit 2018-08-09 19:40:49 +01:00
varkor
6563803ed3 Don't set rlimit to a lower value than the current 2018-08-09 19:38:41 +01:00
kennytm
9f55705a24
Rollup merge of #53207 - llogiq:num-rotate-docs, r=QuietMisdreavus
Add individual docs for rotate_{left, right}
2018-08-10 01:55:31 +08:00
ljedrz
94c3856804 A few cleanups for rustc_data_structures 2018-08-09 19:50:12 +02:00
ljedrz
160187937d Change transmute()s in IdxSet::{from_slice, from_slice_mut} to casts 2018-08-09 19:50:12 +02:00
ljedrz
ffdac5d592 Make SnapshotMap::{commit, rollback_to} take references 2018-08-09 19:50:11 +02:00
kennytm
f067f3a45d
Rollup merge of #53222 - ljedrz:cleanup_rustc_target, r=Mark-Simulacrum
A few cleanups for rustc_target

- remove redundant struct field names
- shorten a self-assignment
- prefer `unwrap_or_else` in case of function calls
- collapse an `if`
- collapse a double `map()`
- match on dereferenced objects
- consume `self` if it implements `Copy`
2018-08-10 01:04:10 +08:00
kennytm
762855d23a
Rollup merge of #53215 - ljedrz:refactor_format, r=estebank
Slightly refactor syntax_ext/format

expand_preparsed_format_args:
- move a potential error `return` earlier in the processing
- pre-allocate some of the required space for `cx.pieces` and `cx.str_pieces`
- create `cx`-independent objects before `cx`
- build `pieces` and `errs` using `collect` instead of a `push` loop

describe_num_args:
- return `Cow<str>` instead of `String`
2018-08-10 01:03:45 +08:00
kennytm
e2d0e3f6ac
Rollup merge of #53219 - memoryruins:nll_bootstrap_3, r=nikomatsakis
[nll] enable feature(nll) on various crates for bootstrap: part 3

#53172
2018-08-10 01:01:33 +08:00
kennytm
62d70c9d47
Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakis
[nll] enable feature(nll) on various crates for bootstrap: part 2

#53172
2018-08-10 01:01:31 +08:00
kennytm
bb0151c6d4
Rollup merge of #53211 - memoryruins:nll_bootstrap, r=nikomatsakis
[nll] enable feature(nll) on various crates for bootstrap

#53172
2018-08-10 01:01:30 +08:00