about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2017-11-30Report a targeted note for generic parametersOliver Schneider-0/+32
2017-11-30Remove unused method from TySOliver Schneider-7/+0
2017-11-30Auto merge of #46299 - michaelwoerister:incr-comp-krimskrams, r=nikomatsakisbors-47/+147
incr.comp.: Some preparatory work for caching more query results. This PR * adds and updates some encoding/decoding routines for various query result types so they can be cached later, and * adds missing `[input]` annotations for a few `DepNode` variants. The situation around having to explicitly mark dep-nodes/queries as inputs is not really satisfactory. I hope we can find a way of making this more fool-proof in the future. r? @nikomatsakis
2017-11-30Auto merge of #46226 - arielb1:special-region-obligation, r=nikomatsakisbors-53/+148
avoid type-live-for-region obligations on dummy nodes Type-live-for-region obligations on DUMMY_NODE_ID cause an ICE, and it turns out that in the few cases they are needed, these obligations are not needed anyway because they are verified elsewhere. Fixes #46069. Beta-nominating because this is a regression for our new beta. r? @nikomatsakis
2017-11-30Auto merge of #46041 - zilbuz:issue-44837, r=arielb1bors-79/+232
MIR borrowck: finalize `check_access_permissions()` Fix #44837 (hopefully for good) r? @arielb1
2017-11-29Auto merge of #46144 - nrc:rls-update, r=alexcrichtonbors-78/+125
Update RLS and Rustfmt r? @alexcrichton
2017-11-29Rollup merge of #46356 - daboross:patch-2, r=sfacklerkennytm-1/+1
Reject '2' as a binary digit in internals of b: number formatting The `radix!` macro generates an implementation of the private trait `GenericRadix`, and the code replaced changes Binary's implementation to no longer accept '2' as a valid digit to print. Granted, this code is literally only ever called from another method in this private trait, and that method has logic to never hand a '2' to the printing function. Even given this, the code's there, I thought it would be best to fix this for clarity of anyone reading it.
2017-11-29Rollup merge of #46323 - ia0:fix_mpsc_error_conv, r=kennytmkennytm-3/+3
Fix since for mpsc_error_conversions This is a followup of #45506.
2017-11-29Rollup merge of #46322 - gnzlbg:mmx, r=alexcrichtonkennytm-1/+4
white list MMX and MSA target features r? @alexcrichton
2017-11-29Rollup merge of #46293 - ollie27:atomic_bool_from, r=BurntSushikennytm-0/+7
impl From<bool> for AtomicBool This seems like an obvious omission from #45610. ~~I've used the same feature name and version in the hope that this can be backported to beta so it's stabilized with the other impls. If it can't be I'll change it to `1.24.0`.~~
2017-11-29Rollup merge of #46287 - SimonSapin:stable-constness, r=aturonkennytm-164/+8
Stabilize const-calling existing const-fns in std Fixes #46038
2017-11-29Rollup merge of #46219 - rust-lang:frewsxcv-issue-45636, r=GuillaumeGomezkennytm-13/+106
Improve documentation for slice swap/copy/clone operations. Fixes #45636. - Demonstrate how to use these operations with slices of differing lengths - Demonstrate how to swap/copy/clone sub-slices of a slice using `split_at_mut`
2017-11-29Rollup merge of #46077 - LukasKalbertodt:stabilize-ascii-ctype, r=alexcrichtonkennytm-324/+186
Stabilize some `ascii_ctype` methods As discussed in #39658, this PR stabilizes those methods for `u8` and `char`. All inherent `ascii_ctype` for `[u8]` and `str` are removed as we prefer the more explicit version `s.chars().all(|c| c.is_ascii_())`. This PR doesn't modify the `AsciiExt` trait. There, the `ascii_ctype` methods are still unstable. It is planned to remove those in the future (I think). I had to modify some code in `ascii.rs` to properly implement `AsciiExt` for all types. Fixes #39658.
2017-11-29Rollup merge of #45969 - ia0:mpsc_recv_deadline, r=alexcrichtonkennytm-2/+63
Add std::sync::mpsc::Receiver::recv_deadline() Essentially renames recv_max_until to recv_deadline (mostly copying recv_timeout documentation). This function is useful to avoid the often unnecessary call to Instant::now in recv_timeout (e.g. when the user already has a deadline). A concrete example would be something along those lines: ```rust use std::sync::mpsc::Receiver; use std::time::{Duration, Instant}; /// Reads a batch of elements /// /// Returns as soon as `max_size` elements have been received or `timeout` expires. fn recv_batch_timeout<T>(receiver: &Receiver<T>, timeout: Duration, max_size: usize) -> Vec<T> { recv_batch_deadline(receiver, Instant::now() + timeout, max_size) } /// Reads a batch of elements /// /// Returns as soon as `max_size` elements have been received or `deadline` is reached. fn recv_batch_deadline<T>(receiver: &Receiver<T>, deadline: Instant, max_size: usize) -> Vec<T> { let mut result = Vec::new(); while let Ok(x) = receiver.recv_deadline(deadline) { result.push(x); if result.len() == max_size { break; } } result } ```
2017-11-29Update Rustfmt againNick Cameron-20/+20
2017-11-29Rebased Cargo.lockNick Cameron-54/+100
2017-11-29Update CargoNick Cameron-0/+0
Pulls in https://github.com/rust-lang/cargo/pull/4762 fixing a broken test which prevented the RLS update
2017-11-29Update RLS and RustfmtNick Cameron-18/+19
2017-11-28Reject '2' as a binary digit in internals of 'b' formattingDavid Ross-1/+1
I don't believe the previous code `0 ... 2` would run into any real problems, but it seems confusing to read, given that '2' is never a valid binary digit. As far as I can tell this code is only ever called from within another private method in the trait which has logic to never hand it '2' anyways. I thought we could change this for clarity anyways.
2017-11-28Auto merge of #46207 - kennytm:kill-grep, r=alexcrichtonbors-120/+244
Replace most call to grep in run-make by a script that cat the input. Introduced a new `src/etc/cat-and-grep.sh` script (called in run-make as `$(CGREP)`), which prints the input and do a grep simultaneously. This is mainly used to debug spurious failures in run-make, such as the spurious error in #45810, as well as real errors such as #46126. (cc #40713) Some `grep` still remains, mainly the `grep -c` calls that count the number of matches and print the result to stdout.
2017-11-28Auto merge of #46094 - dtolnay:is_null, r=alexcrichtonbors-15/+55
Remove `T: Sized` on `ptr::is_null()` Originally from #44932 -- this is purely a revert of the last commit of that PR, which was removing some changes from the previous commits in the PR. So a revert of a revert means this is code written by @cuviper! @mikeyhew makes a compelling case in https://github.com/rust-lang/rfcs/issues/433#issuecomment-345495505 for why this is the right way to implement `is_null` for trait objects. And the behavior for slices makes sense to me as well. ```diff impl<T: ?Sized> *const T { - pub fn is_null(self) -> bool where T: Sized; + pub fn is_null(self) -> bool; } impl<T: ?Sized> *mut T { - pub fn is_null(self) -> bool where T: Sized; + pub fn is_null(self) -> bool; }
2017-11-28Fix doc test of previous commitJulien Cretin-0/+2
2017-11-28Auto merge of #46291 - alexcrichton:wasm-tests, r=kennytmbors-31/+81
ci: Start running wasm32 tests on Travis This commit allocates a builder to running wasm32 tests on Travis. Not all test suites pass right now so this is starting out with just the run-pass and the libcore test suites. This'll hopefully give us a pretty broad set of coverage for integration in rustc itself as well as a somewhat broad coverage of the llvm backend itself through integration/unit tests.
2017-11-28ci: Start running wasm32 tests on TravisAlex Crichton-31/+81
This commit allocates a builder to running wasm32 tests on Travis. Not all test suites pass right now so this is starting out with just the run-pass and the libcore test suites. This'll hopefully give us a pretty broad set of coverage for integration in rustc itself as well as a somewhat broad coverage of the llvm backend itself through integration/unit tests.
2017-11-28Disable the cdylib-fewer-symbols test for all Windows (test was broken).kennytm-1/+3
2017-11-28Replace most call to grep in run-make by a script that cat the input.kennytm-119/+241
Introduced a new src/etc/cat-and-grep.sh script (called in run-make as $(CGREP)), which prints the input and do a grep simultaneously. This is mainly used to debug spurious failures in run-make, such as the sanitizer error in #45810, as well as real errors such as #46126.
2017-11-28mir-borrowck: Update testsBasile Desloges-16/+39
2017-11-28Auto merge of #46329 - arielb1:incoherent, r=eddybbors-81/+48
Revert "fix treatment of local types in "remote coherence" mode" That commit had accidentally snuck in into #44884 and it causes regressions. Revert it. This reverts commit c48650ec25d2e7e872912137e68496248743f1fe. @bors p=10 - fixes breakage in nightly r? @eddyb
2017-11-28Fix since for mpsc_error_conversionsJulien Cretin-3/+3
2017-11-28mir-borrowck: Add permission check for `WriteKind::Mutate`Basile Desloges-30/+131
2017-11-28Revert "fix treatment of local types in "remote coherence" mode"Ariel Ben-Yehuda-81/+48
That commit had accidentally snuck in into #44884. Revert it. This reverts commit c48650ec25d2e7e872912137e68496248743f1fe.
2017-11-28mir-borrowck: `describe_lvalue()` can fail if a local doesn't have a nameBasile Desloges-33/+62
2017-11-28incr.comp.: Add some missing DepNode [input] annotations.Michael Woerister-9/+5
2017-11-28incr.comp.: Make a bunch of query results encodable.Michael Woerister-11/+61
2017-11-28incr.comp.: Make MIR encoding fit for incr.comp. caching.Michael Woerister-27/+81
2017-11-28Auto merge of #46175 - GuillaumeGomez:fix-global-search, r=QuietMisdreavusbors-227/+227
Fix global search Fixes #46021. r? @QuietMisdreavus
2017-11-28white list MMX and MSA target featuresgnzlbg-1/+4
2017-11-28Auto merge of #46123 - Gankro:c-repr, r=eddybbors-24/+454
Implement the special repr(C)-non-clike-enum layout This is the second half of https://github.com/rust-lang/rfcs/pull/2195 which specifies that ```rust #[repr(C, u8)] #[derive(Copy, Clone, Eq, PartialEq, Debug)] enum MyEnum { A(u32), // Single primitive value B { x: u8, y: i16 }, // Composite, and the offset of `y` depends on tag being internal C, // Empty D(Option<u32>), // Contains an enum E(Duration), // Contains a struct } ``` Has the same layout as ```rust #[repr(C)] struct MyEnumRepr { tag: MyEnumTag, payload: MyEnumPayload, } #[repr(C)] #[allow(non_snake_case)] union MyEnumPayload { A: MyEnumVariantA, B: MyEnumVariantB, D: MyEnumVariantD, E: MyEnumVariantE, } #[repr(u8)] #[derive(Copy, Clone)] enum MyEnumTag { A, B, C, D, E } #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantA(u32); #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantB {x: u8, y: i16 } #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantD(Option<u32>); #[repr(C)] #[derive(Copy, Clone)] struct MyEnumVariantE(Duration); ```
2017-11-28Change `since` attribute from ctype methods from 1.23 to 1.24Lukas Kalbertodt-20/+20
The changes didn't land in time for 1.23 and stabilizations won't be backported to beta.
2017-11-28Fix and improve test for enum repr sizesAlexis Beingessner-3/+49
2017-11-28Auto merge of #46142 - eddyb:even-mirer-2, r=nikomatsakisbors-445/+438
MIR: split Operand::Consume into Copy and Move. By encoding the choice of leaving the source untouched (`Copy`) and invalidating it (`Move`) in MIR, we can express moves of copyable values and have MIR borrow-checking enforce them, *including* ownership transfer of stack locals in calls (when the ABI passes by indirection). Optimizations could turn a "last-use" `Copy` into a `Move`, and the MIR borrow-checker, at least within the confines of safe code, could even do this when the underlying lvalue was borrowed. (However, that last part would be the first time lifetime inference affects code generation, AFAIK). Furthermore, as `Move`s invalidate borrows as well, for any local that is initialized only once, we can ignore borrows that happened before a `Move` and safely reuse/replace its memory storage. This will allow us to perform NRVO in the presence of short-lived borrows, unlike LLVM (currently), and even compute optimal `StorageLive...StorageDead` ranges instead of discarding them.
2017-11-28tests: update to include move annotations in MIR.Eduard-Mihai Burtescu-128/+128
2017-11-28rustc_mir: require that Copy(L) satisfies typeof L: Copy.Eduard-Mihai Burtescu-6/+23
2017-11-28MIR: split Operand::Consume into Copy and Move.Eduard-Mihai Burtescu-238/+251
2017-11-28rustc_mir: enforce that arguments are replaced with Local's only.Eduard-Mihai Burtescu-41/+14
2017-11-28rustc_mir: move storage_dead_or_drop_error_reported logic to access_lvalue.Eduard-Mihai Burtescu-46/+36
2017-11-28Auto merge of #46102 - kennytm:45861-step-1, r=alexcrichtonbors-5/+14
[auto-toolstate][1/8] Always ignore build failure of failable tools (rls, rustfmt, clippy) If build failed for these tools, they will be automatically skipped from distribution, and will not fail the whole build. Test failures are *not* ignored, nor build failure of other tools (e.g. cargo). Therefore it should have no observable effect to the current CI system. This is step 1/8 of automatic management of broken tools #45861. The purpose is concentrate all failure detection about tools into a single CI job for easy management, while keeping the ability to distribute these tools in the nightlies. r? @Mark-Simulacrum
2017-11-27Auto merge of #46312 - kennytm:rollup, r=kennytmbors-61/+628
Rollup of 10 pull requests - Successful merges: #45506, #46174, #46231, #46240, #46249, #46258, #46262, #46275, #46282, #46285 - Failed merges:
2017-11-27Use an unstable feature linked to #46316Julien Cretin-1/+1
2017-11-27Change version number for `impl From<bool> for AtomicBool` to 1.24.0Oliver Middleton-1/+1