about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2018-04-27Allow #[inline] on closuresAmanieu d'Antras-0/+17
Fixes #49632
2018-04-26Auto merge of #50253 - nikomatsakis:regressions-2018-04-26, r=eddybbors-0/+22
drop elaboration should reveal all This used to happen implicitly through the normalization function; but we now keep the param-env as is, which seems less surprising. cc #49685 r? @eddyb
2018-04-27Add one more prelude layer for extern crate names passed with `--extern`Vadim Petrochenkov-0/+21
2018-04-26add regression testNiko Matsakis-0/+22
Fixes #49685
2018-04-26Treat repr(Rust) univariant fieldless enums as a ZST (fixes #15747)Anthony Ramine-0/+33
This makes all those enums be represented the same way: ```rust enum A1 { B1 } enum A2 { B2 = 0 } enum A3 { B3, C3(!) } ```
2018-04-26Add a test for casts of univariant C-like enumsAnthony Ramine-2/+7
2018-04-25Make Vec::new constMark Mansi-0/+15
2018-04-25Fix crate:: in local pathsManish Goregaokar-0/+23
2018-04-25compiletest: introduce skip-transTatsuyuki Ishi-0/+17
2018-04-25Auto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearthbors-0/+15
Provide better names for builtin deriving-generated attributes First attempt at fixing #49967 Not in love with any choices here, don't be shy if you aren't happy with anything :) I've tested that this produces nicer names in documentation, and that it no longer has issues conflicting with constants with the same name. (I guess we _could_ make a test for that... unsure if that would be valuable) In all cases I took the names from the methods as declared in the relevant trait. In some cases I had to prepend the names with _ otherwise there were errors about un-used variables. I'm uneasy with the inconsistency... do they all need to be like that? Is there a way to generate an alternate impl or use a different name (`_`?) in the cases where the arguments are not used? Lastly the gensym addition to Ident I implemented largely as suggested, but I want to point out it's a little circuitous (at least, as far as I understand it). `cx.ident_of(name)` is just `Ident::from_str`, so we create an Ident then another Ident from it. `Ident::with_empty_ctxt(Symbol::gensym(string))` may or may not be equivalent, I don't know if it's important to intern it _then_ gensym it. It seems like either we could use that, or if we do want a new method to make this convenient, it could be on Ident instead (`from_str_gensymed`?)
2018-04-24Test format hygieneJames Sanderson-0/+15
2018-04-24Auto merge of #50096 - alexcrichton:less-simd-warnings, r=michaelwoeristerbors-0/+35
Tweak some warnings around #[target_feature] This commit fixes up some issues discovered when getting the `stdsimd` crate's CI compiling again.
2018-04-24Auto merge of #49911 - rcoh:master, r=nikomatsakisbors-43/+0
Don't allow #[should_panic] with non-() tests Adds (removes) support for `#[should_panic]` when the test is non-`()`
2018-04-23Don't allow #[should_panic] with non-() testsRussell Cohen-43/+0
2018-04-22Replace GlobalAlloc::oom with a lang itemSteven Fackler-9/+7
2018-04-21Auto merge of #50121 - pnkfelix:revert-stabilization-of-never-type-et-al, ↵bors-0/+12
r=alexcrichton Revert stabilization of never_type (!) et al Fix #49691 I *think* this correctly adopts @nikomatsakis 's desired fix of: * reverting stabilization of `!` and `TryFrom`, and * returning to the previous fallback semantics (i.e. it is once again dependent on whether the crate has opted into `#[feature(never_type)]`, * **without** attempting to put back in the previous future-proofing warnings regarding the change in fallback semantics. (I'll be away from computers for a week starting now, so any updates to this PR should be either pushed into it, or someone else should adopt the task of polishing this fix and put up their own PR.)
2018-04-20rustc: Tweak custom attribute capabilitiesAlex Crichton-7/+7
This commit starts to lay some groundwork for the stabilization of custom attribute invocations and general procedural macros. It applies a number of changes discussed on [internals] as well as a [recent issue][issue], namely: * The path used to specify a custom attribute must be of length one and cannot be a global path. This'll help future-proof us against any ambiguities and give us more time to settle the precise syntax. In the meantime though a bare identifier can be used and imported to invoke a custom attribute macro. A new feature gate, `proc_macro_path_invoc`, was added to gate multi-segment paths and absolute paths. * The set of items which can be annotated by a custom procedural attribute has been restricted. Statements, expressions, and modules are disallowed behind two new feature gates: `proc_macro_expr` and `proc_macro_mod`. * The input to procedural macro attributes has been restricted and adjusted. Today an invocation like `#[foo(bar)]` will receive `(bar)` as the input token stream, but after this PR it will only receive `bar` (the delimiters were removed). Invocations like `#[foo]` are still allowed and will be invoked in the same way as `#[foo()]`. This is a **breaking change** for all nightly users as the syntax coming in to procedural macros will be tweaked slightly. * Procedural macros (`foo!()` style) can only be expanded to item-like items by default. A separate feature gate, `proc_macro_non_items`, is required to expand to items like expressions, statements, etc. Closes #50038 [internals]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252 [issue]: https://github.com/rust-lang/rust/issues/50038
2018-04-20Revert stabilization of `feature(never_type)`.Felix S. Klock II-0/+12
This commit is just covering the feature gate itself and the tests that made direct use of `!` and thus need to opt back into the feature. A follow on commit brings back the other change that motivates the revert: Namely, going back to the old rules for falling back to `()`.
2018-04-19rustc: Whitelist upstream target_featuresAlex Crichton-0/+35
When compiling crates we'll be calculating and parsing `#[target_feature]` for upstream crates. We'll also be checking the stability of listed features, but we only want to check the listed stability during the actual crate that wrote the relevant code. This commit updates the `target_feature` process to ignore foreign `DefId` instances and only check the feature whitelist for local functions. Closes #50094
2018-04-18Auto merge of #50017 - tinaun:stabilize-all-the-things, r=sfacklerbors-1/+1
stabilize a bunch of minor api additions besides `ptr::NonNull::cast` (which is 4 days away from end of FCP) all of these have been finished with FCP for a few weeks now with minimal issues raised * Closes #41020 * Closes #42818 * Closes #44030 * Closes #44400 * Closes #46507 * Closes #47653 * Closes #46344 the following functions will be stabilized in 1.27: * `[T]::rsplit` * `[T]::rsplit_mut` * `[T]::swap_with_slice` * `ptr::swap_nonoverlapping` * `NonNull::cast` * `Duration::from_micros` * `Duration::from_nanos` * `Duration::subsec_millis` * `Duration::subsec_micros` * `HashMap::remove_entry`
2018-04-18Auto merge of #49981 - nox:fix-signed-niches, r=eddybbors-0/+20
Properly handle ranges of signed enums using both extremums (fixes #49973) Fixes #49973.
2018-04-17Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelixbors-4/+2
prep work for using timely dataflow with NLL Two major changes: **Two-phase borrows are overhauled.** We no longer have two bits per borrow. Instead, we track -- for each borrow -- an (optional) "activation point". Then, for each point P where the borrow is in scope, we check where P falls relative to the activation point. If P is between the reservation point and the activation point, then this is the "reservation" phase of the borrow, else the borrow is considered active. This is simpler and means that the dataflow doesn't have to care about 2-phase at all, at last not yet. **We no longer support using the MIR borrow checker without NLL.** It is going to be increasingly untenable to support lexical mode as we go forward, I think, and also of increasingly little value. This also exposed a few bugs in NLL mode due to increased testing. r? @pnkfelix cc @bobtwinkles
2018-04-17Auto merge of #49542 - GuillaumeGomez:intra-link-resolution-error, ↵bors-1/+1
r=GuillaumeGomez Add warning if a resolution failed r? @QuietMisdreavus
2018-04-17stabilize `nonnull_cast` featuretinaun-1/+1
2018-04-16Remove unwanted auto-linking and updateGuillaume Gomez-1/+1
2018-04-16Separately gate each target_feature featureAlex Crichton-0/+1
Use an explicit whitelist for what features are actually stable and can be enabled.
2018-04-16Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkovbors-23/+6
Update `?` repetition disambiguation. **Do not merge** (yet) This is a test implementation of some ideas from discussion in https://github.com/rust-lang/rust/issues/48075 . This PR - disallows `?` repetition from taking a separator, since the separator is never used. - disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach? cc @durka @alexreg @nikomatsakis
2018-04-15Properly handle ranges of signed enums using both extremums (fixes #49973)Anthony Ramine-0/+20
2018-04-15remove -Znll -- borrowck=mir implies nll nowNiko Matsakis-4/+2
2018-04-15Auto merge of #49881 - varkor:partialord-opt, r=Manishearthbors-0/+18
Fix derive(PartialOrd) and optimise final field operation ```rust // Before (`lt` on 2-field struct) self.f1 < other.f1 || (!(other.f1 < self.f1) && (self.f2 < other.f2 || (!(other.f2 < self.f2) && (false) )) ) // After self.f1 < other.f1 || (!(other.f1 < self.f1) && self.f2 < other.f2 ) // Before (`le` on 2-field struct) self.f1 < other.f1 || (!(other.f1 < self.f1) && (self.f2 < other.f2 || (!(other.f2 < self.f2) && (true) )) ) // After self.f1 < other.f1 || (self.f1 == other.f1 && self.f2 <= other.f2 ) ``` (The big diff is mainly because of a past faulty rustfmt application that I corrected 😒) Fixes #49650 and fixes #49505.
2018-04-14Replace remaining uses of deprecated Heap with GlobalMike Hommey-8/+8
2018-04-14Replace remaining uses of deprecated std::heap with std::allocMike Hommey-4/+4
2018-04-12Rename alloc::Void to alloc::OpaqueSimon Sapin-8/+8
2018-04-12Use NonNull<Void> instead of *mut u8 in the Alloc traitMike Hommey-12/+13
Fixes #49608
2018-04-12Remove the now-unit-struct AllocErr parameter of oom()Simon Sapin-5/+5
2018-04-12Use the GlobalAlloc trait for #[global_allocator]Simon Sapin-19/+19
2018-04-12Auto merge of #49371 - scottmcm:catch-wrapping, r=nikomatsakisbors-13/+12
Add ok-wrapping to catch blocks, per RFC Updates the `catch{}` lowering to wrap the result in `Try::from_ok`. r? @nikomatsakis Fixes #41414 Fixes #43818
2018-04-12Auto merge of #48528 - bitshifter:repr_packed, r=eddybbors-68/+520
Implementation of `#[repr(packed(n))]` RFC 1399. Tracking issue https://github.com/rust-lang/rust/issues/33158.
2018-04-12Auto merge of #49698 - SimonSapin:unicode-for-everyone, r=alexcrichtonbors-3/+1
Merge the std_unicode crate into the core crate [The standard library facade](https://github.com/rust-lang/rust/issues/27783) has historically contained a number of crates with different roles, but that number has decreased over time. `rand` and `libc` have moved to crates.io, and [`collections` was merged into `alloc`](https://github.com/rust-lang/rust/pull/42648). Today we have `core` that applies everywhere, `std` that expects a full operating system, and `alloc` in-between that only requires a memory allocator (which can be provided by users)… and `std_unicode`, which doesn’t really have a reason to be separate anymore. It contains functionality based on Unicode data tables that can be large, but as long as relevant functions are not called the tables should be removed from binaries by linkers. This deprecates the unstable `std_unicode` crate and moves all of its contents into `core`, replacing them with `pub use` reexports. The crate can be removed later. This also removes the `CharExt` trait (replaced with inherent methods in libcore) and `UnicodeStr` trait (merged into `StrExt`). There traits were both unstable and not intended to be used or named directly. A number of new items are newly-available in libcore and instantly stable there, but only if they were already stable in libstd. Fixes #49319.
2018-04-12Dedicated tracking issue for UnicodeVersion and UNICODE_VERSION.Simon Sapin-3/+1
2018-04-12Rollup merge of #48270 - leodasvacas:refactor-casts, r=nikomatsakiskennytm-0/+5
Replace `structurally_resolved_type` in casts check. The behaviour of `resolve_type_vars_if_possible` is simpler and infallible. Other minor refactorings. I'm not sure if this is backwards compatible, in theory resolving obligations between two cast checks could solve a dependency between them, but I don't know if that's actually possible and it doesn't sound like something we'd want to support.
2018-04-12Rollup merge of #49730 - sinkuu:fix_ice_49556, r=cramertjkennytm-0/+22
Fix ICE with impl Trait Fixes https://github.com/rust-lang/rust/issues/49556#issuecomment-379154713. May or may not fix 49556 itself. Closures like `|x: &'a _| x` has `ClosureSubsts` of `fn(&'a _) -> &'(ReScope) _`, so `tcx.note_and_explain_free_region` (called [here](https://github.com/rust-lang/rust/blob/a143462783cec88b7b733e8aa09990bfeb59f754/src/librustc/infer/anon_types/mod.rs#L572)) panics.
2018-04-11Add test for derive(PartialOrd) correctnessvarkor-0/+18
2018-04-11Implementation of `#[repr(packed(n))]` RFC 1399.Cameron Hart-68/+520
2018-04-11Rollup merge of #49795 - nox:niche-with-uninhabited-fields, r=eddybkennytm-0/+7
Properly look for uninhabitedness of variants in niche-filling check
2018-04-10Add ok-wrapping to catch blocks, per RFCScott McMurray-13/+12
2018-04-09in which the non-shorthand patterns lint keeps its own counsel in macrosZack M. Davis-0/+24
In issue #49588, Michael Lamparski pointed out a scenario in which the non-shorthand-field-patterns lint could be triggered by a macro-expanded pattern, in a way which was direly unwieldy for the macro author to guard against and unreasonable to expect the macro user to take into account. We can avoid this by not linting patterns that come from macro-expansions. Although this entails accepting "false negatives" where the lint could genuinely improve macro-templated code, avoiding the reported "true-but-super-annoying positive" may be worth the trade? (Some precedent for these relative priorities exists as no. 47775 (5985b0b0).) Resolves #49588.
2018-04-09Properly look for uninhabitedness of variants in niche-filling checkAnthony Ramine-0/+7
2018-04-08Auto merge of #49704 - leodasvacas:fix-#49344, r=nikomatsakisbors-0/+4
Fix regression in defaults #49344 Fixes #49344 by not checking the well-formedness wrt defaults of predicates that contain lifetimes, which is consistent with not checking generic predicates. r? @nikomatsakis
2018-04-07Auto merge of #49692 - sinkuu:main_fix, r=arielb1bors-0/+30
Fix ICE with `main`'s return type containing lifetimes Fixes #48890