about summary refs log tree commit diff
path: root/src/test/ui/regions
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-8428/+0
2023-01-09Auto merge of #101947 - aliemjay:astconv-normalize, r=lcnrbors-9/+9
Don't normalize in AstConv See individual commits. Fixes #101350 Fixes #54940
2023-01-08Don't store spans in assumed_wf_types actuallyMichael Goulet-1/+17
2023-01-08Normalize assumed_wf_types after wfchecking is complete, for better spansMichael Goulet-2/+2
2023-01-08Improve spans of non-WF implied bound typesMichael Goulet-19/+3
2023-01-07make ascribe_user_type a TypeOpAli MJ Al-Nasrawy-9/+9
Projection types in user annotations may contain inference variables. This makes the normalization depend on the unification with the actual type and thus requires a separate TypeOp to track the obligations. Otherwise simply calling `TypeChecker::normalize` would ICE with "unexpected ambiguity"
2022-12-19Revert "Replace usage of `ResumeTy` in async lowering with `Context`"Andrew Pollack-14/+10
2022-12-08Rollup merge of #104922 - estebank:fur-elize, r=oli-obkMatthias Krüger-2/+4
Detect long types in E0308 and write them to disk On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-12-06Replace usage of `ResumeTy` in async lowering with `Context`Arpad Borsos-10/+14
Replaces using `ResumeTy` / `get_context` in favor of using `&'static mut Context<'_>`. Usage of the `'static` lifetime here is technically "cheating", and replaces the raw pointer in `ResumeTy` and the `get_context` fn that pulls the correct lifetimes out of thin air.
2022-11-28Detect long types in E0308 and write them to diskEsteban Küber-2/+4
On type error with long types, print an abridged type and write the full type to disk. Print the widest possible short type while still fitting in the terminal.
2022-11-12Move testsCaio-0/+24
2022-10-20Update tests to match error message changesb4den-2/+2
2022-10-08Rollup merge of #102514 - b-naber:binder-print-fixes, r=jackh726Michael Howell-0/+20
Don't repeat lifetime names from outer binder in print Fixes https://github.com/rust-lang/rust/issues/102392 Fixes https://github.com/rust-lang/rust/issues/102414 r? ```@lcnr```
2022-10-01bless ui testsMaybe Waffle-1/+1
2022-09-30bless testsb-naber-0/+20
2022-09-28add testb-naber-0/+34
2022-09-26address reviewb-naber-8/+8
2022-09-26bless testsb-naber-4/+28
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-25use a minimized exampleTakayuki Maeda-31/+14
2022-08-24do not suggest adding a bound to a opaque typeTakayuki Maeda-0/+43
2022-08-22Auto merge of #100676 - lcnr:implied-bounds-yay, r=nikomatsakisbors-2/+18
implied bounds: explicitly state which types are assumed to be wf Adds a new query which maps each definition to the types which that definition assumes to be well formed. The intent is to make it easier to reason about implied bounds. This change should not influence the user-facing behavior of rustc. Notably, `borrowck` still only assumes that the function signature of associated functions is well formed while `wfcheck` assumes that the both the function signature and the impl trait ref is well formed. Not sure if that by itself can trigger UB or whether it's just annoying. As a next step, we can add `WellFormed` predicates to `predicates_of` of these items and can stop adding the wf bounds at each place which uses them. I also intend to move the computation from `assumed_wf_types` to `implied_bounds` into the `param_env` computation. This requires me to take a deeper look at `compare_predicate_entailment` which is currently somewhat weird wrt implied bounds so I am not touching this here. r? `@nikomatsakis`
2022-08-17ty::Error does not match other types for region constraintsMichael Goulet-0/+28
2022-08-17implied_bounds: clarify our assumptionslcnr-2/+18
2022-07-15provide `generic_param_scope` for region errorslcnr-34/+1
2022-07-14bless testsAli MJ Al-Nasrawy-21/+6
2022-07-14Make outlives::{components,verify} agreeAli MJ Al-Nasrawy-0/+77
2022-06-15tests H.R. `T: 'a` bounds proving themselvesNiko Matsakis-0/+41
2022-06-03Fully stabilize NLLJack Huey-2332/+196
2022-06-03Use the same message as type & const generics.Camille GILLOT-5/+5
2022-06-03Do not lower generic lifetime params when AST resolution emitted an error.Camille GILLOT-12/+2
2022-06-02Bless tests.Camille GILLOT-6/+17
2022-05-22Do leak check after function ptr coercionJack Huey-160/+41
2022-04-30Bless tests.Camille GILLOT-111/+227
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-0/+36
2022-04-25Recover most `impl Trait` and `dyn Trait` lifetime bound suggestions under NLLmarmeladema-0/+50
2022-04-24Use revisions instead of nll compare mode for `/regions/` ui testsmarmeladema-470/+743
2022-04-24Bless testsmarmeladema-51/+65
2022-04-17Bless tests.Camille GILLOT-52/+65
2022-04-04Format invariance notes with backticksMichael Goulet-25/+25
2022-03-28Remove duplicated and unused test filesCaio-67/+0
2022-02-24Remove in-band lifetimesMichael Goulet-34/+0
2022-02-15Overhaul `RegionKind` and `Region`.Nicholas Nethercote-2/+2
Specifically, change `Region` from this: ``` pub type Region<'tcx> = &'tcx RegionKind; ``` to this: ``` pub struct Region<'tcx>(&'tcx Interned<RegionKind>); ``` This now matches `Ty` and `Predicate` more closely. Things to note - Regions have always been interned, but we haven't been using pointer-based `Eq` and `Hash`. This is now happening. - I chose to impl `Deref` for `Region` because it makes pattern matching a lot nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`. - Various methods are moved from `RegionKind` to `Region`. - There is a lot of tedious sigil changes. - A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`. - A couple of test outputs change slightly, I'm not sure why, but the new outputs are a little better.
2021-12-31Ensure that early-bound function lifetimes are always 'local'Aaron Hill-22/+16
During borrowchecking, we treat any free (early-bound) regions on the 'defining type' as `RegionClassification::External`. According to the doc comments, we should only have 'external' regions when checking a closure/generator. However, a plain function can also have some if its regions be considered 'early bound' - this occurs when the region is constrained by an argument, appears in a `where` clause, or in an opaque type. This was causing us to incorrectly mark these regions as 'external', which caused some diagnostic code to act as if we were referring to a 'parent' region from inside a closure. This PR marks all instantiated region variables as 'local' when we're borrow-checking something other than a closure/generator/inline-const.
2021-12-29Refactor variance diagnostics to work with more typesAaron Hill-0/+35
Instead of special-casing mutable pointers/references, we now support general generic types (currently, we handle `ty::Ref`, `ty::RawPtr`, and `ty::Adt`) When a `ty::Adt` is involved, we show an additional note explaining which of the type's generic parameters is invariant (e.g. the `T` in `Cell<T>`). Currently, we don't explain *why* a particular generic parameter ends up becoming invariant. In the general case, this could require printing a long 'backtrace' of types, so doing this would be more suitable for a follow-up PR. We still only handle the case where our variance switches to `ty::Invariant`.
2021-12-11Auto merge of #91769 - estebank:type-trait-bound-span-2, r=oli-obkbors-6/+6
Tweak assoc type obligation spans * Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors r? `@oli-obk` This is a(n uncontroversial) subset of #85799.
2021-12-11Tweak assoc type obligation spansEsteban Kuber-6/+6
* Point at RHS of associated type in obligation span * Point at `impl` assoc type on projection error * Reduce verbosity of recursive obligations * Point at source of binding lifetime obligation * Tweak "required bound" note * Tweak "expected... found opaque (return) type" labels * Point at set type in impl assoc type WF errors
2021-12-10fix tests after rebaseEsteban Kuber-2/+2
2021-12-10Tweak wordingEsteban Kuber-7/+7
2021-12-10Use a more accurate `Span` for `'static` obligation from return typeEsteban Kuber-10/+10