about summary refs log tree commit diff
path: root/tests/ui/higher-ranked
AgeCommit message (Collapse)AuthorLines
2024-02-29Make nll higher ranked equate use bidirectional subtyping in invariant contextSantiago Pastorino-0/+60
2024-02-29Make infer higher ranked equate use bidirectional subtyping in invariant contextSantiago Pastorino-13/+22
2024-02-29distinguish recursion limit based overflow for diagnosticslcnr-1/+0
also change the number of allowed fixpoint steps to be fixed instead of using the `log` of the total recursion depth.
2024-02-26Revert some `span_bug`s to `span_delayed_bug`.Nicholas Nethercote-0/+69
Fixes #121503. Fixes #121597.
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-104/+104
2024-02-09For a rigid projection, recursively look at the self type's item boundsMichael Goulet-56/+2
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-4/+47
2024-02-06Rollup merge of #120507 - estebank:issue-108428, r=davidtwcoMatthias Krüger-0/+12
Account for non-overlapping unmet trait bounds in suggestion When a method not found on a type parameter could have been provided by any of multiple traits, suggest each trait individually, instead of a single suggestion to restrict the type parameter with *all* of them. Before: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` help: consider restricting the type parameters to satisfy the trait bounds | LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord { | +++++++++++++++++++++++++ ``` After: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` = help: items from traits can only be used if the type parameter is bounded by the trait help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them: | LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering { | +++++ LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering { | ++++++++++ ``` Fix #108428. Follow up to #120396, only last commit is relevant.
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-3/+3
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-30Account for non-overlapping unmet trait bounds in suggestionEsteban Küber-0/+12
When a method not found on a type parameter could have been provided by any of multiple traits, suggest each trait individually, instead of a single suggestion to restrict the type parameter with *all* of them. Before: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` help: consider restricting the type parameters to satisfy the trait bounds | LL | fn g<T>(a: T, b: T) -> std::cmp::Ordering where T: Iterator, T: Ord { | +++++++++++++++++++++++++ ``` After: ``` error[E0599]: the method `cmp` exists for reference `&T`, but its trait bounds were not satisfied --> $DIR/method-on-unbounded-type-param.rs:5:10 | LL | (&a).cmp(&b) | ^^^ method cannot be called on `&T` due to unsatisfied trait bounds | = note: the following trait bounds were not satisfied: `T: Ord` which is required by `&T: Ord` `&T: Iterator` which is required by `&mut &T: Iterator` `T: Iterator` which is required by `&mut T: Iterator` = help: items from traits can only be used if the type parameter is bounded by the trait help: the following traits define an item `cmp`, perhaps you need to restrict type parameter `T` with one of them: | LL | fn g<T: Ord>(a: T, b: T) -> std::cmp::Ordering { | +++++ LL | fn g<T: Iterator>(a: T, b: T) -> std::cmp::Ordering { | ++++++++++ ``` Fix #108428.
2024-01-30Rollup merge of #120293 - estebank:issue-102629, r=nnethercoteGuillaume Gomez-4/+4
Deduplicate more sized errors on call exprs Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-26Use single label for method not found due to unmet boundEsteban Küber-8/+2
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-4/+4
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-16borrowck: wf-check fn item argsAli MJ Al-Nasrawy-1/+11
2024-01-13Bless testsGeorge-lewis-0/+2
Update tests
2024-01-09Auto merge of #118968 - aliemjay:canon-static, r=lcnrbors-2/+2
unify query canonicalization mode Exclude from canonicalization only the static lifetimes that appear in the param env because of #118965 . Any other occurrence can be canonicalized safely AFAICT. r? `@lcnr`
2023-12-22Auto merge of #118824 - aliemjay:perf-region-cons, r=compiler-errorsbors-2/+2
use Vec for region constraints instead of BTreeMap ~1% perf gain Diagnostic regressions need more investigation. r? `@ghost`
2023-12-21Simple modification of diagnostic informationsurechen-22/+22
fixes #119067
2023-12-17fix diagnostic regresssionAli MJ Al-Nasrawy-11/+5
2023-12-17use Vec for region constraintsAli MJ Al-Nasrawy-7/+13
2023-12-15unify query canonicalization modeAli MJ Al-Nasrawy-2/+2
2023-12-14update use of feature flagslcnr-4/+4
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-6/+6
2023-12-05Add print_trait_sugaredMichael Goulet-8/+8
2023-11-24Manual find replace updatesNilstrieb-1/+1
2023-11-24Show number in error message even for one errorNilstrieb-21/+21
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-16Auto merge of #116097 - jackh726:higher-ranked-lifetime-error-backup, ↵bors-0/+26
r=compiler-errors Try to use approximate placeholder regions when outputting an AscribeUserType error in borrowck Fixes #114866 Hi from GOSIM :)
2023-11-02Pretty print Fn traits in rustc_on_unimplementedMichael Goulet-5/+5
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+2
2023-09-24Try to use approximate placeholder regions when outputting an ↵Jack Huey-0/+26
AscribeUserType error in borrowck
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-15/+15
2023-09-19Explain HRTB + infer limitations of old solverMichael Goulet-0/+21
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+15
2023-08-09Point out expectation even if we have RegionsInsufficientlyPolymorphicMichael Goulet-2/+6
2023-07-29Change default panic handler message format.Mara Bos-1/+1
2023-07-25write-long-types-to-disk: update testsMahdi Dibaiee-4/+2
2023-07-24new unstable option: -Zwrite-long-types-to-diskMahdi Dibaiee-2/+2
This option guards the logic of writing long type names in files and instead using short forms in error messages in rustc_middle/ty/error behind a flag. The main motivation for this change is to disable this behaviour when running ui tests. This logic can be triggered by running tests in a directory that has a long enough path, e.g. /my/very-long-path/where/rust-codebase/exists/ This means ui tests can fail depending on how long the path to their file is. Some ui tests actually rely on this behaviour for their assertions, so for those we enable the flag manually.
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-2/+2
2023-06-25Add test for futures with HRTBdswij-0/+44
2023-06-12Adjust UI tests for `unit_bindings`许杰友 Jieyou Xu (Joe)-1/+1
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
2023-05-30directory size limit :<lcnr-0/+3736
2023-05-30add the leak check to the new solverlcnr-0/+24