about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-02-28add tests for doc coverageQuietMisdreavus-0/+251
2019-02-28Introduce rustc_interface and move some methods thereJohn Kåre Alsaker-3/+6
2019-02-28Move rustdoc-js testing into compiletestGuillaume Gomez-0/+1
2019-02-28Auto merge of #57760 - dlrobertson:varargs1, r=alexregbors-37/+507
Support defining C compatible variadic functions ## Summary Add support for defining C compatible variadic functions in unsafe rust with `extern "C"` according to [RFC 2137]. ## Details ### Parsing When parsing a user defined function that is `unsafe` and `extern "C"` allow variadic signatures and inject a "spoofed" `VaList` in the new functions signature. This allows the user to interact with the variadic arguments via a `VaList` instead of manually using `va_start` and `va_end` (See [RFC 2137] for details). ### Codegen When running codegen for a variadic function, remove the "spoofed" `VaList` from the function signature and inject `va_start` when the arg local references are created for the function and `va_end` on return. ## TODO - [x] Get feedback on injecting `va_start/va_end` in MIR vs codegen - [x] Properly inject `va_end` - It seems like it should be possible to inject `va_end` on the `TerminatorKind::Return`. I just need to figure out how to get the `LocalRef` here. - [x] Properly call Rust defined C variadic functions in Rust - The spoofed `VaList` causes problems here. Related to: #44930 r? @ghost [RFC 2137]: https://github.com/rust-lang/rfcs/blob/master/text/2137-variadic.md
2019-02-28Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` constTim-0/+92
Make `Unique::as_ptr` const without feature attribute as it's unstable Make `NonNull::dangling` and `NonNull::cast` const with `feature = "const_ptr_nonnull"`
2019-02-27Introduce assembly testsDenys Zariaiev-130/+250
2019-02-27allow specifying attributes for tool lintsAndy Russell-1/+5
2019-02-28Fix error in tag-that-dare-not-speak-its-nameTaiki Endo-2/+1
2019-02-28Fix errors in test/uiTaiki Endo-3/+12
2019-02-27Don't promote function calls to nonpromotable thingsOliver Scherer-0/+18
2019-02-27Rename variadic to c_variadicDan Robertson-13/+13
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
2019-02-27Add c_variadic language feature itemDan Robertson-0/+16
2019-02-27Support defining C compatible variadic functionsDan Robertson-24/+478
Add support for defining C compatible variadic functions in unsafe rust with extern "C".
2019-02-27Rollup merge of #58761 - Mark-Simulacrum:add-feature-gate-unwind, r=CentrilMazdak Farrokhzad-1/+1
Add tracking issue for the unwind attribute cc https://github.com/rust-lang/rust/issues/58760
2019-02-27Rollup merge of #58757 - aoikonomopoulos:issue-58212, r=oli-obkMazdak Farrokhzad-0/+13
Normalize the type Self resolves to in an impl This is required at the very least in order to evaluate associated constants for arrays. Fixes #57796 Fixes #58212. r? @oli-obk cc @hellow554
2019-02-27Rollup merge of #58678 - doctorn:refuse-async-fn-2015-edition, r=varkorMazdak Farrokhzad-22/+131
Deny `async fn` in 2015 edition This commit prevents code using `async fn` from being compiled in Rust 2015 edition. Compiling code of the form: ```rust async fn foo() {} ``` Will now result in the error: ``` error[E0670]: `async fn` is not permitted in the 2015 edition --> async.rs:1:1 | 1 | async fn foo() {} | ^^^^^ error: aborting due to error For more information about an error, try `rustc --explain E0670`. ``` This resolves #58652 and also resolves #53714. r? @varkor
2019-02-27Rollup merge of #58627 - euclio:rustdoc-pass-order, r=QuietMisdreavusMazdak Farrokhzad-2/+24
rustdoc: move collapse and unindent docs passes earlier Moves these passes as early as possible so later passes will see the same markdown that is passed to the test collector. Fixes #58473, and a similar issue with the private-doc-tests lint. r? @QuietMisdreavus
2019-02-27Rollup merge of #58075 - asettouf:master, r=varkorMazdak Farrokhzad-2/+2
Fix for issue #58050 Hi, a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue #58050 It passed `python x.py test src/tools/tidy` locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`. Let me know if anything else is needed.
2019-02-27Mention `unwind(aborts)` in diagnostics for `#[unwind]`Vadim Petrochenkov-0/+51
Simplify input validation for `#[unwind]`, add tests
2019-02-26Add tracking issue for the unwind attribute.Mark Rousskov-1/+1
2019-02-26Changing error message to reflect changes with the 2018 editionAdonis-2/+2
Signed-off-by: Adonis <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr Co-Authored-By: asettouf <adonis.settouf@gmail.com> Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr Co-Authored-By: asettouf <adonis.settouf@gmail.com> Stabilize split_ascii_whitespace Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750 fix stabilization order of uniform_paths. hir: add HirId to main Hir nodes Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs` Fixes https://github.com/fortanix/rust-sgx/issues/88 Update src/libsyntax/ext/tt/quoted.rs Co-Authored-By: asettouf <adonis.settouf@gmail.com> Revert "Merge remote-tracking branch 'upstream/master'" This reverts commit 751f05bd155e2c55d4177fe8211df634faf3a644, reversing changes made to 545a3e62b0cb473108869a61b271bc589afb49da.
2019-02-26Normalize the type Self resolves to in an implAngelos Oikonomopoulos-0/+13
This is required at the very least in order to evaluate associated constants for arrays (see #58212).
2019-02-25Auto merge of #57367 - petrochenkov:unrestab, r=Centrilbors-70/+86
Stabilize `unrestricted_attribute_tokens` In accordance with a plan described in https://internals.rust-lang.org/t/unrestricted-attribute-tokens-feature-status/8561/3. Delimited non-macro non-builtin attributes now support the same syntax as macro attributes: ``` PATH PATH `(` TOKEN_STREAM `)` PATH `[` TOKEN_STREAM `]` PATH `{` TOKEN_STREAM `}` ``` Such attributes mostly serve as inert proc macro helpers or tool attributes. To some extent these attributes are de-facto stable due to a hole in feature gate checking (feature gating is done too late - after macro expansion.) So if macro *removes* such helper attributes during expansion (and it must remove them, unless it's a derive macro), then the code will work on stable. Key-value non-macro non-builtin attributes are now restricted to bare minimum required to support what we support on stable - unsuffixed literals (https://github.com/rust-lang/rust/issues/34981). ``` PATH `=` LITERAL ``` (Key-value macro attributes are not supported at all right now.) Crater run in https://github.com/rust-lang/rust/pull/57321 found no regressions for this change. There are multiple possible ways to extend key-value attributes (https://github.com/rust-lang/rust/pull/57321#issuecomment-451574065), but I'd expect an RFC for that and it's not a pressing enough issue to block stabilization of delimited attributes. Built-in attributes are still restricted to the "classic" meta-item syntax, nothing changes here. https://github.com/rust-lang/rust/pull/57321 goes further and adds some additional restrictions (more consistent input checking) to built-in attributes. Closes https://github.com/rust-lang/rust/issues/55208
2019-02-25Auto merge of #58302 - SimonSapin:tryfrom, r=alexcrichtonbors-8/+6
Stabilize TryFrom and TryInto with a convert::Infallible empty enum This is the plan proposed in https://github.com/rust-lang/rust/issues/33417#issuecomment-423073898
2019-02-25Stabilize `unrestricted_attribute_tokens`Vadim Petrochenkov-62/+19
2019-02-25Restrict value in key-value attributes to literalsVadim Petrochenkov-13/+72
2019-02-25Rename rustdoc js test suitesGuillaume Gomez-17/+17
2019-02-25Add rustdoc JS non-std testsGuillaume Gomez-0/+8
2019-02-25Rollup merge of #58725 - jamwt:fix-27949, r=CentrilMazdak Farrokhzad-0/+41
Test that binop subtyping in rustc_typeck fixes #27949
2019-02-25Rollup merge of #55632 - ollie27:deny_overflowing_literals, r=CentrilMazdak Farrokhzad-17/+30
Deny the `overflowing_literals` lint for all editions The `overflowing_literals` was made deny by default for the 2018 edition by #54507, however I'm not aware of any reason it can't be made deny by default for the 2015 edition as well.
2019-02-25Test that binop subtyping in rustc_typeck fixes #27949Jamie Turner-0/+41
2019-02-25Auto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelixbors-361/+441
Use normal mutable borrows in matches `ref mut` borrows are currently two-phase with NLL enabled. This changes them to be proper mutable borrows. To accommodate this, first the position of fake borrows is changed: ```text [ 1. Pre-match ] | [ (old create fake borrows) ] [ 2. Discriminant testing -- check discriminants ] <-+ | | | (once a specific arm is chosen) | | | [ (old read fake borrows) ] | [ 3. Create "guard bindings" for arm ] | [ (create fake borrows) ] | | | [ 4. Execute guard code ] | [ (read fake borrows) ] --(guard is false)-----------+ | | (guard results in true) | [ 5. Create real bindings and execute arm ] | [ Exit match ] ``` The following additional changes are made to accommodate `ref mut` bindings: * We no longer create fake `Shared` borrows. These borrows are no longer needed for soundness, just to avoid some arguably strange cases. * `Shallow` borrows no longer conflict with existing borrows, avoiding conflicting access between the guard borrow access and the `ref mut` borrow. There is some further clean up done in this PR: * Avoid the "later used here" note for Shallow borrows (since it's not relevant with the message provided) * Make any use of a two-phase borrow activate it. * Simplify the cleanup_post_borrowck passes into a single pass. cc #56254 r? @nikomatsakis
2019-02-25Rollup merge of #58370 - nox:relax-bounds, r=dtolnayMazdak Farrokhzad-10/+11
Relax some Hash bounds on HashMap<K, V, S> and HashSet<T, S> Notably, hash iterators don't require any trait bounds to be iterated.
2019-02-24Deny `async fn` in 2015 editionNathan Corbyn-22/+131
Fix style issues and update diagnostic messages Update src/librustc_passes/diagnostics.rs Co-Authored-By: doctorn <me@nathancorbyn.com> Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition Deny nested `async fn` in Rust 2015 edition
2019-02-24Auto merge of #58315 - gnzlbg:returns_twice, r=alexcrichtonbors-0/+45
Implement unstable ffi_return_twice attribute This PR implements [RFC2633](https://github.com/rust-lang/rfcs/pull/2633) r? @eddyb
2019-02-24Type check pointer comparisonsMatthew Jasper-0/+95
2019-02-24Auto merge of #58691 - Centril:rollup, r=Centrilbors-0/+75
Rollup of 6 pull requests Successful merges: - #57364 (Improve parsing diagnostic for negative supertrait bounds) - #58183 (Clarify guarantees for `Box` allocation) - #58442 (Simplify the unix `Weak` functionality) - #58454 (Refactor Windows stdio and remove stdin double buffering ) - #58511 (Const to op simplification) - #58642 (rustdoc: support methods on primitives in intra-doc links) Failed merges: r? @ghost
2019-02-24Rollup merge of #58642 - tspiteri:intra-rustdoc-prim-method, r=GuillaumeGomezMazdak Farrokhzad-0/+3
rustdoc: support methods on primitives in intra-doc links Fixes #58598.
2019-02-24Rollup merge of #57364 - hdhoang:33418_negative_bounds, r=estebankMazdak Farrokhzad-0/+72
Improve parsing diagnostic for negative supertrait bounds closes #33418 r? @estebank
2019-02-24Auto merge of #58304 - gnzlbg:simd_saturated, r=nagisabors-0/+830
Add generic simd saturated add/sub intrinsics r? @eddyb
2019-02-24Auto merge of #58232 - ljedrz:HirIdification_continued, r=Zoxcbors-3/+3
HirId-ify intravisit A big step towards https://github.com/rust-lang/rust/pull/57578. This affects mostly `hir::{collector, intravisit}` and `rustc::lint`.
2019-02-23move collapse and unindent docs passes earlierAndy Russell-2/+24
2019-02-23rustdoc: support methods on primitives in intra-doc linksTrevor Spiteri-0/+3
2019-02-23Use E0724 instead of E0723 as an error codegnzlbg-2/+2
2019-02-23Fix attribute checkgnzlbg-2/+3
2019-02-23Use pattern to match attributesgnzlbg-9/+5
2019-02-23Correct error messagegnzlbg-3/+3
2019-02-23Implement ffi_returns_twice attributegnzlbg-0/+48
2019-02-23Type check coercions to pointer typesMatthew Jasper-0/+126
2019-02-23Add debug-info to access variables from generator stateWim Looman-2/+8