about summary refs log tree commit diff
path: root/src/test/ui/object-safety
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-882/+0
2022-12-30Regression test for issue 106247Gary Guo-0/+9
2022-12-05Point at GAT where clause when unsatisfiedMichael Goulet-3/+3
2022-10-13Sort elaborated existential predicates in object_ty_for_traitMichael Goulet-0/+25
2022-10-09Elaborate trait ref to compute object safety.Camille GILLOT-0/+58
2022-10-07Check WhereClauseReferencesSelf after all other object safety checksMichael Goulet-0/+46
2022-08-30Tweak WellFormedLocs a bitMichael Goulet-18/+18
2022-08-18Reword "Required because of the requirements on the impl of ..."Andy Wang-9/+9
2022-06-28Migrate some rustc_borrowck diagnostics to SessionDiagnosticMichael Goulet-3/+3
2022-04-26Move some tests to more reasonable placesCaio-0/+57
2021-09-25Use larger span for adjustments on method callsAaron Hill-1/+1
Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely.
2021-09-15Move object safety suggestions to the end of the errorEsteban Kuber-10/+10
2021-08-11Modify structured suggestion outputEsteban Küber-16/+4
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2020-10-20review commentsEsteban Küber-22/+22
2020-10-20Tweak "object unsafe" errorsEsteban Küber-91/+142
Fix #77598.
2020-10-06Check associated type bounds for object safety violationsMatthew Jasper-0/+26
2020-09-02pretty: trim paths of unique symbolsDan Aloni-9/+9
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-02-03Change wording for object unsafe because of assoc constEsteban Küber-2/+2
2020-02-02Point at reason in object unsafe trait with `Self` in supertraits or ↵Esteban Küber-4/+10
`where`-clause
2020-02-02Use more appropriate spans on object unsafe traits and provide structured ↵Esteban Küber-6/+12
suggestions when possible
2020-02-02Wording changes to object unsafe trait errorsEsteban Küber-18/+68
Stemming from the thread at https://twitter.com/indygreg/status/1223279056398929920
2020-02-02Slight rewording of diagnostic messageEsteban Küber-4/+4
2020-02-02Point at the `Sized` obligation in `where` clausesEsteban Küber-3/+6
2020-02-02Tweak `Self: Sized` restriction diagnostic outputEsteban Küber-3/+0
2020-02-02Point at `Sized` boundEsteban Küber-0/+6
2020-02-02Point at arguments or output when fn obligations come from them, or ident ↵Esteban Küber-16/+16
when they don't
2019-10-22RFC 2027: "first draft" of implementationMathias Blikstad-25/+183
These are a squashed series of commits.
2019-09-02account for DUMMY_SP and correct wordingEsteban Küber-2/+2
2019-09-02On object safety violation, point at source when possibleEsteban Küber-12/+18
2019-09-02Refer to "`self` type" instead of "receiver type"Esteban Küber-1/+1
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-2/+2
2019-05-29Update ui test suite to use dynmemoryruins-52/+52
2019-04-22update tests for migrate mode by defaultMatthew Jasper-11/+2
2019-03-11Update NLL testsVadim Petrochenkov-1/+1
2019-03-11Update testsVadim Petrochenkov-1/+1
2018-12-25Remove licensesMark Rousskov-122/+12
2018-11-07Removed `#[rustc_error]` from tests that are all `// compile-pass`.Felix S. Klock II-24/+6
I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+527