about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-04-10Auto merge of #48914 - gaurikholkar:e0389, r=nikomatsakisbors-1/+32
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-10Auto merge of #49504 - GuillaumeGomez:doc-all-types, r=QuietMisdreavusbors-0/+30
Add page to list all crate's items r? @QuietMisdreavus
2018-04-10Auto merge of #49258 - zackmdavis:not_going_to_recover, r=petrochenkovbors-0/+94
suggest `!` for erroneous identifier `not` ![not_recovery](https://user-images.githubusercontent.com/1076988/37753255-3b669c42-2d59-11e8-9071-efad8eaf3086.png) This supersedes #48858. r? @petrochenkov
2018-04-10Auto merge of #49435 - tmandry:rule-implied-bound-from-trait, r=nikomatsakisbors-1/+147
chalkify: Implement lowering rule Implied-Bound-From-Trait For #49177. TODO: - [x] Implement where clauses besides trait and projection predicates - [x] Is the output of the `lower_trait_higher_rank` test correct? - [ ] Remove `Self::Trait` from the query `tcx.predicates_of(<trait_id>).predicates` - [ ] Consider moving tests to compile-fail to make them more manageable
2018-04-09in which `!` is suggested for erroneous identifier `not`Zack M. Davis-0/+94
Impressing confused Python users with magical diagnostics is perhaps worth this not-grossly-unreasonable (only 40ish lines) extra complexity in the parser? Thanks to Vadim Petrochenkov for guidance. This resolves #46836.
2018-04-08Auto merge of #49752 - sinkuu:fix_incrcmp_str_lit, r=oli-obkbors-0/+64
[incremental] Hash `Allocation`s `HashSet::insert` returns `true` if the value did not exist, which is the timing we want to hash the `Allocation`. Fixes #49595 cc @oli-obk
2018-04-08Auto merge of #49714 - nikomatsakis:issue-49631, r=eddybbors-0/+82
mem-categorization, coherence fix make mem-categorization use adjusted type for patterns: Fixes #49631 do not propagate `Err` when determing causal info: Fixes #48728 r? @eddyb
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 #49678 - bobtwinkles:fix_multiple_activations, r=nikomatsakisbors-0/+84
two-phase borrows: support multiple activations in one statement The need for this has arisen since the introduction of two-phase borrows on method autorefs in #49348. r'ing @pnkfelix to keep things off Niko's plate so he can make this redundant, and @pnkfelix is familiar with the code. Fixes #49635 Fixes #49662 r? @pnkfelix
2018-04-07Auto merge of #49672 - alexcrichton:fix-another-std-core-cycle, ↵bors-0/+1
r=michaelwoerister Fix another circular deps link args issue It turns out that the support in #49316 wasn't enough to handle all cases notably the example in #48661. The underlying bug was connected to panic=abort where lang items were listed in the `missing_lang_items` sets but didn't actually exist anywhere. This caused the linker backend to deduce that start-group/end-group wasn't needed because not all items were defined. Instead the missing lang items that don't actually need to have a definition are filtered out and not considered for the start-group/end-group arguments Closes #48661
2018-04-07Auto merge of #49692 - sinkuu:main_fix, r=arielb1bors-0/+67
Fix ICE with `main`'s return type containing lifetimes Fixes #48890
2018-04-07modify the error message- CR Commentsgaurikholkar-4/+4
2018-04-07[incremental] Hash `Allocation`sShotaro Yamada-0/+64
2018-04-06Auto merge of #49392 - retep007:nll-issue-48962, r=nikomatsakisbors-0/+81
fixes move analysis Fixed compiler error by correct checking when dereferencing Fix #48962 r? @nikomatsakis
2018-04-06Add test from #49736bobtwinkles-0/+49
Fixes #49736
2018-04-06chalkify: Implement Rule Implied-Bound-From-TraitTyler Mandry-1/+147
2018-04-06fix ui testgaurikholkar-2/+2
2018-04-06Auto merge of #48779 - michaelwoerister:share-generics4, r=alexcrichtonbors-9/+125
Allow for re-using monomorphizations in upstream crates. Followup to #48611. This implementation is pretty much finished modulo failing tests if there are any. Not quite ready for review yet though. ### DESCRIPTION This PR introduces a `share-generics` mode for RLIBs and Rust dylibs. When a crate is compiled in this mode, two things will happen: - before instantiating a monomorphization in the current crate, the compiler will look for that monomorphization in all upstream crates and link to it, if possible. - monomorphizations are not internalized during partitioning. Instead they are added to the list of symbols exported from the crate. This results in less code being translated and LLVMed. However, there are also downsides: - it will impede optimization somewhat, since fewer functions can be internalized, and - Rust dylibs will have bigger symbol tables since they'll also export monomorphizations. Consequently, this PR only enables the `shared-generics` mode for opt-levels `No`, `Less`, `Size`, and `MinSize`, and for when incremental compilation is activated. `-O2` and `-O3` will still generate generic functions per-crate. Another thing to note is that this has a somewhat similar effect as MIR-only RLIBs, in that monomorphizations are shared, but it is less effective because it cannot share monomorphizations between sibling crates: ``` A <--- defines `fn foo<T>() { .. }` / \ / \ B C <--- both call `foo<u32>()` \ / \ / D <--- calls `foo<u32>()` too ``` With `share-generics`, both `B` and `C` have to instantiate `foo<u32>` and only `D` can re-use it (from either `B` or `C`). With MIR-only RLIBs, `B` and `C` would not instantiate anything, and in `D` we would then only instantiate `foo<u32>` once. On the other hand, when there are many leaf crates in the graph (e.g. when compiling many individual test binaries) then the `share-generics` approach will often be more effective. ### TODO - [x] Add codegen test that makes sure monomorphizations can be internalized in non-Rust binaries. - [x] Add codegen-units test that makes sure we share generics. - [x] Add run-make test that makes sure we don't export any monomorphizations from non-Rust binaries. - [x] Review for reproducible-builds implications.
2018-04-06fix ui testgaurikholkar-1/+1
2018-04-06Auto merge of #49335 - ↵bors-0/+15
GuillaumeGomez:remove-unneeded-trait-implementations-title, r=QuietMisdreavus Remove unneeded trait implementations titles r? @QuietMisdreavus
2018-04-06Update run-make/symbol-visibility to also cover shared-genericsMichael Woerister-7/+50
2018-04-06Add codegen-units test for shared-generics.Michael Woerister-0/+51
2018-04-06Make sure that generics are internalized in executables even with ↵Michael Woerister-0/+22
-Zshare-generics
2018-04-06Adapt codegen-unit test to shared-generics.Michael Woerister-2/+2
2018-04-06Use `Ident` instead of `Name` in `MetaItem`Vadim Petrochenkov-2/+2
2018-04-06Remove more duplicated spansVadim Petrochenkov-25/+19
2018-04-06Rename `ast::Variant_::name` into `ident` + Fix rebaseVadim Petrochenkov-4/+2
2018-04-06Rename `PathSegment::identifier` to `ident`Vadim Petrochenkov-24/+5
2018-04-05do not propagate `Err` when determing causal infoNiko Matsakis-0/+35
In intercrate mode, if we determine that a particular `T: Trait` is unknowable, we sometimes also go and get extra causal information. An errant `?` was causing us to propagate an error found in that process out as if `T: Trait` was not unknowable but rather not provable. This led to an ICE.
2018-04-05add `failure-status: 1` to the testNiko Matsakis-0/+1
2018-04-05make mem-categorization use adjusted type for patternsNiko Matsakis-0/+47
Fixes #49631
2018-04-05Fix #49344leonardo.yvens-0/+4
2018-04-05Rollup merge of #49597 - alexcrichton:proc-macro-v2, r=petrochenkovAlex Crichton-74/+81
proc_macro: Reorganize public API This commit is a reorganization of the `proc_macro` crate's public user-facing API. This is the result of a number of discussions at the recent Rust All-Hands where we're hoping to get the `proc_macro` crate into ship shape for stabilization of a subset of its functionality in the Rust 2018 release. The reorganization here is motivated by experiences from the `proc-macro2`, `quote`, and `syn` crates on crates.io (and other crates which depend on them). The main focus is future flexibility along with making a few more operations consistent and/or fixing bugs. A summary of the changes made from today's `proc_macro` API is: * The `TokenNode` enum has been removed and the public fields of `TokenTree` have also been removed. Instead the `TokenTree` type is now a public enum (what `TokenNode` was) and each variant is an opaque struct which internally contains `Span` information. This makes the various tokens a bit more consistent, require fewer wrappers, and otherwise provides good future-compatibility as opaque structs are easy to modify later on. * `Literal` integer constructors have been expanded to be unambiguous as to what they're doing and also allow for more future flexibility. Previously constructors like `Literal::float` and `Literal::integer` were used to create unsuffixed literals and the concrete methods like `Literal::i32` would create a suffixed token. This wasn't immediately clear to all users (the suffixed/unsuffixed aspect) and having *one* constructor for unsuffixed literals required us to pick a largest type which may not always be true. To fix these issues all constructors are now of the form `Literal::i32_unsuffixed` or `Literal::i32_suffixed` (for all integral types). This should allow future compatibility as well as being immediately clear what's suffixed and what isn't. * Each variant of `TokenTree` internally contains a `Span` which can also be configured via `set_span`. For example `Literal` and `Term` now both internally contain a `Span` rather than having it stored in an auxiliary location. * Constructors of all tokens are called `new` now (aka `Term::intern` is gone) and most do not take spans. Manufactured tokens typically don't have a fresh span to go with them and the span is purely used for error-reporting **except** the span for `Term`, which currently affects hygiene. The default spans for all these constructed tokens is `Span::call_site()` for now. The `Term` type's constructor explicitly requires passing in a `Span` to provide future-proofing against possible hygiene changes. It's intended that a first pass of stabilization will likely only stabilize `Span::call_site()` which is an explicit opt-in for "I would like no hygiene here please". The intention here is to make this explicit in procedural macros to be forwards-compatible with a hygiene-specifying solution. * Some of the conversions for `TokenStream` have been simplified a little. * The `TokenTreeIter` iterator was renamed to `token_stream::IntoIter`. Overall the hope is that this is the "final pass" at the API of `TokenStream` and most of `TokenTree` before stabilization. Explicitly left out here is any changes to `Span`'s API which will likely need to be re-evaluated before stabilization. All changes in this PR have already been reflected to the [`proc-macro2`], `quote`, and `syn` crates. New versions of all these crates have also been published to crates.io. Once this lands in nightly I plan on making an internals post again summarizing the changes made here and also calling on all macro authors to give the APIs a spin and see how they work. Hopefully pending no major issues we can then have an FCP to stabilize later this cycle! [`proc-macro2`]: https://docs.rs/proc-macro2/0.3.1/proc_macro2/ Closes #49596
2018-04-05Merge branch 'master' of https://github.com/rust-lang/rust into e0389gaurikholkar-3872/+6773
2018-04-05Rollup merge of #49350 - abonander:macros-in-extern, r=petrochenkovAlex Crichton-6/+302
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-06Fix ICE with `main`'s return type containing lifetimesShotaro Yamada-0/+66
2018-04-05Auto merge of #49684 - kennytm:rollup, r=kennytmbors-0/+78
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-05Rollup merge of #49253 - chmanchester:probing_fix, r=alexcrichtonkennytm-0/+50
Take the original extra-filename passed to a crate into account when resolving it as a dependency resolving it as a dependency. Fixes #46816
2018-04-05Auto merge of #48851 - petrochenkov:genparattr, r=nikomatsakisbors-222/+40
Stabilize attributes on generic parameters Closes https://github.com/rust-lang/rust/issues/48848
2018-04-05Auto merge of #48709 - tinaun:issue48703, r=nikomatsakisbors-0/+28
remove erroneous error message when checking impl trait params fixes #48703
2018-04-04two-phase borrows: support multiple activations in one statementbobtwinkles-0/+35
The need for this has arisen since the introduction of two-phase borrows on method autorefs. Fixes 49635 Fixes 49662
2018-04-04Fix another circulare deps link args issueAlex Crichton-0/+1
It turns out that the support in #49316 wasn't enough to handle all cases notably the example in #48661. The underlying bug was connected to panic=abort where lang items were listed in the `missing_lang_items` sets but didn't actually exist anywhere. This caused the linker backend to deduce that start-group/end-group wasn't needed because not all items were defined. Instead the missing lang items that don't actually need to have a definition are filtered out and not considered for the start-group/end-group arguments Closes #48661
2018-04-05Stabilize attributes on generic parametersVadim Petrochenkov-222/+40
2018-04-04Auto merge of #49642 - kennytm:rollup, r=kennytmbors-2/+216
Rollup of 25 pull requests Successful merges: - #49179 (Handle future deprecation annotations ) - #49512 (Add support for variant and types fields for intra links) - #49515 (fix targetted value background) - #49516 (Add missing anchor for union type fields) - #49532 (Add test for rustdoc ignore test) - #49533 (Add #[must_use] to a few standard library methods) - #49540 (Fix miri Discriminant() for non-ADT) - #49559 (Introduce Vec::resize_with method (see #41758)) - #49570 (avoid IdxSets containing garbage above the universe length) - #49577 (Stabilize String::replace_range) - #49599 (Fix typo) - #49603 (Fix url for intra link provided method) - #49607 (Stabilize iterator methods in 1.27) - #49609 (run-pass/attr-stmt-expr: expand test cases) - #49612 (Fix "since" version for getpid feature.) - #49618 (Fix build error when compiling libcore for 16bit targets) - #49619 (tweak core::fmt docs) - #49637 (Stabilize parent_id()) - #49639 (Update Cargo) - #49628 (Re-write the documentation index) - #49594 (Add some performance guidance to std::fs and std::io docs) - #49625 (miri: add public alloc_kind accessor) - #49634 (Add a test for the fix to issue #43058) - #49641 (Regression test for #46314) - #49547 (Unignore borrowck test) Failed merges:
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-05Rollup merge of #49641 - valff:decl-macro-illegal-copy, r=nikomatsakiskennytm-0/+53
Regression test for #46314 #46314 is fixed by NLL. This PR adds a regression test for the bug. Intended for #47366.
2018-04-05Rollup merge of #49634 - lloydmeta:tests/issue-43058, r=nikomatsakiskennytm-0/+38
Add a test for the fix to issue #43058 Followed the instructions laid out here https://github.com/rust-lang/rust/issues/43058#issuecomment-378389971
2018-04-04Auto merge of #48171 - FraGag:doc-copy-clone-impls, r=nikomatsakisbors-24/+64
Better document the implementors of Clone and Copy There are two parts to this change. The first part is a change to the compiler and to the standard library (specifically, libcore) to allow implementations of `Clone` and `Copy` to be written for a subset of builtin types. By adding these implementations to libcore, they now show up in the documentation. This is a [breaking-change] for users of `#![no_core]`, because they will now have to supply their own copy of the implementations of `Clone` and `Copy` that were added in libcore. The second part is purely a documentation change to document the other implementors of `Clone` and `Copy` that cannot be described in Rust code (yet) and are thus provided by the compiler. Fixes #25893
2018-04-04Rollup merge of #49609 - abonander:attr-macro-stmt-expr, r=petrochenkovkennytm-1/+28
run-pass/attr-stmt-expr: expand test cases Follow-up to https://github.com/rust-lang/rust/pull/49124#discussion_r178542587 r? @petrochenkov