about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2017-10-19Rollup merge of #45326 - cuviper:min-llvm-3.9, r=alexcrichtonkennytm-11/+6
Bump the minimum LLVM to 3.9 Old LLVM bugs are reportedly cropping up harder, but 3.9 seems to be OK. Fixes #45277.
2017-10-19Rollup merge of #44138 - steveklabnik:rustdoc-deprecations, r=QuietMisdreavuskennytm-3/+3
Deprecate several flags in rustdoc Part of #44136 cc @rust-lang/dev-tools @rust-lang/docs This is a very basic PR to start deprecating some flags; `rustdoc` doesn't really have fancy output options like `rustc` does, so I went with `eprintln!`. Happy to change it if people feel that's not appropriate. Also, I have no idea if we can or should write tests here, so I didn't try. If someone feels strongly about it, then let's do it, but given that the only outcome here is a side effect...
2017-10-18Remove two obsolete min-llvm-version testsJosh Stone-3/+0
2017-10-18Auto merge of #44501 - nikomatsakis:issue-44137-non-query-data-in-tcx, r=eddybbors-0/+36
remove or encapsulate the remaining non-query data in tcx I wound up removing the existing cache around inhabitedness since it didn't seem to be adding much value. I reworked const rvalue promotion, but not that much (i.e., I did not split the computation into bits, as @eddyb had tossed out as a suggestion). But it's now demand driven, at least. cc @michaelwoerister -- see the `forbid_reads` change in last commit r? @eddyb -- since the trickiest of this PR is the work on const rvalue promotion cc #44137
2017-10-17modify tests to use new flagsteveklabnik-3/+3
2017-10-17Rollup merge of #45315 - ↵kennytm-0/+26
zackmdavis:expected_statement_after_outer_attr_after_inner_attr, r=petrochenkov don't issue "expected statement after outer attr." after inner attr. While an inner attribute here is in fact erroneous, that error ("inner attribute is not permitted in this context") successfully gets set earlier; this further admonition is nonsensical. Resolves #45296.
2017-10-17Auto merge of #45311 - goffrie:issue-40003, r=alexcrichtonbors-0/+186
Add the test for #40003. I checked that the test failed to compile on an older nightly (I tried 2017-09-29) and that it compiles against master. Closes #40003.
2017-10-16restructure the public inhabitedness APIs and remove the cacheNiko Matsakis-0/+36
The cache was broken anyhow and this computation doesn't look that expensive. These public accessors could potentially become queries, but we'd have to add some more complex logic around lift. I'd prefer to have some test cases to profile with before doing that. Fixes #44402.
2017-10-16Auto merge of #44857 - toidiu:ak-44493-empty-predicate, r=nikomatsakisbors-0/+23
#44493 add structure for inferred_outlives_of #44493 - add placeholder for the final implementation of inferred_outlives_of - add some placeholder tests
2017-10-16Update the codegen/mainsubprogram tests to min-llvm 4.0Josh Stone-8/+6
The necessary changes were only in upstream LLVM in 4.0, but they were for a while backported to Rust LLVM. Now that Rust LLVM is also 4.0, we can make the test conditional here more accurate.
2017-10-16add error to the correct line in unit testtoidiu-3/+2
2017-10-16add a test casetoidiu-0/+24
dont duplicate error codes choose unlikely error code specify error pattern in test
2017-10-16Auto merge of #45202 - alexcrichton:fix-inline-always, r=michaelwoeristerbors-1/+34
rustc: Handle #[inline(always)] at -O0 This commit updates the handling of `#[inline(always)]` functions at -O0 to ensure that it's always inlined regardless of the number of codegen units used. Closes #45201
2017-10-16Auto merge of #45297 - matthewjasper:associated-item-namespaces, r=petrochenkovbors-0/+51
Check namespaces when resolving associated items in typeck Closes #35600 Closes #44247 Fixes a "cannot move a value of type..." error in the same case as #44247 but with the associated items swapped.
2017-10-16Auto merge of #45283 - alexcrichton:used-mut-nodes, r=arielb1bors-14/+14
rustc: Remove `used_mut_nodes` from `TyCtxt` This updates the borrowck query to return a result, and this result is then used to incrementally check for unused mutable nodes given sets of all the used mutable nodes. Closes #42384
2017-10-15don't issue "expected statement after outer attr." after inner attr.Zack M. Davis-0/+26
While an inner attribute here is in fact erroneous, that error ("inner attribute is not permitted in this context") successfully gets set earlier; this further admonition is nonsensical. Resolves #45296.
2017-10-16Auto merge of #45191 - petrochenkov:yesar, r=Mark-Simulacrumbors-13/+20
rustbuild: Support specifying archiver and linker explicitly With this patch `x.py test` passes without toolchain being in `PATH` if `cc`, `cxx`, `ar`, `linker` and `gdb` are specified in `config.toml` (except for a few `run-make` tests using `nm`). Fixes https://github.com/rust-lang/rust/issues/41821 r? @Mark-Simulacrum
2017-10-15Add test for #40003.Geoffry Song-0/+186
2017-10-15rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov-13/+20
2017-10-15rustc: Fix some ThinLTO internalizationAlex Crichton-0/+34
First the `addPreservedGUID` function forgot to take care of "alias" summaries. I'm not 100% sure what this is but the current code now matches upstream. Next the `computeDeadSymbols` return value wasn't actually being used, but it needed to be used! Together these should... Closes #45195
2017-10-15Auto merge of #45123 - goffrie:fix-method-unit-call, r=oli-obkbors-13/+93
Provide the full span of method calls to `check_argument_types` ... so that it includes the span of the passed arguments, not just the name of the called method. Fixes #44760.
2017-10-15Check namespaces when resolving associated items in typeckmatthewjasper-0/+51
2017-10-15Auto merge of #45200 - mikhail-m1:match-with-false-edges, r=nikomatsakisbors-0/+25
MIR-borrowck: add false edges to match arms basic fix for https://github.com/rust-lang/rust/issues/45043, should be modified with #45184
2017-10-14rustc: Remove `used_mut_nodes` from `TyCtxt`Alex Crichton-14/+14
This updates the borrowck query to return a result, and this result is then used to incrementally check for unused mutable nodes given sets of all the used mutable nodes. Closes #42384
2017-10-14Auto merge of #45175 - petrochenkov:dyn, r=nikomatsakisbors-2/+74
Implement `dyn Trait` syntax (RFC 2113) cc https://github.com/rust-lang/rust/issues/44662 r? @nikomatsakis
2017-10-14Auto merge of #45162 - chrisvittal:mir-testing, r=nikomatsakisbors-73/+304
Modify MIR testing to require consecutive lines MIR testing now requires that lines be consecutive. To achive this, instead of collecting the expected mir as a string, it is now wrapped in an `ExpectedLine` enum, that is either `Elision` or `Text(T)` where `T: AsRef<str>`. `Text` lines must be matched in order, unless separated by `Elision` lines. Elision occurs lazily, that is, an Elision will skip as few lines as possible. To add a new elision marker. Put a comment containing only "..." and whitespace in any MIR testing block. Like so: ``` // fn write_42(_1: *mut i32) -> bool { // ... // bb0: { // Validate(Acquire, [_1: *mut i32]); // Validate(Release, [_1: *mut i32]); // ... // return; // } // } ``` Right now, all input before the line right after `// START` is elided, and all input after the line right before `// END` is also not tested. Many tests need to be updated. That will follow in the next commit. cc #45153 r? @nikomatsakis
2017-10-14Implement `dyn Trait` syntaxVadim Petrochenkov-2/+74
2017-10-14Auto merge of #45104 - vitiral:incr_auto_assert2, r=michaelwoeristerbors-446/+392
Incremental compilation auto assert (with except) cc @michaelwoerister bors merged part 1, so this is a WIP of part 2 of #45009 -- auto asserting DepNodes depending on the type of node rustc_clean/dirty is attached to Framework: - [x] finish auto-detection for specified DepNodes - [x] finish auto-detection for remaining DepNodes Test Refactors: - [x] consts.rs - [x] enum_constructors.rs - [x] extern_mods.rs - [x] inherent_impls.rs - [x] statics.rs - [x] struct_constructors.rs - ~~**BLOCKED** trait_defs.rs, see FIXME~~ - ~~**BLOCKED** trait_impls.rs~~ - [x] type_defs.rs - [x] enum_defs.rs
2017-10-13Pass the full span for method callsGeoffry Song-13/+93
2017-10-13Auto merge of #45069 - sinkuu:tuple_arg, r=nikomatsakisbors-9/+37
Better error for missing tuple pattern in args #44150 Before: ``` error[E0593]: closure takes 2 arguments but 1 argument is required --> test.rs:5:40 | 5 | let it = v.into_iter().enumerate().map(|i, x| i); | ^^^ -------- takes 2 arguments | | | expected closure that takes 1 argument ``` After: ``` error[E0593]: closure takes 2 arguments but a 2-tuple is required --> test.rs:5:40 | 5 | let it = v.into_iter().enumerate().map(|i, x| i); | ^^^ ------ takes 2 arguments | | | expected closure that takes a 2-tuple ```
2017-10-13fix review commentsGarrett Berg-31/+34
2017-10-13Rollup merge of #45221 - estebank:issue-41790, r=nikomatsakiskennytm-0/+30
Point at immutable outer variable When attempting to mutate an immutable outer variable from a closure, point at the outer variable and suggest making it mutable. Fix #41790.
2017-10-13Rollup merge of #45189 - alexcrichton:thinlto-allocators, r=michaelwoeristerkennytm-41/+19
rustc: Handle `#[no_mangle]` anywhere in a crate This commit updates the reachability pass of the compiler to seed the local worklist with `#[no_mangle]`-like items anywhere in a crate, not just those reachable from public items. Closes #45165
2017-10-13Rollup merge of #45178 - Badel2:comma-after-struct, r=petrochenkovkennytm-0/+45
Better error message for comma after base struct #41834 This adds a better error for commas after the base struct: ``` let foo = Foo { one: 111, ..Foo::default(), // This comma is a syntax error }; ``` The current error is a generic `expected one of ...` which isn't beginner-friendly. My error looks like this: ``` error: cannot use a comma after the base struct --> tmp/example.rs:26:9 | 26 | ..Foo::default(), | ^^^^^^^^^^^^^^^^- help: remove this comma | = note: the base struct expansion must always be the last field ``` I even added a note for people who don't know why this isn't allowed.
2017-10-13Rollup merge of #45173 - laumann:suggest-misspelled-labels, r=petrochenkovkennytm-0/+46
Add suggestions for misspelled labels Another part of #30197
2017-10-13Rollup merge of #45133 - GuillaumeGomez:usize-index-msg, r=dtolnaykennytm-0/+15
usize index message for vec
2017-10-13Rollup merge of #45122 - jean-lourenco:master, r=nikomatsakiskennytm-1/+6
Better compile error output when using arguments instead of types Following @estebank sugestion on issue https://github.com/rust-lang/rust/issues/18945#issuecomment-331251436
2017-10-13Auto merge of #45031 - alexcrichton:nounwind, r=arielb1bors-1/+40
rustc: Add LLVM `nounwind` with `-C panic=abort` This informs LLVM that functions can't unwind, which while it should typically have already been inferred when necessary or otherwise not impact codegen is apparently needed on targets like ARM to avoid references to unnecessary symbols. Closes #44992
2017-10-12incr comp: rustc_clean/dirty auto assertGarrett Berg-436/+379
This adds auto-assertion to `rustc_clean/dirty` and also implements more comprehensive testing for - src/test/incremental/hashes/enum_constructors.rs - src/test/incremental/hashes/enum_defs.rs - src/test/incremental/hashes/extern_mods.rs - src/test/incremental/hashes/inherent_impls.rs - src/test/incremental/hashes/statics.rs - src/test/incremental/hashes/struct_constructors.rs - src/test/incremental/hashes/type_defs.rs trait_defs.rs and trait_impl.rs are blocked on a hard to triage compiler ICE (at least hard for a newbie like me) having to do with some DepNodes not getting computed for traits. A FIXME has been added in the source to reflect this continued work.
2017-10-13Auto merge of #45025 - ↵bors-5/+137
pnkfelix:mir-borrowck-moves-of-supporting-prefixes-invalidate-uses-too, r=arielb1 MIR-borrowck: moves of prefixes invalidate uses too I overlooked the fact that when we check if a path is moved, we need to check for interference between the (shallow) prefixes and the use in question. ~~Long term, we may want to revise how this computation is done. For example, it might be better to represent the set of invalidated prefixes in the dataflow computation (the `maybe_uninitialized` dataflow), and thus avoid one of the loops in the code here.~~ * Update: I was wrong in my original recollection of the dataflow code, which actually does the right thing, in terms of precisely tracking substructure initialization and movement. Fix #44833 ---- Update: The initial version of this PR's description (and the code as well) erroneously focused on supporting prefixes. ~~But the two main cases of interest are: 1. the *shallow* prefixes, and 2. the deref-free prefix built off a local (if the lvalue is indeed built off a local)~~ Update 2: The main cases of interest are in fact: 1. the nearest prefix with a MovePath, and 2. the suffixes.
2017-10-13Rewordsinkuu-6/+6
2017-10-13Rollup merge of #45190 - petrochenkov:shorten, r=alexcrichtonkennytm-9/+9
Shorten some test names An immediate fix for the first issue in https://github.com/rust-lang/rust/issues/45103 r? @alexcrichton
2017-10-13Rollup merge of #44989 - QuietMisdreavus:what-is-your-quest, r=GuillaumeGomezkennytm-0/+13
let rustdoc print the crate version into docs This PR adds a new unstable flag to rustdoc, `--crate-version`, which when present will add a new entry to the sidebar of the root module, printing the given version number: ![Screenshot of a test crate, showing "Version 1.3.37" under the crate name](https://user-images.githubusercontent.com/5217170/31104096-805e3f4c-a7a0-11e7-96fc-368b6fe063d6.png) Closes #24336 (The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)
2017-10-12rustc: Handle `#[linkage]` anywhere in a crateAlex Crichton-41/+19
This commit updates the reachability pass of the compiler to seed the local worklist with `#[linkage]`-like items anywhere in a crate, not just those reachable from public items. Closes #45165
2017-10-12Auto merge of #44985 - zilbuz:issue-44974, r=pnkfelixbors-9/+339
MIR borrowck: print lvalues in error messages in the same way that the AST borrowck Fix #44974 - Print fields with `.name` rather than `.<num>` - Autoderef values if followed by a field or an index - Output `[..]` when borrowing inside a slice
2017-10-11rustc: Handle #[inline(always)] at -O0Alex Crichton-1/+34
This commit updates the handling of `#[inline(always)]` functions at -O0 to ensure that it's always inlined regardless of the number of codegen units used. Closes #45201
2017-10-11Point at immutable outer variableEsteban Küber-0/+30
When attempting to mutate an immutable outer variable from a closure, point at the outer variable and suggest making it mutable.
2017-10-11Added `revisions: ast mir` template to tests that this PR sync'ed ast+mir ↵Felix S. Klock II-5/+28
borrowcks. (There are other tests that this PR also improves, but were not completely synchronized. I chose to wait until later to pull those into the `revisions: ast mir` testing pattern; later being either when they *are* synchronized, or in some PR where we migrate all borrowck tests, regardless of whether MIR-borrowck is "finished" for them or not.)
2017-10-11Test case illustrating some variants of the issue pointed out by ariel.Felix S. Klock II-0/+60
Expanded to cover partial-initialization ideas.
2017-10-11Test against accesses to uninitialized fields.Felix S. Klock II-0/+49