about summary refs log tree commit diff
path: root/src/test/ui/specialization
AgeCommit message (Collapse)AuthorLines
2021-10-05Consider unfulfilled obligations in binop errorsEsteban Kuber-0/+8
When encountering a binop where the types would have been accepted, if all the predicates had been fulfilled, include information about the predicates and suggest appropriate `#[derive]`s if possible. Point at trait(s) that needs to be `impl`emented.
2021-10-04Rollup merge of #89413 - matthewjasper:spec-marker-fix, r=nikomatsakisJubilee-0/+42
Correctly handle supertraits for min_specialization Supertraits of specialization markers could circumvent checks for min_specialization. Elaborating predicates prevents this. r? ````@nikomatsakis````
2021-10-02Consistently use 'supertrait'.Bruce Mitchener-2/+2
A subset of places referred to 'super-trait', so this changes them to all use 'supertrait'. This matches 'supertype' and some other usages. An exception is 'auto-trait' which is consistently used in that manner.
2021-09-30Elaborate predicates in min_specialization checksMatthew Jasper-0/+42
Supertraits of specialization markers could circumvent checks for min_specialization. Elaborating predicates prevents this.
2021-09-15Move some tests to more reasonable directoriesCaio-0/+55
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-2/+1
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-1/+1
:sparkles:
2021-08-16Use note to point at bound introducing requirementEsteban Küber-24/+44
2021-08-12Use a more accurate span on assoc types WF checksEsteban Kuber-2/+2
2021-08-11Modify structured suggestion outputEsteban Küber-4/+4
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-07-16Make GATs no longer incompleteJack Huey-11/+2
2021-07-06Revert "Revert "Update tests""bjorn3-1/+1
This reverts commit 715c68fe90c6f1d0b3004ad18f16e0811f209992.
2021-06-07Revert "Update tests"bjorn3-1/+1
This reverts commit c76b1b031753fc08a18a3906d828683476c1e595.
2021-05-30Update testsbjorn3-1/+1
2021-04-23Add test for issue #51892marmeladema-0/+29
2021-04-23Add test for issue #33017marmeladema-0/+62
2021-04-12Turn old edition lints (anonymous-parameters, keyword-idents) into ↵Manish Goregaokar-1/+1
warn-by-default on 2015
2021-04-08Rollup merge of #83689 - estebank:cool-bears-hot-tip, r=davidtwcoDylan DPC-3/+15
Add more info for common trait resolution and async/await errors * Suggest `Pin::new`/`Box::new`/`Arc::new`/`Box::pin` in more cases * Point at `impl` and type defs introducing requirements on E0277
2021-04-06Point at `impl` and type defs introducing requirements on E0277Esteban Küber-3/+15
2021-04-06Remove trailing `:` from E0119 messageEsteban Küber-6/+6
2021-04-02Rollup merge of #83673 - hi-rustin:rustin-patch-suggestion, r=estebankDylan DPC-4/+4
give full path of constraint in suggest_constraining_type_param close https://github.com/rust-lang/rust/issues/83513
2021-04-01Rollup merge of #83699 - JohnTitor:issue-68830, r=Dylan-DPCDylan DPC-0/+32
Add a regression test for issue-68830 Closes #68830
2021-03-31Track bound varsJack Huey-1/+1
2021-03-31Add a regression test for issue-68830JohnTitor-0/+32
2021-03-31give full path of constraint in suggest_constraining_type_paramhi-rustin-4/+4
revert file bless with nll mode
2021-02-21reword `;` suggestions to have consistent wordingEsteban Küber-1/+1
2021-02-17In some limited cases, suggest `where` bounds for non-type paramsEsteban Küber-0/+4
Partially address #81971.
2021-01-26Avoid describing a method as 'not found' when bounds are unsatisfiedAaron Hill-4/+4
Fixes #76267 When there is a single applicable method candidate, but its trait bounds are not satisfied, we avoid saying that the method is "not found". Insted, we update the error message to directly mention which bounds are not satisfied, rather than mentioning them in a note.
2021-01-16fold_with not super_fold_with in TypeFoldable impl for PredicateJack Huey-1/+1
2021-01-16Remove PredicateKind::AtomJack Huey-1/+1
2020-12-29Remove `compile-fail` test suiteVadim Petrochenkov-2/+49
2020-11-23Rename `optin_builtin_traits` to `auto_traits`Camelid-1/+1
They were originally called "opt-in, built-in traits" (OIBITs), but people realized that the name was too confusing and a mouthful, and so they were renamed to just "auto traits". The feature flag's name wasn't updated, though, so that's what this PR does. There are some other spots in the compiler that still refer to OIBITs, but I don't think changing those now is worth it since they are internal and not particularly relevant to this PR. Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-10-17Suggest minimal subset features in `incomplete_features` lintYuki Okushi-0/+45
2020-10-06Update to chalk 0.31. Implement some unimplemented. Ignore some tests in ↵Jack Huey-2/+3
compare mode chalk don't finish.
2020-10-06Avoid cycles from projection boundsMatthew Jasper-29/+17
Only check the own predicates of associated types when confirming projection candidates. Also consider implied bounds when comparing trait and impl methods.
2020-10-06Check projections are well-formed when using projection candidatesMatthew Jasper-0/+101
2020-10-06Separate bounds and predicates for associated/opaque typesMatthew Jasper-7/+7
2020-09-25Move from {{closure}}#0 syntax to {closure#0} for (def) path componentsmarmeladema-1/+1
2020-09-03specialization_graph: avoid trimmed paths for OverlapErrorDan Aloni-3/+3
2020-09-02pretty: trim paths of unique symbolsDan Aloni-29/+29
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-08-22Use smaller def span for functionsAaron Hill-2/+2
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-07-27`PredicateKint` -> `PredicateKind`, the beginning of the endBastian Kauschke-1/+1
2020-07-19do not try fetching the ancestors of errored trait implsBastian Kauschke-0/+16
2020-07-14Remove redundant explanatory `note` for type parametersEsteban Küber-1/+0
2020-06-23Add test for issue-59435Yuki Okushi-0/+29
2020-06-23Add test for issue-44861Yuki Okushi-0/+52
2020-06-20Move bounds on associated types to the typeMatthew Jasper-7/+7
Given `trait X { type U; }` the bound `<Self as X>::U` now lives on the type, rather than the trait. This is feature gated on `feature(generic_associated_types)` for now until more testing can be done. The also enabled type-generic associated types since we no longer need "implies bounds".
2020-06-20Check associated type satisfy their boundsMatthew Jasper-0/+153
This was currently only happening due to eager normalization, which isn't possible if there's specialization or bound variables.
2020-06-16bless allRalf Jung-36/+36
2020-06-16warn against 'specialization' featureRalf Jung-59/+472