about summary refs log tree commit diff
path: root/src/test/ui/marker_trait_attr
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-479/+0
2022-10-27add tests and slight formattingRageking8-4/+56
2022-10-01bless ui testsMaybe Waffle-1/+1
2022-07-15passes: migrate half of `check_attr`David Wood-12/+12
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
2022-07-01Auto merge of #98781 - GuillaumeGomez:rollup-798kb8u, r=GuillaumeGomezbors-4/+4
Rollup of 5 pull requests Successful merges: - #97249 (`<details>`/`<summary>` UI fixes) - #98418 (Allow macOS to build LLVM as shared library) - #98460 (Use CSS variables to handle theming) - #98497 (Improve some inference diagnostics) - #98708 (rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests) Failed merges: - #98761 (more `need_type_info` improvements) r? `@ghost` `@rustbot` modify labels: rollup
2022-07-01Don't point at Self type if we can't find an infer variable in ambiguous ↵Michael Goulet-4/+4
trait predicate
2022-07-01Shorten def_span for more items.Camille GILLOT-4/+4
2021-11-20Point at source of trait bound obligations in more placesEsteban Kuber-10/+0
Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). Address part of #89418.
2021-11-06Move some tests to more reasonable directoriesCaio-0/+58
2021-10-24Point at overlapping impls when type annotations are neededEsteban Kuber-2/+14
2021-08-18marker_traits: require `EvaluatedToOk`lcnr-0/+83
2021-08-16Use note to point at bound introducing requirementEsteban Küber-3/+6
2020-08-22Use smaller def span for functionsAaron Hill-1/+1
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-04-08Small tweaks to required bound spanEsteban Küber-1/+1
2020-01-09Don't discard marker trait impls when inference variables are presentAaron Hill-0/+17
Fixes #61651 Previously, we would unconditionally discard impl candidates for marker traits during trait selection. However, if the predicate had inference variables, this could have the effect of constrainting inference variables (due to a successful trait selection) when we would have otherwise failed due to mutliple applicable impls, This commit prevents marker trait impls from being discarded while the obligation predicate has any inference variables, ensuring that discarding impls will never cause us to incorrectly constraint inference variables.
2019-09-22Point at type param when it's cause of unfulfilled obligationEsteban Küber-2/+2
2019-09-22On obligation errors point at the unfulfilled binding when possibleEsteban Küber-1/+1
2019-08-31Use span label instead of note for cause in E0631Esteban Küber-6/+3
2019-05-25Reword malformed attribute input diagnosticsEsteban Küber-14/+11
- Handle empty `cfg_attr` attribute - Reword empty `derive` attribute error - Use consistend error message: "malformed `attrname` attribute input" - Provide suggestions when possible - Move note/help to label/suggestion - Use consistent wording "ill-formed" -> "malformed" - Move diagnostic logic out of parser
2019-03-11Update testsVadim Petrochenkov-7/+7
2019-02-25Stabilize `unrestricted_attribute_tokens`Vadim Petrochenkov-9/+8
2019-01-13Implement basic input validation for built-in attributesVadim Petrochenkov-8/+8
2018-12-25Remove licensesMark Rousskov-69/+19
2018-09-19Improve error checking and reportingScott McMurray-6/+138
- Check for valid attributes more reliably - Don't bloat the error index for boring errors - Do use real error codes for the interesting ones
2018-09-19Enforce that #[marker] traits cannot have associated itemsScott McMurray-0/+88
2018-09-19Require that marker impls are empty, but allow them to overlapScott McMurray-0/+101