mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-07 13:25:45 +00:00
Add marks
This commit is contained in:
parent
77f92674f9
commit
94bbb2418a
@ -1,4 +1,6 @@
|
||||
test_utils::marks!(
|
||||
name_res_works_for_broken_modules
|
||||
item_map_enum_importing
|
||||
type_var_cycles_resolve_completely
|
||||
type_var_cycles_resolve_as_possible
|
||||
);
|
||||
|
@ -29,6 +29,8 @@ use ra_arena::map::ArenaMap;
|
||||
use join_to_string::join;
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use test_utils::tested_by;
|
||||
|
||||
use crate::{
|
||||
Module, Function, Struct, StructField, Enum, EnumVariant, Path, Name, ImplBlock,
|
||||
FnSignature, FnScopes, ModuleDef, AdtDef,
|
||||
@ -1020,6 +1022,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
|
||||
Ty::Infer(tv) => {
|
||||
let inner = tv.to_inner();
|
||||
if tv_stack.contains(&inner) {
|
||||
tested_by!(type_var_cycles_resolve_as_possible);
|
||||
// recursive type
|
||||
return tv.fallback_value();
|
||||
}
|
||||
@ -1062,6 +1065,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
|
||||
Ty::Infer(tv) => {
|
||||
let inner = tv.to_inner();
|
||||
if tv_stack.contains(&inner) {
|
||||
tested_by!(type_var_cycles_resolve_completely);
|
||||
// recursive type
|
||||
return tv.fallback_value();
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ use std::fmt::Write;
|
||||
|
||||
use ra_db::{SourceDatabase, salsa::Database};
|
||||
use ra_syntax::ast::{self, AstNode};
|
||||
use test_utils::covers;
|
||||
|
||||
use crate::{
|
||||
source_binder,
|
||||
@ -564,6 +565,8 @@ fn quux() {
|
||||
|
||||
#[test]
|
||||
fn recursive_vars() {
|
||||
covers!(type_var_cycles_resolve_completely);
|
||||
covers!(type_var_cycles_resolve_as_possible);
|
||||
check_inference(
|
||||
"recursive_vars",
|
||||
r#"
|
||||
@ -577,6 +580,8 @@ fn test() {
|
||||
|
||||
#[test]
|
||||
fn recursive_vars_2() {
|
||||
covers!(type_var_cycles_resolve_completely);
|
||||
covers!(type_var_cycles_resolve_as_possible);
|
||||
check_inference(
|
||||
"recursive_vars_2",
|
||||
r#"
|
||||
|
Loading…
Reference in New Issue
Block a user