about summary refs log tree commit diff
path: root/tests/ui/specialization
AgeCommit message (Collapse)AuthorLines
2025-07-17parse `const trait Trait`Deadbeef-12/+12
2025-07-13Auto merge of #143357 - cjgillot:no-assoc-item-kind, r=compiler-errorsbors-2/+2
Retire hir::*ItemRef. This information was kept for various places that iterate on HIR to know about trait-items and impl-items. This PR replaces them by uses of the `associated_items` query that contain pretty much the same information. This shortens many spans to just `def_span`, which can be easier to read.
2025-07-13Remove hir::AssocItemKind.Camille GILLOT-2/+2
2025-07-11constify `From` and `Into`Oli Scherer-3/+15
2025-07-07Make `Default` const and add some `const Default` implsEsteban Küber-33/+35
Full list of `impl const Default` types: - () - bool - char - Cell - std::ascii::Char - usize - u8 - u16 - u32 - u64 - u128 - i8 - i16 - i32 - i64 - i128 - f16 - f32 - f64 - f128 - std::marker::PhantomData<T> - Option<T> - std::iter::Empty<T> - std::ptr::Alignment - &[T] - &mut [T] - &str - &mut str - String - Vec<T>
2025-06-30Avoid looking at HIR for trait and impl itemsOli Scherer-2/+2
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-14/+14
2025-06-29Fix the span of trait bound modifier `[const]`León Orell Valerian Liehr-12/+12
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-34/+34
2025-06-06Treat normalizing consts like normalizing types in deeply normalizeMichael Goulet-0/+42
2025-04-25handle specialization in the new trait solverlcnr-6/+149
uwu :3
2025-04-03Use `cfg(false)` in UI testsclubby789-1/+1
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-0/+2
2025-03-04Ensure that negative auto impls are always applicableMichael Goulet-23/+41
2025-02-13adjust derive_errorlcnr-0/+62
2025-01-27Remove all dead files inside tests/ui/León Orell Valerian Liehr-72/+0
2025-01-06Normalize each signature input/output in typeck_with_fallback with its own spanMichael Goulet-6/+3
2024-12-15Auto merge of #134258 - bjorn3:no_public_specialization, r=petrochenkovbors-4/+14
Remove support for specializing ToString outside the standard library This is the only trait specializable outside of the standard library. Before stabilizing specialization we will probably want to remove support for this. It was originally made specializable to allow a more efficient ToString in libproc_macro back when this way the only way to get any data out of a TokenStream. We now support getting individual tokens, so proc macros no longer need to call it as often.
2024-12-13Update testbjorn3-4/+14
2024-12-12Tweak multispan renderingEsteban Küber-4/+1
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-10Tweak wording of non-const traits used as const boundsEsteban Küber-6/+21
Use verbose suggestions and add additional labels/notes. Add more test cases for stable/nightly and feature enabled/disabled.
2024-12-07Mention type parameter in more cases and don't suggest ~const bound already ↵Esteban Küber-5/+5
there
2024-12-07Use trait name instead of full constraint in suggestion messageEsteban Küber-7/+7
``` help: consider restricting type parameter `T` with traits `Copy` and `Trait` | LL | fn duplicate_custom<T: Copy + Trait>(t: S<T>) -> (S<T>, S<T>) { | ++++++++++++++ ``` ``` help: consider restricting type parameter `V` with trait `Copy` | LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V { | +++++++++++++++++++ ```
2024-12-07reword trait bound suggestion message to include the boundsEsteban Küber-7/+7
2024-11-22Rollup merge of #132090 - compiler-errors:baily, r=lcnrMichael Goulet-13/+2
Stop being so bail-y in candidate assembly A conceptual follow-up to #132084. We gotta stop bailing so much when there are errors; it's both unnecessary, leads to weird knock-on errors, and it's messing up the vibes lol
2024-11-22Simplify fulfill_implicationMichael Goulet-10/+2
2024-11-21Stop being so bail-y in candidate assemblyMichael Goulet-13/+2
2024-11-03Gate checking ~const bounds on const_trait_implMichael Goulet-50/+1
2024-11-02NFC add known bug nr to testMatthias Krüger-1/+1
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-4/+4
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
2024-10-26Pass constness with span into lower_poly_trait_refMichael Goulet-12/+12
2024-10-24Implement const effect predicate in new solverMichael Goulet-45/+17
2024-10-15rebase and update fixed `crashes`lcnr-0/+86
2024-10-15stabilize `-Znext-solver=coherence`lcnr-22/+74
2024-10-10UI tests: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-4/+4
2024-09-29fix(hir_analysis/wfcheck): don't leak {type error}Barrett Ray-1/+1
avoid `{type error}` being leaked in user-facing messages, particularly when using the `adt_const_params` feature
2024-09-12Re-enable `ConstArgKind::Path` lowering by defaultNoah Lev-26/+4
...and remove the `const_arg_path` feature gate as a result. It was only a stopgap measure to fix the regression that the new lowering introduced (which should now be fixed by this PR).
2024-09-11Revert 'Stabilize -Znext-solver=coherence'Michael Goulet-160/+22
2024-09-05rebase and update fixed `crashes`lcnr-0/+86
2024-09-05stabilize `-Znext-solver=coherence`lcnr-22/+74
2024-08-19Retroactively feature gate `ConstArgKind::Path`Boxy-4/+26
2024-08-10Differentiate between methods and associated functionsEsteban Küber-5/+5
Accurately refer to assoc fn without receiver as assoc fn instead of methods. Add `AssocItem::descr` method to centralize where we call methods and associated functions.
2024-07-16Add `ConstArgKind::Path` and make `ConstArg` its own HIR nodeNoah Lev-26/+4
This is a very large commit since a lot needs to be changed in order to make the tests pass. The salient changes are: - `ConstArgKind` gets a new `Path` variant, and all const params are now represented using it. Non-param paths still use `ConstArgKind::Anon` to prevent this change from getting too large, but they will soon use the `Path` variant too. - `ConstArg` gets a distinct `hir_id` field and its own variant in `hir::Node`. This affected many parts of the compiler that expected the parent of an `AnonConst` to be the containing context (e.g., an array repeat expression). They have been changed to check the "grandparent" where necessary. - Some `ast::AnonConst`s now have their `DefId`s created in rustc_ast_lowering rather than `DefCollector`. This is because in some cases they will end up becoming a `ConstArgKind::Path` instead, which has no `DefId`. We have to solve this in a hacky way where we guess whether the `AnonConst` could end up as a path const since we can't know for sure until after name resolution (`N` could refer to a free const or a nullary struct). If it has no chance as being a const param, then we create a `DefId` in `DefCollector` -- otherwise we decide during ast_lowering. This will have to be updated once all path consts use `ConstArgKind::Path`. - We explicitly use `ConstArgHasType` for array lengths, rather than implicitly relying on anon const type feeding -- this is due to the addition of `ConstArgKind::Path`. - Some tests have their outputs changed, but the changes are for the most part minor (including removing duplicate or almost-duplicate errors). One test now ICEs, but it is for an incomplete, unstable feature and is now tracked at #127009.
2024-06-28bless tests part 1Deadbeef-2/+66
2024-06-19Const generic parameters aren't bounds, even if we end up erroring because ↵Oli Scherer-2/+2
of the bound that binds the parameter's type
2024-06-07Only compute specializes query if specialization is enabled in the crate of ↵Michael Goulet-1/+1
the specialized impl
2024-06-07Failing testMichael Goulet-0/+43
2024-06-05Rollup merge of #125792 - compiler-errors:dont-drop-upcast-cand, r=lcnrMatthias Krüger-0/+24
Don't drop `Unsize` candidate in intercrate mode Fixes #125767
2024-05-31Stop using translate_args in the new solverMichael Goulet-0/+89
2024-05-31Rollup merge of #125786 - compiler-errors:fold-item-bounds, r=lcnrMatthias Krüger-36/+7
Fold item bounds before proving them in `check_type_bounds` in new solver Vaguely confident that this is sufficient to prevent rust-lang/trait-system-refactor-initiative#46 and rust-lang/trait-system-refactor-initiative#62. This is not the "correct" solution, but will probably suffice until coinduction, at which point we implement the right solution (`check_type_bounds` must prove `Assoc<...> alias-eq ConcreteType`, normalizing requires proving item bounds). r? lcnr