about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-06-10Fix pprust-expr-roundtripAaron Hill-2/+2
2020-06-10Track span of function in method calls, and use this in #[track_caller]Aaron Hill-0/+28
Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
2020-06-10Rollup merge of #73122 - doctorn:issue-73116, r=varkorDylan DPC-2/+2
Resolve E0584 conflict Adds a new error code (`E0761`) to indicate ambiguity in module file names and an accompanying expanded description to resolve a conflict over `E0584`. Resolves #73116
2020-06-09Auto merge of #73153 - ecstatic-morse:revert-71956, r=tmandrybors-2/+44
Revert #71956 ...since it caused unsoundness in #73137. Also adds a reduced version of #73137 to the test suite. The addition of the `MaybeInitializedLocals` dataflow analysis has not been reverted, but it is no longer used. Presumably there is a more targeted fix, but I'm worried that other bugs may be lurking. I'm not yet sure what the root cause of #73137 is. This will need to get backported to beta. r? @tmandry
2020-06-08Add regression test for #73137Dylan MacKenzie-0/+42
Co-authored-by: Aaron1011 <aa1ronham@gmail.com>
2020-06-08Revert #71956Dylan MacKenzie-2/+2
2020-06-08Rollup merge of #72912 - GuillaumeGomez:add-e0755, r=estebankDylan DPC-0/+20
Add new E0758 error code
2020-06-08Resolve E0584 conflictNathan Corbyn-2/+2
2020-06-08Rollup merge of #73001 - ilya-bobyr:master, r=dtolnayRalf Jung-1/+10
Free `default()` forwarding to `Default::default()` It feels a bit redundant to have to say `Default::default()` every time I need a new value of a type that has a `Default` instance. Especially so, compared to Haskell, where the same functionality is called `def`. Providing a free `default()` function that forwards to `Default::default()` seems to improve the situation. The trait is still there, so if someone wants to be explicit and to say `Default::default()` - it still works, but if imported as `std::default::default;`, then the free function reduces typing and visual noise.
2020-06-08Rollup merge of #72799 - Aaron1011:feature/span-debug, r=petrochenkovRalf Jung-0/+207
Add `-Z span-debug` to allow for easier debugging of proc macros Currently, the `Debug` impl for `proc_macro::Span` just prints out the byte range. This can make debugging proc macros (either as a crate author or as a compiler developer) very frustrating, since neither the actual filename nor the `SyntaxContext` is displayed. This commit adds a perma-unstable flag `-Z span-debug`. When enabled, the `Debug` impl for `proc_macro::Span` simply forwards directly to `rustc_span::Span`. Once #72618 is merged, this will start displaying actual line numbers. While `Debug` impls are not subject to Rust's normal stability guarnatees, we probably shouldn't expose any additional information on stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise, we would be providing a 'backdoor' way to access information that's supposed be behind unstable APIs.
2020-06-08Rollup merge of #72026 - botika:master, r=estebankRalf Jung-1/+108
Update annotate-snippets-rs to 0.8.0 #59346 I made major changes to this library. In the previous version we worked with owned while in the current one with borrowed. I have adapted it without changing the behavior. I have modified the coverage since the previous one did not return correctly the index of the character in the line.
2020-06-08Auto merge of #73046 - marmeladema:save-analysis-fix-path, r=Xanewokbors-0/+27
save_analysis: fix some ICEs Fixes #73020 Fixes #73022 Fixes #73041
2020-06-07Auto merge of #72904 - shepmaster:reduce-abi-symbol-hash-churn, ↵bors-12/+12
r=jonas-schievink,RalfJung Order the Rust and C ABIs first to reduce test churn
2020-06-07Auto merge of #73099 - Dylan-DPC:rollup-7u8f3m4, r=Dylan-DPCbors-41/+140
Rollup of 2 pull requests Successful merges: - #72952 (run-make regression test for issue #70924.) - #72977 (Fix codegen tests for RISC-V) Failed merges: r? @ghost
2020-06-07Rollup merge of #72977 - tblah:riscv-codegen-llvm10, r=nikomatsakisDylan DPC-41/+93
Fix codegen tests for RISC-V Some codegen tests didn't seem relevant (e.g. unsupported annotations). The RISC-V abi tests were broken by LLVM 10, c872dcf fixes that (cc: @msizanoen1) I'm not sure about skipping catch-unwind.rs and included that change here mostly as a request for comment - I can't tell if that's a bug.
2020-06-07Rollup merge of #72952 - pnkfelix:regression-test-for-issue-70924, ↵Dylan DPC-0/+47
r=nikomatsakis run-make regression test for issue #70924. Sometime after my PR #72767 (to fix issue #70924) landed, I realized that I *could* make a local regression test, thanks to `rustc --print sysroot`: I can make a fresh "copy" (really mostly symlinks) of the sysroot, and then modify it to recreate the terms of this bug.
2020-06-07Add tests for E0758Guillaume Gomez-0/+20
2020-06-07Free `default()` forwarding to `Default::default()`Ilya Bobyr-1/+10
When creating default values a trait method needs to be called with an explicit trait name. `Default::default()` seems redundant. A free function on the other hand, when imported directly, seems to be a better API, as it is just `default()`. When implementing the trait, a method is still required.
2020-06-07rename FalseEdges -> FalseEdgeRalf Jung-31/+31
2020-06-06Order the Rust and C ABIs first to reduce test churnJake Goulding-12/+12
2020-06-07Rollup merge of #72989 - pnkfelix:revert-pr-71840, r=matthewjasperDylan DPC-841/+995
Revert pr 71840 Revert7 PR #71840 to fix issue #72470 This will need a backport to beta if we do not want #72470 to hit stable.
2020-06-06save_analysis: fix panic in `write_sub_paths_truncated`marmeladema-0/+14
2020-06-06Auto merge of #72927 - petrochenkov:rustc, r=Mark-Simulacrumbors-42/+41
Rename all remaining compiler crates to use the `rustc_foo` pattern libarena -> librustc_arena libfmt_macros -> librustc_parse_format libgraphviz -> librustc_graphviz libserialize -> librustc_serialize Closes https://github.com/rust-lang/rust/issues/71177 in particular.
2020-06-06save_analysis: fix ice in `get_expr_data`marmeladema-0/+13
2020-06-05Auto merge of #72982 - tblah:riscv-ui-tests, r=estebankbors-65/+83
resolve: Sort E0408 errors by Symbol str This is a request for comments implementing my suggested solution to https://github.com/rust-lang/rust/issues/72913 Previously errors were sorted by Symbol index instead of the string. The indexes are not the same between architectures because Symbols for architecture extensions (e.g. x86 AVX or RISC-V d) are interned before the source file is parsed. RISC-V's naming of extensions after single letters led to it having errors sorted differently for test cases using single letter variable names. Instead sort the errors by the Symbol string so that it is stable across architectures. While I was at it, there's also 8edb05c2 skipping some ui tests which I think are irrelevant for risc-v.
2020-06-05Ignore windows in the test.Felix S. Klock II-0/+5
2020-06-05Rollup merge of #73019 - matthiaskrgr:test_72960, r=XanewokDylan DPC-1/+3
add test for #72960 Fixes #72960 r? @Xanewok
2020-06-05Rollup merge of #72260 - csmoe:issue-69276, r=estebankDylan DPC-4/+6
Spell out `Self` in async function return Closes #69276 r? @tmandry
2020-06-05add test for #72960Matthias Krüger-1/+3
Fixes #72960
2020-06-04Add `-Z span-debug` to allow for easier debugging of proc macrosAaron Hill-0/+207
Currently, the `Debug` impl for `proc_macro::Span` just prints out the byte range. This can make debugging proc macros (either as a crate author or as a compiler developer) very frustrating, since neither the actual filename nor the `SyntaxContext` is displayed. This commit adds a perma-unstable flag `-Z span-debug`. When enabled, the `Debug` impl for `proc_macro::Span` simply forwards directly to `rustc_span::Span`. Once #72618 is merged, this will start displaying actual line numbers. While `Debug` impls are not subject to Rust's normal stability guarnatees, we probably shouldn't expose any additional information on stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise, we would be providing a 'backdoor' way to access information that's supposed be behind unstable APIs.
2020-06-04further bless tests.Felix S. Klock II-19/+19
2020-06-04Revert "Defer creating drop trees in MIR lowering until leaving that scope"Felix S. Klock II-3/+3
This reverts commit 611988551fba1bcbb33ae2e1e0171cb8d2e70d5a.
2020-06-04Revert "Bless mir-opt tests"Felix S. Klock II-819/+973
This reverts commit a030c923412b0a0f7b02a585debe7bf60357370d.
2020-06-04resolve: Sort E0408 errors by Symbol strTom Eccles-23/+23
Previously errors were sorted by Symbol index instead of the string. The indexes are not the same between architectures because Symbols for architecture extensions (e.g. x86 AVX or RISC-V d) are interned before the source file is parsed. RISC-V's naming of extensions after single letters led to it having errors sorted differently for test cases using single letter variable names. Instead sort the errors by the Symbol string so that it is stable across architectures.
2020-06-04test: ui: skip tests which aren't appropriate for RISC-VTom Eccles-42/+60
2020-06-04run-make regression test for issue #70924.Felix S. Klock II-0/+42
2020-06-04test: codegen: skip catch-unwind on riscv64Tom Eccles-0/+9
It isn't clear to me if this is a bug or not, hence the FIXME
2020-06-04test: codegen: Add riscv abi llvm intrinsics testTom Eccles-0/+32
2020-06-04test: codegen: riscv64-abi: print value numbers for unnamed func argsTom Eccles-41/+41
LLVM 10 includes a009a60a917bc30940422bcef73f8270566d78db which will print value numbers for unnamed func args. Update these tests to be in line with the referenced clang tests.
2020-06-04test: codegen: skip tests inappropriate for riscv64Tom Eccles-0/+11
2020-06-04Rollup merge of #72923 - Patryk27:fix/52468, r=estebankDylan DPC-6/+68
Improve E0433, so that it suggests missing imports Closes #52468
2020-06-04Rollup merge of #72718 - estebank:impl-trait-obligation-failure, r=matthewjasperDylan DPC-0/+33
Add regression test for #72554 Fix #72554.
2020-06-04resolve error code e0760csmoe-4/+4
2020-06-03Rollup merge of #72900 - jsgf:no-unused-pathless, r=petrochenkovDylan DPC-0/+12
Don't count pathless --extern for unused-crate-dependencies warnings `--extern proc_macro` is used to add the proc_macro crate to the extern prelude for all procmacros. In general pathless `--extern` only references sysroot/standard libraries and so should be exempt from unused-crate-dependencies warnings. r? @petrochenkov
2020-06-03Auto merge of #70107 - lcnr:issue68977, r=eddybbors-16/+172
WF-check all ty::Const's, not just array lengths. fixes #68977 This PR removes the special case for array length in `wf::compute` and checks the well formedness of all consts. Changes `PredicateKind::WellFormed` to take a `GenericArg` and updates `wf::obligations`.
2020-06-03Rollup merge of #72902 - cuviper:fuse-covariant, r=nikomatsakisDylan DPC-2/+3
Add a test to ensure Fuse stays covariant When #70502 attempted to specialize the data types in `Fuse`, one of the problems we found was that it broke variance. This was also realized when `Fuse` was first added, https://github.com/rust-lang/rust/pull/35656#discussion-diff-74995079, but now this PR adds a test so we don't forget again.
2020-06-03Rollup merge of #72848 - camelid:fix-72815, r=varkorDylan DPC-2/+2
Correct generic parameter ordering in error note for E0747 Fixes #72815. r? @varkor
2020-06-03Rollup merge of #72820 - jonas-schievink:instcombine-uninit, r=oli-obkDylan DPC-4/+17
InstCombine: Don't optimize `&mut *x` into `x` Fixes https://github.com/rust-lang/rust/issues/72797
2020-06-03Update fulldeps tests and clippyVadim Petrochenkov-30/+29
2020-06-02Improve E0433, so that it suggests missing importsPatryk Wychowaniec-6/+68