about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-09-19Rollup merge of #64591 - jamesmunns:grammar-fix, r=jonas-schievinkMazdak Farrokhzad-15/+15
Fix a minor grammar nit, update UI tests Minor fix, but I noticed it while debugging some code
2019-09-19Rollup merge of #64554 - lqd:polonius_tests4, r=nikomatsakisMazdak Farrokhzad-4/+42
Polonius: more `ui` test suite fixes Since #62736, new tests have been added, and the `run-pass` suite was merged into the `ui` suite. This PR adds the missing tests expectations for Polonius, and updates the existing ones where the NLL output has changed in some manner (e.g. ordering of notes) Those are the trivial cases, but a more-detailed explanation is available [in this write-up](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?both#26-async-awaitasync-borrowck-escaping-closure-errorrs-outputs-from-NLL-Polonius-diff) starting at test case 26: they are only differing in diagnostics and instances of other existing test cases differences. Only 3 of the 9020 tests are still "failing" at the moment (1 failure, 2 OOMs). r? @nikomatsakis
2019-09-19Restore whitespaceJames Munns-3/+3
2019-09-19Fix a minor grammar nit, update UI testsJames Munns-18/+18
2019-09-18Rollup merge of #64578 - max-sixty:22656-lldb-8, r=alexcrichtonTyler Mandry-1/+1
Fix issue22656 with LLDB 8 Closes https://github.com/rust-lang/rust/issues/64074
2019-09-18fix debuginfo/issue22656 with LLDB 8Maximilian Roos-1/+1
2019-09-17Rollup merge of #64528 - Aaron1011:fix/proc-macro-type, r=alexcrichtonTyler Mandry-1/+12
Load proc macro metadata in the correct order. Serialized proc macro metadata is assumed to have a one-to-one correspondence with the entries in static array generated by proc_macro_harness. However, we were previously serializing proc macro metadata in a different order than proc macros were laied out in the static array. This lead to us associating the wrong data with a proc macro when generating documentation, causing Rustdoc to generate incorrect docs for proc macros. This commit keeps track of the order in which we insert proc macros into the generated static array. We use this same order when serializing proc macro metadata, ensuring that we can later associate the metadata for a proc macro with its entry in the static array. Fixes #64251
2019-09-17Rollup merge of #64486 - matthewjasper:hygiene-debugging, r=petrochenkovTyler Mandry-1/+11
Print out more information for `-Zunpretty=expanded,hygiene` I've found this helpful when trying to understand how hygiene works. Closes #16420
2019-09-17Generate proc macro harness in AST order.Aaron Hill-1/+12
This ensures that we match the order used by proc macro metadata serialization. Fixes #64251
2019-09-17Auto merge of #64562 - tmandry:rollup-kfk0nuo, r=tmandrybors-30/+7
Rollup of 10 pull requests Successful merges: - #61626 (Get rid of special const intrinsic query in favour of `const_eval`) - #64283 (Updated RELEASES.md for 1.38.0) - #64394 (Shrink `SubregionOrigin`.) - #64429 (Fix failure note `to_str` implementation) - #64436 (improve Vec example soundness in mem::transmute docs) - #64502 (avoid duplicate issues for Miri build failures) - #64505 (Fix inconsistent link formatting) - #64529 (Add an example to Pin::as_mut) - #64541 (document Miri error categories) - #64544 (build-manifest: re-add some comments) Failed merges: r? @ghost
2019-09-17Rollup merge of #64429 - afnanenayet:afnan/fix-failure-note-json-level, ↵Tyler Mandry-2/+2
r=Mark-Simulacrum Fix failure note `to_str` implementation Serialize the level to something a little more useful for a failure note struct. This fixes #60425.
2019-09-17Print syntax contexts and marks when printing hygiene informationMatthew Jasper-0/+10
2019-09-17Auto merge of #64525 - nikomatsakis:issue-64512-drop-order-tail-temp, ↵bors-0/+109
r=davidtwco adjust desugaring for async fn to correct drop order Old desugaring, given a user function body `{ $stmts; $expr }` ``` { let $param_pattern0 = $raw_param0; ... let $param_patternN = $raw_paramN; $stmts; $expr } ``` New desugaring: ``` { let $param_pattern0 = $raw_param0; ... let $param_patternN = $raw_paramN; drop-temps { $stmts; $expr } } ``` The drop-temps is an internal bit of HIR that drops temporaries from the resulting expression, but it should be equivalent to `return { $stmts; $expr }`. Fixes #64512 Fixes #64391
2019-09-17Bless json output of test ui/json-options.rs for Poloniuslqd-0/+1
2019-09-17Bless json output of test ui/json-multiple.rs for Poloniuslqd-0/+1
2019-09-17Update expectations of test ui/dropck/dropck_trait_cycle_checked.rs for Poloniuslqd-4/+8
as its output was changed by https://github.com/rust-lang/rust/commit/2ff337a8e286a5b472f71b3bbdc3d4b6b840870f#diff-bd3f80b956148a5d1567aa8698b8a507
2019-09-17Bless output of test borrowck/return-local-binding-from-desugaring.rs for ↵lqd-0/+16
Polonius
2019-09-17Bless output of test borrowck/return-local-binding-from-desugaring.rs for ↵lqd-0/+16
Polonius
2019-09-17Get rid of special const intrinsic query in favour of `const_eval`Oliver Scherer-28/+5
2019-09-17apply nits from centrilNiko Matsakis-7/+8
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-09-16Fix failure note `to_str` implementationAfnan Enayet-2/+2
* Serialize the level to something a little more useful for a failure note struct * Update tests accordingly
2019-09-17Rollup merge of #64416 - mark-i-m:region-naming-ctx, r=estebankMazdak Farrokhzad-12/+12
Various refactorings to clean up nll diagnostics - Create ErrorReportingCtx and ErrorConstraintInfo, vasting reducing the number of arguments passed around everywhere in the error reporting code - Create RegionErrorNamingCtx, making a given lifetime have consistent numbering thoughout all error messages for that MIR def. - Make the error reporting code return the DiagnosticBuilder rather than directly buffer the Diagnostic. This makes it easier to modify the diagnostic later, e.g. to add suggestions. r? @estebank Split out from https://github.com/rust-lang/rust/pull/58281
2019-09-16Tweak unsatisfied HRTB errorsEsteban Küber-40/+117
2019-09-16add regression test for issue-64391Niko Matsakis-0/+14
2019-09-16add test for drop order of temporary in tail return expressionNiko Matsakis-0/+94
2019-09-16Rollup merge of #64504 - guanqun:use-println-without-empty-str, ↵Mazdak Farrokhzad-18/+18
r=jonas-schievink use println!() instead of println!("") The empty string is unnecessary.
2019-09-16Rollup merge of #64467 - Mark-Simulacrum:hide-cfg-failures, r=estebankMazdak Farrokhzad-0/+5
Hide diagnostics emitted during --cfg parsing The early error is more than sufficient for fixing the problem. Fixes https://github.com/rust-lang/rust/issues/31496.
2019-09-16Rollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichtonMazdak Farrokhzad-16/+5
Stabilize `Vec::new` and `String::new` as `const fn`s Closes https://github.com/rust-lang/rust/issues/64022. r? @oli-obk
2019-09-16Rollup merge of #63955 - RalfJung:intern, r=oli-obkMazdak Farrokhzad-1/+48
Make sure interned constants are immutable This makes sure that interning for constants (not statics) creates only immutable allocations. Previously, the "main" allocation of `const FOO: Cell<i32> = Cell::new(0);` was marked as mutable, but I don't think we want that. It can be only copied, not written to. Also, "leftover" allocations (behind raw pointers etc) were left mutable. I don't think we want to support that. I tried asserting that these are all already immutable (to double-check our static checks), but that failed in this one: ```rust const NON_NULL_PTR2: NonNull<u8> = unsafe { mem::transmute(&0) }; ``` Seems like maybe we want more precise mutability annotation inside Miri for locals (like `&0` here) so that this would actually become immutable to begin with? I also factored `intern_shallow` out of the visitor so that we don't have to construct a visitor when we do not plan to visit anything. That confused me at first.
2019-09-16Const-stabilize `String::new`.Mazdak Farrokhzad-3/+1
2019-09-16Const-stabilize `Vec::new`.Mazdak Farrokhzad-13/+4
2019-09-15Hide diagnostics emitted during --cfg parsingMark Rousskov-0/+5
The early error is more than sufficient for fixing the problem.
2019-09-15Auto merge of #64491 - Centril:rollup-21wkl69, r=Centrilbors-19/+51
Rollup of 3 pull requests Successful merges: - #63872 (Document platform-specific behavior of the iterator returned by std::fs::read_dir) - #64250 (save-analysis: Nest typeck tables when processing functions/methods) - #64472 (Don't mark expression with attributes as not needing parentheses) Failed merges: r? @ghost
2019-09-15Rollup merge of #64472 - Mark-Simulacrum:unused-parens-attr, r=varkorMazdak Farrokhzad-19/+23
Don't mark expression with attributes as not needing parentheses This is not perfectly correct as `#[attr] (5)` will still not lint, but it does seem good enough, in particular as the parentheses in that case are not unambiguously incorrect; I might personally prefer to see them for clarity. Fixes https://github.com/rust-lang/rust/issues/43279.
2019-09-15Rollup merge of #64250 - Xanewok:save-analysis-assoc-nested, r=varkorMazdak Farrokhzad-0/+28
save-analysis: Nest typeck tables when processing functions/methods Fixes an issue where we did not nest tables correctly when resolving associated types in formal argument/return type positions. This was the minimized reproduction case that I tested the fix on: ```rust pub trait Trait { type Assoc; } pub struct A; pub fn func() { fn _inner1<U: Trait>(_: U::Assoc) {} fn _inner2<U: Trait>() -> U::Assoc { unimplemented!() } impl A { fn _inner1<U: Trait>(self, _: U::Assoc) {} fn _inner2<U: Trait>(self) -> U::Assoc { unimplemented!() } } } ``` using `debug_assertions`-enabled rustc and by additionally passing `-Zsave-analysis`. Unfortunately the original assertion fired is a *debug* one and from what I can tell we don't run the tests with these on, so I'm not adding a test here. If I missed it and there is a way to run tests with these on, I'd love to add a test case for this. Closes #63663 Closes #50328 Closes #43982
2019-09-15Auto merge of #64474 - Mark-Simulacrum:permit-err-overlap, r=matthewjasperbors-0/+31
Permit impls referencing errors to overlap Fixes #43400; previously this would emit an overlapping impls error, but no longer does.
2019-09-15use println!()Guanqun Lu-18/+18
2019-09-15Permit impls referencing errors to overlapMark Rousskov-0/+31
2019-09-15Auto merge of #64483 - petrochenkov:expectattr2, r=Centrilbors-159/+159
resolve: Tweak some "cannot find" wording for macros
2019-09-15all memory behind a constant must be immutableRalf Jung-0/+47
2019-09-15const interning: move mutability computation into intern_shallow, and always ↵Ralf Jung-1/+1
intern constants as immutable
2019-09-15resolve: Remove `!` from "cannot find" diagnostics for macrosVadim Petrochenkov-41/+41
2019-09-15resolve: Tweak "cannot find" wording for attributesVadim Petrochenkov-118/+118
2019-09-15Print visibility of `macro` itemsMatthew Jasper-1/+1
2019-09-15Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkovbors-12/+34
Cleanup handling of hygiene for built-in macros This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms. * `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}` * Remove `Span::with_legacy_ctxt` * `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically. * `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene. * everything else is moved to def-site hygiene r? @petrochenkov
2019-09-15Remove `with_legacy_ctxt`Matthew Jasper-12/+34
2019-09-15Auto merge of #64478 - Centril:rollup-bnt51w1, r=Centrilbors-11/+29
Rollup of 5 pull requests Successful merges: - #64457 (def_collector: Do not ICE on attributes on unnamed fields) - #64463 (resolve: Tweak some expected/found wording) - #64471 (Warn on no_start, crate_id attribute use) - #64473 (Use try_fold instead of manually carrying an accumulator) - #64475 (simplify the initialization) Failed merges: r? @ghost
2019-09-15Rollup merge of #64471 - Mark-Simulacrum:warn-depr-attr, r=CentrilMazdak Farrokhzad-7/+16
Warn on no_start, crate_id attribute use These attributes are now deprecated; they don't have any use anymore. `no_start` stopped being applicable in 3ee916e50bd86768cb2a9141f9b2c52d2601b412 as part of #18967. Ideally we would've removed it pre-1.0, but since that didn't happen let's at least mark it deprecated. `crate_id` was renamed to `crate_name` in 50ee1ec1b4f107122d8037ac7b0b312afa6eb0ac as part of #15319. Ideally we would've followed that up with a removal of crate_id itself as well, but that didn't happen; this PR finally marks it as deprecated at least. Fixes https://github.com/rust-lang/rust/issues/43142 and resolves https://github.com/rust-lang/rust/issues/43144.
2019-09-15Rollup merge of #64463 - petrochenkov:expectattr, r=CentrilMazdak Farrokhzad-4/+4
resolve: Tweak some expected/found wording
2019-09-15Rollup merge of #64457 - petrochenkov:macunfield, r=matthewjasperMazdak Farrokhzad-0/+9
def_collector: Do not ICE on attributes on unnamed fields The primary issue here is that the expansion infra needs to visit a field in isolation, and fields don't know their own indices during expansion, so they have to be kept in some other place (e.g. `struct Definitions`). Fixes https://github.com/rust-lang/rust/issues/64385