mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Add test mark
This commit is contained in:
parent
6e1c2d0df8
commit
91853590a9
3 changed files with 9 additions and 2 deletions
|
@ -32,6 +32,7 @@ use hir_def::{
|
|||
use hir_expand::{diagnostics::DiagnosticSink, name::name};
|
||||
use ra_arena::map::ArenaMap;
|
||||
use ra_prof::profile;
|
||||
use test_utils::tested_by;
|
||||
|
||||
use super::{
|
||||
primitive::{FloatTy, IntTy},
|
||||
|
@ -282,6 +283,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
|
|||
fn insert_vars_for_impl_trait(&mut self, ty: Ty) -> Ty {
|
||||
ty.fold(&mut |ty| match ty {
|
||||
Ty::Opaque(preds) => {
|
||||
tested_by!(insert_vars_for_impl_trait);
|
||||
let var = self.table.new_type_var();
|
||||
let var_subst = Substs::builder(1).push(var.clone()).build();
|
||||
self.obligations.extend(
|
||||
|
|
|
@ -6,4 +6,5 @@ test_utils::marks!(
|
|||
type_var_resolves_to_int_var
|
||||
match_ergonomics_ref
|
||||
coerce_merge_fail_fallback
|
||||
insert_vars_for_impl_trait
|
||||
);
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
use insta::assert_snapshot;
|
||||
|
||||
use ra_db::fixture::WithFixture;
|
||||
use test_utils::covers;
|
||||
|
||||
use super::{infer, infer_with_mismatches, type_at, type_at_pos};
|
||||
use crate::test_db::TestDB;
|
||||
use insta::assert_snapshot;
|
||||
use ra_db::fixture::WithFixture;
|
||||
|
||||
#[test]
|
||||
fn infer_await() {
|
||||
|
@ -1489,6 +1492,7 @@ fn test<T, U>() where T: Trait<U::Item>, U: Trait<T::Item> {
|
|||
|
||||
#[test]
|
||||
fn unify_impl_trait() {
|
||||
covers!(insert_vars_for_impl_trait);
|
||||
assert_snapshot!(
|
||||
infer_with_mismatches(r#"
|
||||
trait Trait<T> {}
|
||||
|
|
Loading…
Reference in a new issue