about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-10-30Auto merge of #65068 - estebank:trait-impl-lt-mismatch, r=nikomatsakisbors-53/+54
Custom lifetime error for `impl` item doesn't conform to `trait` Partly addresses #42706, #41343, fix #40900.
2019-10-29Rollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakisTyler Mandry-0/+21
save-analysis: Account for async desugaring in async fn return types Closes #65590 When visiting the return type of an async function we need to take into account its desugaring, since it introduces a new definition under which the return type is redefined. r? @nikomatsakis
2019-10-29Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichtonTyler Mandry-50/+46
Re-enable Emscripten's exception handling support Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests. r? @alexcrichton
2019-10-29Rollup merge of #65539 - traxys:fix_62334, r=petrochenkovTyler Mandry-13/+24
resolve: Turn the "non-empty glob must import something" error into a lint This fixes #62334 by changing the error to a lint warning the glob. I changed the test but I'm very unsure of what I did as I do not know how to correctly check for the warning
2019-10-29Silence crate external span error in x86 platformsEsteban Küber-1/+3
This causes issues in at least `dist-i586-gnu-i586-i686-musl`, possibly others.
2019-10-29Fix NLL testEsteban Küber-18/+7
2019-10-29Make error apply only to impl/trait mismatchEsteban Küber-6/+17
2019-10-29Point at the trait item and tweak wordingEsteban Küber-12/+21
2019-10-29review commentsEsteban Küber-8/+8
2019-10-29Custom lifetime error for `impl` item doesn't conform to `trait`Esteban Küber-48/+38
2019-10-29save-analysis: Account for async desugaring in async fn return typesIgor Matuszewski-0/+21
2019-10-29Change E0741 into E0742Guillaume Gomez-10/+10
2019-10-29Update ui testsGuillaume Gomez-9/+13
2019-10-29Auto merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcrichtonbors-0/+38
Fix #64153 This PR changes how the compiler detects if an object file from an upstream crate is a Rust object file or not. Instead of checking if the name starts with the crate name and ends with `.o` (which is not always the case, as described in #64153), it now just checks if the filename ends with `.rcgu.o`. This fixes #64153. However, ideally we'd clean up the code around filename generation some more. Then this check could be made more robust. r? @alexcrichton
2019-10-29Rollup merge of #65809 - roblabla:eficall-abi, r=nagisaMazdak Farrokhzad-82/+184
Add new EFIAPI ABI Fixes #54527 Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI. Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?
2019-10-29Rollup merge of #65562 - Patryk27:master, r=estebankMazdak Farrokhzad-39/+39
Improve the "try using a variant of the expected type" hint. Fix https://github.com/rust-lang/rust/issues/65494. - Change type-printing output. - Use `span_to_snippet` when possible. - Change the message to `try using a variant of the expected enum`
2019-10-29Rollup merge of #65318 - estebank:coherence, r=varkorMazdak Farrokhzad-196/+324
Call out the types that are non local on E0117 CC #24745.
2019-10-29Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasperMazdak Farrokhzad-14/+169
Lint ignored `#[inline]` on function prototypes Fixes https://github.com/rust-lang/rust/issues/51280. - Adds a `unused_attribute` lint for `#[inline]` on function prototypes. - As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).
2019-10-29forgot to add the changed stderrQuentin Boyer-6/+6
2019-10-28Rollup merge of #65858 - davidtwco:rfc-2203-feature-gate-in-error, ↵Mazdak Farrokhzad-2/+21
r=ecstatic-morse suggest `const_in_array_repeat_expression` flag This PR adds a suggestion to add the `#![feature(const_in_array_repeat_expression)]` attribute to the crate when a promotable expression is used in a repeat expression and the feature gate is not enabled. Unfortunately, this ended up being a little bit more complex than I anticipated, which may not have been worth it given that this would all be removed when the feature is stabilized. However, with #65732 and #65737 being open, and the feature gate having not been being suggested to potential users, the feature might not be stabilized in a while, so maybe this is worth landing. cc @Centril (addresses [this comment](https://github.com/rust-lang/rust/pull/61749#discussion_r307863857)) r? @ecstatic-morse (opened issues related to RFC 2203 recently)
2019-10-28Rollup merge of #65640 - estebank:recover-missing-semi, r=CentrilMazdak Farrokhzad-50/+51
Use heuristics to recover parsing of missing `;` - Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon. Fix #48160, fix #44767 (after adding note about statements).
2019-10-28Rollup merge of #65563 - GuillaumeGomez:long-err-explanation-E0587, r=Dylan-DPCMazdak Farrokhzad-1/+2
Add long error explanation for E0587 Part of #61137. r? @kinnison
2019-10-28suggest `const_in_array_repeat_expression` flagDavid Wood-2/+21
This commit adds a suggestion to add the `#![feature(const_in_array_repeat_expression)]` attribute to the crate when a promotable expression is used in a repeat expression. Signed-off-by: David Wood <david@davidtw.co>
2019-10-28review commentsEsteban Küber-2/+2
2019-10-28Tweak unexpected token wordingEsteban Küber-36/+37
2019-10-28Use heuristics to recover parsing of missing `;`Esteban Küber-24/+24
- Detect `,` and `:` typos where `;` was intended. - When the next token could have been the start of a new statement, detect a missing semicolon.
2019-10-28Improve pretty-printing for compound qualified paths.Patryk Wychowaniec-2/+2
2019-10-28Fix a previously forgotten pretty-printing test after a change to the ↵Patryk Wychowaniec-1/+1
pretty-printing mechanism.
2019-10-28Improve the "try using a variant of the expected type" hint.Patryk Wychowaniec-40/+40
2019-10-28Do not display ADT type arguments and fix rebaseEsteban Küber-61/+89
2019-10-28Account for tuples in explanationEsteban Küber-23/+23
2019-10-28Talk about specific types and remove lifetimes from outputEsteban Küber-18/+18
2019-10-28Further tweak spans for better readabilityEsteban Küber-16/+16
2019-10-28Use more targeted spans for orphan rule errorsEsteban Küber-176/+272
2019-10-28Call out the types that are non local on E0117Esteban Küber-48/+52
2019-10-28Ignore issue-64153 run-make test on Windows since supporting a Windows ↵Michael Woerister-0/+4
version is not worth the trouble.
2019-10-28Auto merge of #65421 - estebank:variants, r=petrochenkovbors-282/+517
Point at local similarly named element and tweak references to variants Partially address #65386.
2019-10-28Auto merge of #65188 - matthewjasper:stabilize-const-constructor, r=Centrilbors-98/+40
Stabilize `const_constructor` # Stabilization proposal I propose that we stabilize `#![feature(const_constructor)]`. Tracking issue: https://github.com/rust-lang/rust/issues/61456 Version target: 1.40 (2019-11-05 => beta, 2019-12-19 => stable). ## What is stabilized ### User guide Tuple struct and tuple variant constructors are now considered to be constant functions. As such a call expression where the callee has a tuple struct or variant constructor "function item" type can be called: ```rust const fn make_options() { // These already work because they are special cased: Some(0); (Option::Some)(1); // These also work now: let f = Option::Some; f(2); {Option::Some}(3); <Option<_>>::Some(5); } ``` ### Motivation Consistency with other `const fn`. Consistency between syntactic path forms. This should also ensure that constructors implement `const Fn` traits and can be coerced to `const fn` function pointers, if they are introduced. ## Tests * [ui/consts/const_constructor/const-construct-call.rs](https://github.com/rust-lang/rust/blob/0d75ab2293a106eb674ac01860910cfc1580837e/src/test/ui/consts/const_constructor/const-construct-call.rs) - Tests various syntactic forms, use in both `const fn` and `const` items, and constructors in both the current and extern crates. * [ui/consts/const_constructor/const_constructor_qpath.rs](https://github.com/rust-lang/rust/blob/1850dfcdabf8258a1f023f26c2c59e96b869dd95/src/test/ui/consts/const_constructor/const_constructor_qpath.rs) - Tests that type qualified paths to enum variants are also considered to be `const fn`.(#64247) r? @oli-obk Closes #61456 Closes #64247
2019-10-28Rollup merge of #65880 - Nadrieril:gather-usefulness-tests, r=varkorMazdak Farrokhzad-3/+3
Gather together usefulness tests I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder. I found it helpful to have them all in the same place when working on the usefulness algorithm.
2019-10-28Rollup merge of #65664 - anp:panic-location, r=eddybMazdak Farrokhzad-2/+35
`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N) [Tracking issue](https://github.com/rust-lang/rust/issues/47809) [RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md) @eddyb suggested doing this intrinsic implementation ahead of actually implementing the `#[track_caller]` attribute so that there's an easily tested intermediate step between adding the shim and wiring up the attribute.
2019-10-28changing non-empty glob must import something to a lintQuentin Boyer-13/+24
2019-10-27Stabilize `const_constructor`Matthew Jasper-98/+40
2019-10-27Gather together usefulness testsNadrieril-3/+3
I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder.
2019-10-27Implementation of const caller_location.Adam Perry-0/+23
2019-10-27Panicking infra uses &core::panic::Location.Adam Perry-2/+3
This allows us to remove `static_panic_msg` from the SSA<->LLVM boundary, along with its fat pointer representation for &str. Also changes the signature of PanicInfo::internal_contructor to avoid copying. Closes #65856.
2019-10-27Implement core::intrinsics::caller_location.Adam Perry-0/+9
Returns a `&core::panic::Location` corresponding to where it was called, also making `Location` a lang item.
2019-10-27Point at local similarly named element and tweak references to variantsEsteban Küber-282/+517
Point at the span for the definition of ADTs internal to the current crate. Look at the leading char of the ident to determine whether we're expecting a likely fn or any of a fn, a tuple struct or a tuple variant. Turn fn `add_typo_suggestion` into a `Resolver` method.
2019-10-27Rollup merge of #65855 - ObsidianMinor:extended_error/E0666, r=varkorMazdak Farrokhzad-2/+4
Add long error explaination for E0666 In the spirit of the month of spooks, here's a long explanation for E0666 for #61137.
2019-10-27Rollup merge of #65777 - matthewjasper:allow-impl-trait-expansion, r=davidtwcoMazdak Farrokhzad-24/+42
Don't ICE for completely unexpandable `impl Trait` types Save the resolution of these types (to themselves) to the typeck tables so that they will eventually reach E0720. closes #65561
2019-10-27Rollup merge of #65738 - ↵Mazdak Farrokhzad-0/+32
ohadravid:re-rebalance-coherence-allow-fundamental-local, r=nikomatsakis Coherence should allow fundamental types to impl traits when they are local After #64414, `impl<T> Remote for Box<T> { }` is disallowed, but it is also disallowed in liballoc, where `Box` is a local type! Enabling `#![feature(re_rebalance_coherence)]` in `liballoc` results in: ``` error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`) --> src\liballoc\boxed.rs:1098:1 | 1098 | impl<F: ?Sized + Future + Unpin> Future for Box<F> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `F` must be used as the type parameter for some local type ``` This PR relaxes `uncover_fundamental_ty` to skip local fundamental types. I didn't add a test since `liballoc` already fails to compile, but I can add one if needed. r? @nikomatsakis cc #63599