about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-05-02Suggest constraint on `impl Trait` in return typeEsteban Küber-0/+53
Fix #71035.
2020-05-02Point at associated types when they have a default typeEsteban Küber-19/+20
Associated types with a default type in a trait can't be relied upon to remain of that default type when in use, so literals of that type can't be used in the trait's items. Point at the associated type and state that information. Reduce verbosity for associated consts of the wrong type.
2020-05-02When a projection is expected, suggest constraining or calling methodEsteban Küber-41/+68
2020-05-02On type mismatch involving associated type, suggest constraintEsteban Küber-56/+335
When an associated type is found when a specific type was expected, if possible provide a structured suggestion constraining the associated type in a bound. ``` error[E0271]: type mismatch resolving `<T as Foo>::Y == i32` --> $DIR/associated-types-multiple-types-one-trait.rs:13:5 | LL | want_y(t); | ^^^^^^ expected `i32`, found associated type ... LL | fn want_y<T:Foo<Y=i32>>(t: &T) { } | ----- required by this bound in `want_y` | = note: expected type `i32` found associated type `<T as Foo>::Y` help: consider constraining the associated type `<T as Foo>::Y` to `i32` | LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T) | ^^^^^^^^^ ``` ``` error[E0308]: mismatched types --> $DIR/trait-with-missing-associated-type-restriction.rs:12:9 | LL | qux(x.func()) | ^^^^^^^^ expected `usize`, found associated type | = note: expected type `usize` found associated type `<impl Trait as Trait>::A` help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize` | LL | fn foo(x: impl Trait<A = usize>) { | ^^^^^^^^^^ ```
2020-05-03Add more tests for cfg(version)mibac138-3/+52
2020-05-03Change cfg(version) error message wordingmibac138-6/+9
2020-05-03Implement RFC 2523, `#[cfg(version(..))]`mibac138-0/+121
2020-05-02Test associated const default qualifs cross-crateDylan MacKenzie-3/+41
This also tests for the ICE in #71734
2020-05-02Auto merge of #69274 - LeSeulArtichaut:target-feature-11, r=hanna-kruppebors-12/+286
Implement RFC 2396: `#[target_feature]` 1.1 Tracking issue: #69098 r? @nikomatsakis cc @gnzlbg @joshtriplett
2020-05-02Do not try to find binop method on RHS `TyErr`Esteban Küber-0/+27
Fix #71798.
2020-05-03Implement `confusable_idents` lint.Charles Lew-0/+26
2020-05-02Add long error explanation for E0539unexge-1/+2
2020-05-02typeck: always expose explicit enum discriminant `AnonConst`s' parent in ↵Eduard-Mihai Burtescu-0/+79
`generics_of`.
2020-05-02fix miri-unleash delayed sanity checkingRalf Jung-9/+7
2020-05-02make sure the miri-unleash-flag is not used to circumvent feature gatesRalf Jung-17/+10
2020-05-02Report cannot move errors in promoted MIRMatthew Jasper-0/+51
2020-05-02Rollup merge of #71782 - cuviper:leave-dev-null-alone, r=Mark-SimulacrumRalf Jung-4/+8
Use a non-existent test path instead of clobbering /dev/null Fixes #71502. r? @Mark-Simulacrum
2020-05-02Rollup merge of #71781 - estebank:box-pin-test, r=tmandryRalf Jung-16/+95
Uncomment test code for failure to use `Box::pin` Close #69083.
2020-05-02Added MIR constant propagation of Scalars into function call argumentsFélix Fischer-5/+30
- Documented rationale of current solution - Polished documentation
2020-05-02Replace convenient function `remove_prefix()` with `replace_prefix()`Donough Liu-2/+0
2020-05-02Suggestion for immutable reference -> mutable pointer should be emittedDonough Liu-2/+1
as `Applicability::Unspecified`
2020-05-02Suggest deref when coercing `ty::Ref` to `ty::RawPtr` with arbitraryDonough Liu-2/+224
mutability
2020-05-02Auto merge of #71716 - alexcrichton:bitcode-follow-up, r=nnethercotebors-2/+2
Rename `bitcode-in-rlib` option to `embed-bitcode` This commit finishes work first pioneered in #70458 and started in #71528. The `-C bitcode-in-rlib` option, which has not yet reached stable, is renamed to `-C embed-bitcode` since that more accurately reflects what it does now anyway. Various tests and such are updated along the way as well. This'll also need to be backported to the beta channel to ensure we don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-05-01SipHasher::new() is literally with SipHasher with both keys being 0Hanif Bin Ariffin-3/+3
2020-05-01Correction: ignore emscripten in process termination testsMohsen Zohrevandi-2/+2
2020-05-01Uncomment test code for failure to use `Box::pin`Esteban Küber-16/+95
Close #69083.
2020-05-01Use a non-existent test path instead of clobbering /dev/nullJosh Stone-4/+8
2020-05-01Rollup merge of #71018 - lcnr:custom-const-param, r=eddybDylan DPC-0/+53
handle ConstValue::ByRef in relate fixes #68615 r? @eddyb
2020-05-01Rename `bitcode-in-rlib` option to `embed-bitcode`Alex Crichton-2/+2
This commit finishes work first pioneered in #70458 and started in #71528. The `-C bitcode-in-rlib` option, which has not yet reached stable, is renamed to `-C embed-bitcode` since that more accurately reflects what it does now anyway. Various tests and such are updated along the way as well. This'll also need to be backported to the beta channel to ensure we don't accidentally stabilize `-Cbitcode-in-rlib` as well.
2020-05-01Name test appropriately and link to the issues it regress-checks forOliver Scherer-0/+5
2020-05-01Add new tests and bless old testsLeSeulArtichaut-12/+286
2020-05-01Move recursion check for zsts back to read site instead of access check site.Oliver Scherer-0/+27
2020-05-01Update stderrs.jumbatm-75/+75
2020-05-01Partially unrevert #70566.jumbatm-111/+128
This partially reverts commit 4b5b6cbe60a8dd1822cfa46c41cf1ad58c113e18, reversing some changes made to 62b362472dbf8bdf43b252ac5ea53b527a8dbee3.
2020-05-01rename InvalidIntPtrUsageRalf Jung-4/+4
2020-05-01bless youRalf Jung-2/+2
2020-05-01Auto merge of #70674 - cjgillot:query-arena-all, r=matthewjasperbors-1/+1
Have the per-query caches store the results on arenas This PR leverages the cache for each query to serve as storage area for the query results. It introduces a new cache `ArenaCache`, which moves the result to an arena, and only stores the reference in the hash map. This allows to remove a sizeable part of the usage of the global `TyCtxt` arena. I only migrated queries that already used arenas before.
2020-04-30Test for zero-sized function items not ICEingJubilee Young-0/+40
2020-04-30Rollup merge of #71688 - ecstatic-morse:const-downcast, r=oli-obkTyler Mandry-29/+4
Allow `Downcast` projections unconditionally in const-checking `ProjectionElem::Downcast` sounds scary, but it's really just the projection we use to access a particular enum variant. They usually appear in the lowering of a `match` statement, so they have been associated with control flow in const-checking, but they don't do any control flow by themselves. We already have a HIR pass that looks for `if` and `match` (even ones that have 1 or fewer reachable branches). That pass is double-checked by a MIR pass that looks for `SwitchInt`s and `FakeRead`s for match scrutinees. In my opinion, there's no need to look for `Downcast` as well. r? @oli-obk
2020-04-30Rollup merge of #71590 - RalfJung:mir-dump-pointers, r=oli-obkTyler Mandry-73/+74
MIR dump: print pointers consistently with Miri output This makes MIR allocation dump pointer printing consistent with Miri output: both use hexadecimal offsets with a `0x` prefix. To save some space, MIR dump replaces the `alloc` prefix by `a` when necessary. I also made AllocId/Pointer printing more consistent in their Debug/Display handling, and adjusted Display printing for Scalar a bit to avoid using decimal printing when we do not know the sign with which to interpret the value (IMO using decimal then is misleading).
2020-04-30Rollup merge of #71465 - oli-obk:is_thread_local_cleanup, r=matthewjasperTyler Mandry-1/+1
Add a convenience method on `TyCtxt` for checking for thread locals This PR extracts the cleanup part of #71192 r? @bjorn3
2020-04-30Rollup merge of #71597 - CohenArthur:refactor-unique-empty, r=shepmasterDylan DPC-2/+2
Rename Unique::empty() -> Unique::dangling() A `FIXME` comment in `src/libcore/ptr/unique.rs` suggested refactoring `Unique::empty()` to `Unique::dangling()` which this PR does.
2020-04-30Rollup merge of #71433 - antoyo:error/missing-right-operand, r=Dylan-DPCDylan DPC-0/+2
Add help message for missing right operand in condition closes #30035
2020-04-30Rollup merge of #70950 - nikomatsakis:leak-check-nll-2, r=matthewjasperDylan DPC-171/+276
extend NLL checker to understand `'empty` combined with universes This PR extends the NLL region checker to understand `'empty` combined with universes. In particular, it means that the NLL region checker no longer considers `exists<R2> { forall<R1> { R1: R2 } }` to be provable. This is work towards https://github.com/rust-lang/rust/issues/59490, but we're not all the way there. One thing in particular it does not address is error messages. The modifications to the NLL region inference code turned out to be simpler than expected. The main change is to require that if `R1: R2` then `universe(R1) <= universe(R2)`. This constraint follows from the region lattice (shown below), because we assume then that `R2` is "at least" `empty(Universe(R2))`, and hence if `R1: R2` (i.e., `R1 >= R2` on the lattice) then `R1` must be in some universe that can name `'empty(Universe(R2))`, which requires that `Universe(R1) <= Universe(R2)`. ``` static ----------+-----...------+ (greatest) | | | early-bound and | | free regions | | | | | scope regions | | | | | empty(root) placeholder(U1) | | / | | / placeholder(Un) empty(U1) -- / | / ... / | / empty(Un) -------- (smallest) ``` I also made what turned out to be a somewhat unrelated change to add a special region to represent `'empty(U0)`, which we use (somewhat hackily) to indicate well-formedness checks in some parts of the compiler. This fixes #68550. I did some investigation into fixing the error message situation. That's a bit trickier: the existing "nice region error" code around placeholders relies on having better error tracing than NLL currently provides, so that it knows (e.g.) that the constraint arose from applying a trait impl and things like that. I feel like I was hoping *not* to do such fine-grained tracing in NLL, and it seems like we...largely...got away with that. I'm not sure yet if we'll have to add more tracing information or if there is some sort of alternative. It's worth pointing out though that I've not kind of shifted my opinion on whose job it should be to enforce lifetimes: I tend to think we ought to be moving back towards *something like* the leak-check (just not the one we *had*). If we took that approach, it would actually resolve this aspect of the error message problem, because we would be resolving 'higher-ranked errors' in the trait solver itself, and hence we wouldn't have to thread as much causal information back to the region checker. I think it would also help us with removing the leak check while not breaking some of the existing crates out there. Regardless, I think it's worth landing this change, because it was relatively simple and it aligns the set of programs that NLL accepts with those that are accepted by the main region checker, and hence should at least *help* us in migration (though I guess we still also have to resolve the existing crates that rely on leak check for coherence). r? @matthewjasper
2020-04-30deduplicate warningsRalf Jung-226/+234
2020-04-30remove no longer needed feature flagsRalf Jung-42/+128
2020-04-30handle ByRef in relateBastian Kauschke-0/+53
2020-04-30A test now fails during check instead of buildOliver Scherer-1/+1
2020-04-30Remove ignored type alias testMark Rousskov-14/+0
This is tracked by a GH issue 17164, and having an ignored test for it isn't helpful.
2020-04-30Remove unsized enum testMark Rousskov-13/+0
This was already tested (at least) by src/test/ui/unsized/unsized-enum2.rs