summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2016-09-23Revert "implement `From<Vec<char>>` and `From<&'a [char]>` for `String`"Brian Anderson-20/+0
This reverts commit ac73335f2f5421c914fa3900567696cc6dc73d8d.
2016-09-21Fix optimization regressions for operations on [x; n]-initialized arrays.Eduard Burtescu-2/+2
2016-09-21Workaround #34427 by using memset of 0 on ARM to set the discriminant.Felix S. Klock II-5/+47
Conflicts: src/librustc_trans/adt.rs
2016-09-21fix PR 36459 post backport to beta.Felix S. Klock II-2/+3
2016-09-21add missing testNiko Matsakis-0/+28
2016-09-21invoke drop glue with a ptr to (data, meta)Niko Matsakis-3/+21
This is done by creating a little space on the stack. Hokey, but it's the simplest fix I can see.
2016-09-21use `adt::trans_const` when translating constant closures and tuplesAriel Ben-Yehuda-28/+83
Fixes #36401
2016-09-21Update rust-installer. Fixes #35840Brian Anderson-0/+0
2016-09-20Fix build errorBrian Anderson-1/+0
2016-09-19Remove data structure specialization for .zip() iteratorUlrik Sverdrup-38/+31
Go back on half the specialization, the part that changed the Zip struct's fields themselves depending on the types of the iterators. This means that the Zip iterator will always carry two usize fields, which are unused. If a whole for loop using a .zip() iterator is inlined, these are simply removed and have no effect. The same improvement for Zip of for example slice iterators remain, and they still optimize well. However, like when the specialization of zip was merged, the compiler is still very sensistive to the exact context. For example this code only autovectorizes if the function is used, not if the code in zip_sum_i32 is inserted inline it was called: ``` fn zip_sum_i32(xs: &[i32], ys: &[i32]) -> i32 { let mut s = 0; for (&x, &y) in xs.iter().zip(ys) { s += x * y; } s } fn zipdot_i32_default_zip(b: &mut test::Bencher) { let xs = vec![1; 1024]; let ys = vec![1; 1024]; b.iter(|| { zip_sum_i32(&xs, &ys) }) } ``` Include a test that checks that Zip<T, U> is covariant w.r.t. T and U.
2016-09-19Default RUST_MIN_STACK to 16MiB for nowSimonas Kazlauskas-1/+2
2016-09-19Up the LLVMSimonas Kazlauskas-1/+41
Fixes #36474
2016-09-16Make `private_in_public` compatibility lint warn-by-default againVadim Petrochenkov-3/+11
2016-09-16Fix issue #36036.Felix S. Klock II-1/+37
We were treating an associated type as unsized even when the concrete instantiation was actually sized. Fix is to normalize before checking if it is sized.
2016-09-12llvm: backport "[SimplifyCFG] Hoisting invalidates metadata".Eduard Burtescu-1/+33
2016-09-12memrchr: Use a conditional instead of subtracting a complicated minUlrik Sverdrup-1/+1
This makes the critical calculation easier to understand.
2016-09-12memrchr: Correct aligned offset computationUlrik Sverdrup-1/+23
The memrchr fallback did not compute the offset correctly. It was intentioned to land on usize-aligned addresses but did not. This was suspected to resulted in a crash on ARMv7 platform! This bug affected non-linux platforms. I think like this, if we have a slice with pointer `ptr` and length `len`, we want to find the last usize-aligned offset in the slice. The correct computation should be: For example if ptr = 1 and len = 6, and size_of::<usize>() is 4: [ x x x x x x ] 1 2 3 4 5 6 ^-- last aligned address at offset 3 from the start. The last aligned address is ptr + len - (ptr + len) % usize_size. Compute offset from the start as: offset = len - (ptr + len) % usize_size = 6 - (1 + 6) % 4 = 6 - 3 = 3. I believe the function's return value was always correct previously, if the platform supported unaligned addresses.
2016-09-12rustc_trans: do not generate allocas for unused locals.Eduard Burtescu-0/+24
2016-09-12typeck: use NoExpectation to check return type of diverging fnAlex Burka-2/+49
This fixes #35849, a regression introduced by the typeck refactoring around TyNever/!.
2016-08-22Nice graphsSimonas Kazlauskas-12/+48
2016-08-22Properly invalidate the early exit cacheSimonas Kazlauskas-20/+60
Fixes #35737
2016-08-22Make `vec::IntoIter` covariant againAndrew Paseltiner-7/+11
Closes #35721
2016-08-22std: Stabilize APIs for the 1.12 releaseAlex Crichton-66/+94
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-08-16Bump boostrap compilersBrian Anderson-2/+2
2016-08-16Auto merge of #35617 - jseyfried:fix_unused_cfg_attr_path, r=eddybbors-2/+19
Fix incorrect unused import warnings on `cfg_attr`ed `path` attributes Fixes #35584. r? @eddyb
2016-08-16Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakisbors-705/+899
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-15Auto merge of #35680 - GuillaumeGomez:err_codes, r=jonathandturnerbors-4/+264
Err codes r? @jonathandturner
2016-08-15Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakisbors-248/+1186
Take commandline arguments into account for incr. comp. Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727. From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples. The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct. One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data. It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map. Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.
2016-08-15Add new error code testsGuillaume Gomez-0/+242
2016-08-15Add E0394 error explanationGuillaume Gomez-4/+22
2016-08-15Auto merge of #35567 - creativcoder:e0261, r=jonathandturnerbors-5/+13
Update E0261 and E0262 to new error format Fixes #35516 and #35517 . Part of #35233 r? @jonathandturner
2016-08-15Fix bug for ! in old transAndrew Cann-1/+1
2016-08-14Auto merge of #35638 - ahmedcharles:url, r=alexcrichtonbors-45/+20
Upgrade linkchecker to url 1.2.0.
2016-08-14Auto merge of #35666 - eddyb:rollup, r=eddybbors-212/+527
Rollup of 30 pull requests - Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661 - Failed merges: #35395, #35415
2016-08-14Auto merge of #35409 - eddyb:mir-storage-stmts, r=nikomatsakisbors-85/+387
[MIR] Add Storage{Live,Dead} statements to emit llvm.lifetime.{start,end}. Storage live ranges are tracked for all MIR variables and temporaries with a drop scope. `StorageLive` is lowered to `llvm.lifetime.start` and `StorageDead` to `llvm.lifetime.end`. There are some improvements possible here, such as: * pack multiple storage liveness statements by using the index of first local + `u64` bitset * enforce that locals are not directly accessed outside their storage live range * shrink storage live ranges for never-borrowed locals to initialization -> last use * emit storage liveness statements for *all* temporaries * however, the remaining ones are *always* SSA immediates, so they'd be noop in MIR trans * could have a flag on the temporary that its storage is irrelevant (a la C's old `register`) * would also deny borrows if necessary * this seems like an overcompliation and with packing & optimizations it may be pointless Even in the current state, it helps stage2 `rustc` compile `boiler` without overflowing (see #35408). A later addition fixes #26764 and closes #27372 by emitting `.section` directives for dylib metadata to avoid them being allocated into memory or read as `.note`. For this PR, those bugs were tripping valgrind.
2016-08-14Rollup merge of #35661 - IvanUkhov:raw-vec, r=alexcrichtonEduard-Mihai Burtescu-3/+3
Fix a couple of typos in RawVec Hi, The pull request is to fix a couple of typos in `liballoc/raw_vec.rs`. Regards, Ivan
2016-08-14Rollup merge of #35648 - ahmedcharles:pred, r=alexcrichtonEduard-Mihai Burtescu-18/+0
Predicates haven't existed in almost 5 years. This test probably adds negative value other than historical amusement.
2016-08-14Rollup merge of #35647 - ahmedcharles:spelling, r=alexcrichtonEduard-Mihai Burtescu-24/+24
Ensure that attributes are spelled properly.
2016-08-14Rollup merge of #35646 - theypsilon:master, r=jonathandturnerEduard-Mihai Burtescu-2/+5
E0094 error message updated Part of #35233 Fixes #35231 r? @jonathandturner
2016-08-14Rollup merge of #35644 - garekkream:update-E0302-new-error-format, ↵Eduard-Mihai Burtescu-1/+4
r=jonathandturner Update E0302 to the new format Part of #35233. Fixes #35523. r? @jonathandturner
2016-08-14Rollup merge of #35643 - garekkream:update-E0301-new-error-format, ↵Eduard-Mihai Burtescu-1/+4
r=jonathandturner Update E0301 to the new format Part of #35233. Fixes #35522. r? @jonathandturner
2016-08-14Rollup merge of #35640 - ahmedcharles:dead, r=alexcrichtonEduard-Mihai Burtescu-4/+0
compiletest: Remove dead code.
2016-08-14Rollup merge of #35622 - matthew-piziak:convert-docs-typos, r=apasel422Eduard-Mihai Burtescu-4/+4
fix small typos in std::convert documentation Fix subject-verb agreement in copypasta: "`AsRef` dereference" to "`AsRef` dereferences". Formalize "eg" to "e.g." Italicization of common Latin abbreviations seems to be going out of style in written English, so I left it plain.
2016-08-14Rollup merge of #35620 - cvubrugier:master, r=ManishearthEduard-Mihai Burtescu-3/+3
book: fix the hidden find() functions in error-handling.md The hidden find() functions always returns None. Consequently, one of the examples using find() prints "No file extension found" instead of "File extension: rs" which is the expected output. This patch fixes the issue by implementing find() with std::str::find(). Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
2016-08-14Rollup merge of #35616 - clementmiao:E0067_new_error_format, r=jonathandturnerEduard-Mihai Burtescu-1/+9
changed E0067 to new error format Updated E0067 to new error format. Part of #35233 Fixes #35502 Passes all the tests when running: `python src/bootstrap/bootstrap.py --step check-cfail --stage 1` **This seems strange, given that the format for E0067 has been changed.** It feels like it should fail some unit tests maybe? Let me know if I'm mistaken. Otherwise I can create a unit test for it. Thanks for letting me help! r? @jonathandturner
2016-08-14Rollup merge of #35615 - clementmiao:E0070_new_error_format, r=jonathandturnerEduard-Mihai Burtescu-2/+8
Update E0070 to new error format Updated E0070 to new error format. Part of #35233 Fixes #35503 Thanks for letting me help! r? @jonathandturner
2016-08-14Rollup merge of #35611 - jonathandturner:ptr-helper, r=nikomatsakisEduard-Mihai Burtescu-22/+39
Improve &-ptr printing This PR replaces printing `&-ptr` with a more readable description. To do so it uses a few heuristics. If the name of the type is unknown, too long (longer than just saying "reference"), or too complex (a type with explicit lifetime annotations), it will instead opt to print either "reference" or "mutable reference", depending on the mutability of the type. Before: ``` error[E0308]: mismatched types --> src/test/compile-fail/issue-7061.rs:14:46 | 14 | fn foo(&'a mut self) -> Box<BarStruct> { self } | ^^^^ expected box, found &-ptr | = note: expected type `Box<BarStruct>` = note: found type `&'a mut BarStruct` error: aborting due to previous error ``` After: ``` error[E0308]: mismatched types --> src/test/compile-fail/issue-7061.rs:14:46 | 14 | fn foo(&'a mut self) -> Box<BarStruct> { self } | ^^^^ expected box, found mutable reference | = note: expected type `Box<BarStruct>` = note: found type `&'a mut BarStruct` error: aborting due to previous error ```
2016-08-14Rollup merge of #35606 - Mark-Simulacrum:no-std-fix, r=brsonEduard-Mihai Burtescu-1/+1
Change stabilization version of no_std from 1.0 to 1.6. I don't know if more than this is needed. Fixes #35579.
2016-08-14Rollup merge of #35598 - tshepang:needless-binding, r=steveklabnikEduard-Mihai Burtescu-2/+1
string: remove needless binding
2016-08-14Rollup merge of #35597 - tshepang:it-is-a-slice, r=steveklabnikEduard-Mihai Burtescu-1/+1
doc: a value of type `&str` is called a "string slice"