about summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2018-01-21Auto merge of #47622 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-0/+57
Rollup of 10 pull requests - Successful merges: #46938, #47193, #47508, #47510, #47532, #47535, #47559, #47568, #47573, #47578 - Failed merges:
2018-01-21Auto merge of #47495 - nikomatsakis:nll-issue-47153, r=pnkfelixbors-0/+27
remove bogus assertion and comments The code (incorrectly) assumed that constants could not have generics in scope, but it's not really a problem if they do. Fixes #47153 r? @pnkfelix
2018-01-20Rollup merge of #47193 - cramertj:result-opts, r=TimNNGuillaume Gomez-0/+57
Add transpose conversions for nested Option and Result These impls are useful when working with combinator methods that expect an option or a result, but you have a `Result<Option<T>, E>` instead of an `Option<Result<T, E>>` or vice versa.
2018-01-20Stabilize std::ptr::NonNullSimon Sapin-2/+0
2018-01-20Mark Unique as perma-unstable, with the feature renamed to ptr_internals.Simon Sapin-3/+3
2018-01-20Replace Unique<T> with NonZero<T> in Alloc traitSimon Sapin-1/+1
2018-01-20NLL test for mutating &mut referencesritiek-0/+34
2018-01-19Run yield-subtype test on nll mode too as a regression checkSantiago Pastorino-0/+3
2018-01-19Auto merge of #47503 - arielb1:check-size, r=eddybbors-0/+37
avoid double-unsizing arrays in bytestring match lowering The match lowering code, when lowering matches against bytestrings, works by coercing both the scrutinee and the pattern to `&[u8]` and then comparing them using `<[u8] as Eq>::eq`. If the scrutinee is already of type `&[u8]`, then unsizing it is both unneccessary and a trait error caught by the new and updated MIR typeck, so this PR changes lowering to avoid doing that (match lowering tried to avoid that before, but that attempt was quite broken). Fixes #46920. r? @eddyb
2018-01-17Simplify irrefutable slice patternsSeiichi Uchida-0/+24
Closes #47096.
2018-01-16avoid double-unsizing arrays in bytestring match loweringAriel Ben-Yehuda-0/+37
The match lowering code, when lowering matches against bytestrings, works by coercing both the scrutinee and the pattern to `&[u8]` and then comparing them using `<[u8] as Eq>::eq`. If the scrutinee is already of type `&[u8]`, then unsizing it is both unneccessary and a trait error caught by the new and updated MIR typeck, so this PR changes lowering to avoid doing that (match lowering tried to avoid that before, but that attempt was quite broken). Fixes #46920.
2018-01-16remove bogus assertion and commentsNiko Matsakis-0/+27
The code (incorrectly) assumed that constants could not have generics in scope, but it's not really a problem if they do.
2018-01-16rustc_trans: take into account primitives larger than 8 bytes.Eduard-Mihai Burtescu-0/+21
2018-01-16rustc_trans: ignore trailing padding larger than 8 bytes.Eduard-Mihai Burtescu-4/+4
2018-01-15Reexport -> re-export in prose and documentation commentsCarol (Nichols || Goulding)-1/+1
2018-01-14syntax: Rewrite parsing of implsVadim Petrochenkov-4/+4
Properly parse impls for the never type `!` Recover from missing `for` in `impl Trait for Type` Prohibit inherent default impls and default impls of auto traits Change wording in more diagnostics to use "auto traits" Some minor code cleanups in the parser
2018-01-13check_match: fix handling of privately uninhabited typesAriel Ben-Yehuda-0/+28
the match-checking code used to use TyErr for signaling "unknown, inhabited" types for a long time. It had been switched to using the exact type in #38069, to handle uninhabited types. However, in #39980, we discovered that we still needed the "unknown inhabited" logic, but I used `()` instead of `TyErr` to handle that. Revert to using `TyErr` to fix that problem.
2018-01-13Parse `auto trait` inside fns.leonardo.yvens-1/+4
Also refactored parsing auto traits.
2018-01-13Adjust tests for removal of `impl Foo for .. {}`leonardo.yvens-6/+2
2018-01-13Rollup merge of #47344 - topecongiro:fixed-ices, r=alexcrichtonkennytm-0/+94
Add tests to fixed issues. Closes #36792. Closes #38091. Closes #39687. Closes #42148. Closes #42956.
2018-01-13Rollup merge of #47305 - cramertj:better-calendar-alone, r=eddybkennytm-47/+14
Use copy/clone closures to simplify calendar test Split out from #47304 r? @eddyb
2018-01-13Rollup merge of #47298 - cramertj:path-as-modrs, r=nikomatsakiskennytm-0/+0
Treat #[path] files as mod.rs files Fixes https://github.com/rust-lang/rust/issues/46936, cc @briansmith, @SergioBenitez, @nikomatsakis. This (insta-stable) change treats files included via `#[path = "bla.rs"] mod foo;` as though they were `mod.rs` files. Namely, it allows them to include `mod` statements and looks for the child modules in sibling directories, rather than in relative `modname/childmodule.rs` files as happens for non-`mod.rs` files. This change makes the `non_modrs_mods` feature backwards compatible with the existing usage in https://github.com/briansmith/ring, several versions of which are currently broken in beta. If we decide to merge, this change should be backported to beta. cc https://github.com/rust-lang/rust/issues/37872 r? @jseyfried
2018-01-12Auto merge of #46551 - jseyfried:improve_legacy_modern_macro_interaction, r=nrcbors-0/+160
macros: improve 1.0/2.0 interaction This PR supports using unhygienic macros from hygienic macros without breaking the latter's hygiene. ```rust // crate A: #[macro_export] macro_rules! m1 { () => { f(); // unhygienic: this macro needs `f` in its environment fn g() {} // (1) unhygienic: `g` is usable outside the macro definition } } // crate B: #![feature(decl_macro)] extern crate A; use A::m1; macro m2() { fn f() {} // (2) m1!(); // After this PR, `f()` in the expansion resolves to (2), not (3) g(); // After this PR, this resolves to `fn g() {}` from the above expansion. // Today, it is a resolution error. } fn test() { fn f() {} // (3) m2!(); // Today, `m2!()` can see (3) even though it should be hygienic. fn g() {} // Today, this conflicts with `fn g() {}` from the expansion, even though it should be hygienic. } ``` Once this PR lands, you can make an existing unhygienic macro hygienic by wrapping it in a hygienic macro. There is an [example](https://github.com/rust-lang/rust/pull/46551/commits/b766fa887dc0e4b923a38751fe4d570e35a75710) of this in the tests. r? @nrc
2018-01-11Add tests to fixed issues.Seiichi Uchida-0/+94
Closes #36792. Closes #38091. Closes #39687. Closes #42148. Closes #42956.
2018-01-10Add transpose conversions for Option and ResultTaylor Cramer-0/+57
These impls are useful when working with combinator methods that expect an option or a result, but you have a Result<Option<T>, E> instead of an Option<Result<T, E>> or vice versa.
2018-01-10Auto merge of #47167 - ivanbakel:builtin_indexing, r=nikomatsakisbors-0/+58
Fix built-in indexing not being used where index type wasn't "obviously" usize Fixes #33903 Fixes #46095 This PR was made possible thanks to the generous help of @eddyb Following the example of binary operators, builtin checking for indexing has been moved from the typecheck stage to a writeback stage, after type constraints have been resolved.
2018-01-09Use copy/clone closures to simplify calendar testTaylor Cramer-47/+14
2018-01-09Treat #[path] files as mod.rs filesTaylor Cramer-0/+0
2018-01-07Added tests for non-obvious builtin indexingIsaac van Bakel-0/+58
Tests match issues opened on Github. Tests would not previously compile and pass.
2018-01-07Auto merge of #47156 - petrochenkov:extpath, r=nikomatsakisbors-0/+31
Support `extern` in paths Implement the primary alternative to https://github.com/rust-lang/rust/pull/46613 + https://github.com/rust-lang/rust/pull/45771, achieving the same effect without requiring changes to other imports. Both need to be experimentally evaluated before making further progress. The PR also adds docs for all these related features into the unstable book. cc https://github.com/rust-lang/rust/issues/44660 r? @nikomatsakis
2018-01-04Auto merge of #47147 - projektir:to_ptr_cast, r=eddybbors-0/+18
Force appropriate extension when converting from int to ptr #43291 Fixes #43291. Looking for feedback if I've missed something and/or need to add more tests. @eddyb @retep998 @nagisa @oli-obk
2018-01-04Auto merge of #47132 - cramertj:impl-trait-camel-case, r=nikomatsakisbors-0/+20
Limit style lint to non-synthetic generic params Fix https://github.com/rust-lang/rust/issues/46959 r? @nikomatsakis
2018-01-03Support `extern` in pathsVadim Petrochenkov-0/+31
2018-01-02Force appropriate extension when converting from int to ptr #43291projektir-0/+18
2018-01-02Limit style lint to non-synthetic generic paramsTaylor Cramer-0/+20
2018-01-02Add 'ignore-cloudabi' to tests that don't and won't build on CloudABI.Ed Schouten-31/+105
It looks like many of these tests are already disabled on emscripten, which also doesn't seem to support environment variables and subprocess spawning. Just add a similar tag for CloudABI. While there, sort some of the lists of operating systems alphabetically.
2018-01-01Auto merge of #46895 - ricochet1k:macro-lifetimes, r=jseyfriedbors-0/+119
Allow lifetimes in macros This is a resurrection of PR #41927 which was a resurrection of #33135, which is intended to fix #34303. In short, this allows macros_rules! to use :lifetime as a matcher to match 'lifetimes. Still to do: - [x] Feature gate
2018-01-01Auto merge of #47064 - kennytm:force-trailing-newlines, r=estebankbors-12/+10
Add a tidy check for missing or too many trailing newlines. I've noticed recently there are lots of review comments requesting to fix trailing newlines. If this is going to be an official style here, it's better to let the CI do this repetitive check.
2017-12-30Add tests on fixed ICEsSeiichi Uchida-0/+42
Closes #29924. Closes #38857. Closes #39665. Closes #39872. Closes #39553. Closes #41210. Closes #41880. Closes #43483.
2017-12-30Remove excessive trailing newlines.kennytm-2/+0
2017-12-30Add trailing newlines to files which have no trailing newlines.kennytm-10/+10
2017-12-28Add feature gate macro_lifetime_matcherMatt Peterson-0/+7
2017-12-28Fix build and add a macro lifetime labels testMatt Peterson-0/+43
2017-12-28Resurrecting #33135Michael Hewson-0/+69
Started rebasing @sgrif's PR #33135 off of current master. (Well, actually merging it into a new branch based off current master.) The following files still need to be fixed or at least reviewed: - `src/libsyntax/ext/tt/macro_parser.rs`: calls `Parser::parse_lifetime`, which doesn't exist anymore - `src/libsyntax/parse/parser.rs`: @sgrif added an error message to `Parser::parse_lifetime`. Code has since been refactored, so I just took it out for now. - `src/libsyntax/ext/tt/transcribe.rs`: This code has been refactored bigtime. Not sure whether @sgrif's changes here are still necessary. Took it out for this commit.
2017-12-27Auto merge of #47014 - topecongiro:fixed-ices, r=estebankbors-0/+113
Add tests to fixed ICEs Closes #27078. Closes #27985. Closes #39848. Closes #42164. Closes #42479. Closes #45662. Closes #45965. Closes #46152.
2017-12-27Auto merge of #46479 - bkchr:termination_trait, r=arielb1bors-0/+45
Implements RFC 1937: `?` in `main` This is the first part of the RFC 1937 that supports new `Termination` trait in the rust `main` function. Thanks @nikomatsakis, @arielb1 and all other people in the gitter channel for all your help! The support for doctest and `#[test]` is still missing, bu as @nikomatsakis said, smaller pull requests are better :)
2017-12-27Auto merge of #47009 - eddyb:issue-46855, r=arielb1bors-0/+34
rustc_trans: support ZST indexing involving uninhabited types. Fixes #46855 in a minimal way. I decided against supporting non-memory `Rvalue::Len` in this PR (see https://github.com/rust-lang/rust/issues/46855#issuecomment-352965807), as `PlaceContext::Inspect` is also used for `Rvalue::Discriminant`. r? @arielb1
2017-12-27Auto merge of #46977 - est31:column_fix, r=dtolnaybors-5/+5
Make the output of the column! macro 1 based Fixes #46868. I didn't add any regression tests as the change already had to change tests inside the codebase. r? @dtolnay
2017-12-26Auto merge of #46975 - matthewjasper:mir-moveck-asm, r=arielb1bors-0/+43
[MIR Borrowck] Moveck inline asm statements Closes #45695 New behavior: * Input operands to `asm!` are moved, direct output operands are initialized. * Direct, non-read-write outputs match the assignment changes in #46752 (Shallow writes, end borrows).
2017-12-26rustc_trans: support ZST indexing involving uninhabited types.Eduard-Mihai Burtescu-0/+34