about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2018-04-12Move contents of libstd_unicode into libcoreSimon Sapin-4/+4
2018-04-11Update compile-fail testsvarkor-4/+14
These now spit out errors for `<=` and `>=` as well.
2018-04-12Rollup merge of #49856 - varkor:no_mangle-statics-unlinted, r=michaelwoeristerkennytm-0/+3
Do not uppercase-lint #[no_mangle] statics The reasoning being that `#[no_mangle]` expresses enough intention that there's likely a good reason for the name. Fixes #36258.
2018-04-11Implementation of `#[repr(packed(n))]` RFC 1399.Cameron Hart-0/+11
2018-04-10Add ok-wrapping to catch blocks, per RFCScott McMurray-9/+11
2018-04-10Do not uppercase-lint no_mangle staticsvarkor-0/+3
2018-04-10Auto merge of #48914 - gaurikholkar:e0389, r=nikomatsakisbors-1/+1
Modify compile-fail/E0389 error message WIP This fixes #47388 cc @nikomatsakis @estebank r? @nikomatsakis Certain ui tests were failing locally. I'll check if the same happens here too.
2018-04-10Disallow `impl Trait` in unsupported positionShotaro Yamada-0/+38
2018-04-07modify the error message- CR Commentsgaurikholkar-2/+2
2018-04-06Auto merge of #49392 - retep007:nll-issue-48962, r=nikomatsakisbors-0/+38
fixes move analysis Fixed compiler error by correct checking when dereferencing Fix #48962 r? @nikomatsakis
2018-04-05Merge branch 'master' of https://github.com/rust-lang/rust into e0389gaurikholkar-287/+449
2018-04-05Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkovAlex Crichton-0/+42
Expand macros in `extern {}` blocks This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature. A tracking issue is now open at #49476 closes #48747
2018-04-05Auto merge of #49684 - kennytm:rollup, r=kennytmbors-0/+28
Rollup of 9 pull requests Successful merges: - #48658 (Add a generic CAS loop to std::sync::Atomic*) - #49253 (Take the original extra-filename passed to a crate into account when resolving it as a dependency) - #49345 (RFC 2008: Finishing Touches) - #49432 (Flush executables to disk after linkage) - #49496 (Add more vec![... ; n] optimizations) - #49563 (add a dist builder to build rust-std components for the THUMB targets) - #49654 (Host compiler documentation: Include private items) - #49667 (Add more features to rust_2018_preview) - #49674 (ci: Remove x86_64-gnu-incremental builder) Failed merges:
2018-04-05Rollup merge of #49345 - davidtwco:issue-44109, r=nikomatsakiskennytm-0/+28
RFC 2008: Finishing Touches Part of #44109. r? @nikomatsakis (not sure who was best for this PR).
2018-04-05Auto merge of #48851 - petrochenkov:genparattr, r=nikomatsakisbors-5/+3
Stabilize attributes on generic parameters Closes https://github.com/rust-lang/rust/issues/48848
2018-04-05Stabilize attributes on generic parametersVadim Petrochenkov-5/+3
2018-04-05Rollup merge of #49547 - Phlosioneer:44831-borrowck-remove-ignore, r=arielb1kennytm-1/+0
Unignore borrowck test Unignores a test that has been fixed. See #44831
2018-04-04Rollup merge of #49179 - varkor:future-deprecation, ↵kennytm-0/+8
r=QuietMisdreavus,GuillaumeGomez Handle future deprecation annotations This adds special handling to the `since` parameter of the `deprecated` attribute: in particular, if the `since` version exceeds the version of the compiler, the deprecation notice will not be printed; but a note is added to the documentation stating that the item will be deprecated in a later version. (I've used `since` for this, rather than adding a new attribute, because it's more seamless and, I feel, intuitive. Plus it involves less code churn.) ![image](https://user-images.githubusercontent.com/3943692/37611317-ef5cdf16-2b99-11e8-8251-e35e8f7b0137.png) ![image](https://user-images.githubusercontent.com/3943692/37611323-f748c2d0-2b99-11e8-966b-11408c73d416.png) This is a prerequisite for doing things renaming methods in the standard library (e.g. #30459). Resolves #30785.
2018-04-04Auto merge of #48333 - aidanhs:aphs-no-place-for-placement, r=nikomatsakisbors-62/+0
Remove all unstable placement features Closes #22181, #27779. Effectively makes the assortment of placement RFCs (rust-lang/rfcs#470, rust-lang/rfcs#809, rust-lang/rfcs#1228) 'unaccepted'. It leaves `box_syntax` and keeps the `<-` token as recognised by libsyntax. ------------------------ I don't know the correct process for unaccepting an unstable feature that was accepted as an RFC so...here's a PR. Let me preface this by saying I'm not particularly happy about doing this (I know it'll be unpopular), but I think it's the most honest expression of how things stand today. I've been motivated by a [post on reddit](https://www.reddit.com/r/rust/comments/7wrqk2/when_will_box_and_placementin_syntax_be_stable/) which asks when these features will be stable - the features have received little RFC-style design work since the end of 2015 (~2 years ago) and leaving them in limbo confuses people who want to know where they're up to. Without additional design work that needs to happen (see the collection of unresolved questions later in this post) they can't really get stabilised, and I think that design work would be most suited to an RFC rather than (currently mostly unused) experimental features in Rust nightly. I have my own motivations - it's very simple to 'defeat' placement in debug mode today and I don't want a placement in Rust that a) has no guarantees to work and b) has no plan for in-place serde deserialisation. There's a quote in [1]: "Ordinarily these uncertainties might lead to the RFC being postponed. [The RFC seems like a promising direction hence we will accept since it] will thus give us immediate experience with the design and help in determining the best final solution.". I propose that there have been enough additional uncertainties raised since then that the original direction is less promising and we should be think about the problem anew. (a historical note: the first mention of placement (under that name - uninit pointers were earlier) in an RFC AFAIK is [0] in late 2014 (pre-1.0). RFCs since then have built on this base - [1] is a comment in Feb 2015 accepting a more conservative design of the Place* traits - this is back when serde still required aster and seemed to break every other nightly! A lot has changed since then, perhaps placement should too) ------------------------ Concrete unresolved questions include: - making placement work in debug mode [7] - making placement work for serde/with fallible creation [5], [irlo2], [8] - trait design: - opting into not consuming the placer in `Placer::make_place` - [2] - trait proliferation - [4] (+ others in that thread) - fallible allocation - [3], [4] (+ others in that thread) - support for DSTs/unsized structs (if at all) - [1], [6] More speculative unresolved questions include: - better trait design with in the context of future language features [irlo1] (Q11), [irlo3] - interaction between custom allocators and placement [irlo3] [0] https://github.com/rust-lang/rfcs/pull/470 [1] https://github.com/rust-lang/rfcs/pull/809#issuecomment-73910414 [2] https://github.com/rust-lang/rfcs/issues/1286 [3] https://github.com/rust-lang/rfcs/issues/1315 [4] https://github.com/rust-lang/rust/issues/27779#issuecomment-146711893 [5] https://github.com/rust-lang/rust/issues/27779#issuecomment-285562402 [6] https://github.com/rust-lang/rust/issues/27779#issuecomment-354464938 [7] https://github.com/rust-lang/rust/issues/27779#issuecomment-358025344 [8] https://github.com/rust-lang/rfcs/pull/1228#issuecomment-190825370 [irlo1] https://internals.rust-lang.org/t/placement-nwbi-faq-new-box-in-left-arrow/2789 [irlo2] https://internals.rust-lang.org/t/placement-nwbi-faq-new-box-in-left-arrow/2789/19 [irlo3] https://internals.rust-lang.org/t/lang-team-minutes-feature-status-report-placement-in-and-box/4646
2018-04-03expand macro invocations in `extern {}` blocksAustin Bonander-0/+42
2018-04-03Auto merge of #49447 - pnkfelix:remove-cfg-const-pat-hack-47295, r=nikomatsakisbors-0/+35
Remove adjacent all-const match arm hack. An old fix for moves-in-guards had a hack for adjacent all-const match arms. The hack was explained in a comment, which you can see here: https://github.com/rust-lang/rust/pull/22580/files#diff-402a0fa4b3c6755c5650027c6d4cf1efR497 But hack was incomplete (and thus unsound), as pointed out here: https://github.com/rust-lang/rust/issues/47295#issuecomment-357108458 Plus, it is likely to be at least tricky to reimplement this hack in the new NLL borrowck. So rather than try to preserve the hack, we want to try to just remove it outright. (At least to see the results of a crater run.) [breaking-change] This is a breaking-change, but our hope is that no one is actually relying on such an extreme special case. (We hypothesize the hack was originally added to accommodate a file in our own test suite, not code in the wild.)
2018-04-03Auto merge of #49348 - bobtwinkles:extend_2pb, r=nikomatsakisbors-18/+31
Extend two-phase borrows to apply to method receiver autorefs Fixes #48598 by permitting two-phase borrows on the autorefs created when functions and methods.
2018-04-03Remove all unstable placement featuresAidan Hobson Sayers-62/+0
Closes #22181, #27779
2018-04-02Checking location and syntax of non_exhaustive attribute.David Wood-0/+28
2018-03-31Unignore borrowck testPhlosioneer-1/+0
Unignores a test that has been fixed. See #44831
2018-03-29Auto merge of #49291 - tejom:check-for-known-but-incorrect-attributes, ↵bors-0/+48
r=petrochenkov Check for known but incorrect attributes fixes #43988 - Change nested_visit_map so it will recursively check functions - Add visit_stmt and visit_expr for impl Visitor for CheckAttrVisitor and check for incorrect inline and repr attributes on staements and expressions - Add regression test for issue #43988
2018-03-29Stabilize underscore lifetimesTaylor Cramer-7/+0
2018-03-28Remove adjacent all-const match arm hack.Felix S. Klock II-0/+35
An old fix for moves-in-guards had a hack for adjacent all-const match arms. The hack was explained in a comment, which you can see here: https://github.com/rust-lang/rust/pull/22580/files#diff-402a0fa4b3c6755c5650027c6d4cf1efR497 But hack was incomplete (and thus unsound), as pointed out here: https://github.com/rust-lang/rust/issues/47295#issuecomment-357108458 Plus, it is likely to be at least tricky to reimplement this hack in the new NLL borrowck. So rather than try to preserve the hack, we want to try to just remove it outright. (At least to see the results of a crater run.) [breaking-change] This is a breaking-change, but our hope is that no one is actually relying on such an extreme special case. (We hypothesize the hack was originally added to accommodate a file in our own test suite, not code in the wild.)
2018-03-28Stabilize match_default_bindingsTaylor Cramer-5/+2
This includes a submodule update to rustfmt in order to allow a stable feature declaration.
2018-03-27Add extra test for expressions and fix typo in messagematthew-2/+8
2018-03-26Remove an unnecessary/incorrect match in the expression check functionmatthew-3/+9
2018-03-26Add tests for items deprecated in the futurevarkor-0/+8
2018-03-26fixes internal compiler error:Peter Hrvola-0/+38
librustc_mir/transform/elaborate_drops.rs — drop of untracked, uninitialized value Fix #48962 r? @nikomatsakis
2018-03-26Check for known but incorrect attributesmatthew-0/+36
- Change nested_visit_map so it will recusively check functions - Add visit_stmt and visit_expr for impl Visitor for CheckAttrVisitor and check for incorrect inline and repr attributes on staements and expressions - Add regression test for isssue #43988
2018-03-26Remove library feature testMark Mansi-17/+0
2018-03-26Auto merge of #49255 - cramertj:stable-impl-trait, r=nikomatsakisbors-20/+2
Stabilize impl Trait Blocked on: - [x] https://github.com/rust-lang/rust/pull/49041 and - [ ] completion of FCP in https://github.com/rust-lang/rust/issues/34511#issuecomment-373207183 (3 days from now). I have not yet done any docs work for this-- I probably won't get to it until this weekend (might be a project for the flight to the all-hands).
2018-03-26Stabilize conservative_impl_traitTaylor Cramer-18/+2
2018-03-26Stabilize universal_impl_traitTaylor Cramer-3/+1
2018-03-25Modify testsAlexander Ronald Altman-1/+1
2018-03-24Extend two-phase borrows to apply to method receiver autorefsbobtwinkles-18/+31
This is required to compile things like src/test/ui/borrowck/two-phase-method-receivers.rs
2018-03-25Auto merge of #49141 - gnzlbg:simd_select, r=alexcrichtonbors-0/+56
adds simd_select intrinsic The select SIMD intrinsic is used to select elements from two SIMD vectors using a mask: ```rust let mask = b8x4::new(true, false, false, true); let a = f32x4::new(1., 2., 3., 4.); let b = f32x4::new(5., 6., 7., 8.); assert_eq!(simd_select(mask, a, b), f32x4::new(1., 6., 7., 4.)); ``` The number of lanes between the mask and the vectors must match, but the vector width of the mask does not need to match that of the vectors. The mask is required to be a vector of signed integers. Note: this intrinsic will be exposed via `std::simd`'s vector masks - users are not expected to use it directly.
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-24/+0
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-25Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakiskennytm-9/+17
Stabilize termination_trait, split out termination_trait_test For #48453. First time contribution, so I'd really appreciate any feedback on how this PR can be better. Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-23Merge branch '49001_epoch' of https://github.com/klnusbaum/rust into rollupAlex Crichton-4/+4
2018-03-23Rollup merge of #49160 - estebank:issue-47457-missing-fields, r=oli-obkAlex Crichton-4/+2
Reduce the diagnostic spam when multiple fields are missing in pattern Fix #47457.
2018-03-23Rollup merge of #48909 - RalfJung:type_alias_bounds, r=petrochenkovAlex Crichton-3/+0
Improve lint for type alias bounds First of all, I learned just today that I was wrong assuming that the bounds in type aliases are entirely ignored: It turns out they are used to resolve associated types in type aliases. So: ```rust type T1<U: Bound> = U::Assoc; // compiles type T2<U> = U::Assoc; // fails type T3<U> = <U as Bound>::Assoc; // "correct" way to write this, maybe? ``` I am sorry for creating this mess. This PR changes the wording of the lint accordingly. Moreover, since just removing the bound is no longer always a possible fix, I tried to detect cases like `T1` above and show a helpful message to the user: ``` warning: bounds on generic parameters are not enforced in type aliases --> $DIR/type-alias-bounds.rs:57:12 | LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^ | = help: the bound will not be checked when the type alias is used, and should be removed help: use absolute paths (i.e., <T as Trait>::Assoc) to refer to associated types in type aliases --> $DIR/type-alias-bounds.rs:57:21 | LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^^^^ ``` I am not sure if I got this entirely right. Ideally, we could provide a suggestion involving the correct trait and type name -- however, while I have access to the HIR in the lint, I do not know how to get access to the resolved name information, like which trait `Assoc` belongs to above. The lint does not even run if that resolution fails, so I assume that information is available *somewhere*... This is a follow-up for (parts of) https://github.com/rust-lang/rust/pull/48326. Also see https://github.com/rust-lang/rust/issues/21903. This changes the name of a lint, but that lint was just merged to master yesterday and has never even been on beta.
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-24/+0
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-21termination_trait: Make error message more helpfulTyler Mandry-3/+4
2018-03-21termination_trait: Put examples in error help, not labelTyler Mandry-1/+1
2018-03-21Use NOTE instead of error-pattern directiveTyler Mandry-1/+2