Auto merge of #118947 - Bryanskiy:delegStep1, r=petrochenkov,lcnr
Delegation implementation: step 1 See https://github.com/rust-lang/rust/issues/118212 for more details. r? `@petrochenkov`
This commit is contained in:
commit
89110dafe7
50 changed files with 1634 additions and 93 deletions
|
|
@ -830,6 +830,7 @@ impl TyCoercionStability {
|
|||
| TyKind::Infer
|
||||
| TyKind::Typeof(..)
|
||||
| TyKind::TraitObject(..)
|
||||
| TyKind::InferDelegation(..)
|
||||
| TyKind::Err(_) => Self::Reborrow,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1108,7 +1108,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
|
|||
TyKind::Typeof(anon_const) => {
|
||||
self.hash_body(anon_const.body);
|
||||
},
|
||||
TyKind::Err(_) | TyKind::Infer | TyKind::Never => {},
|
||||
TyKind::Err(_) | TyKind::Infer | TyKind::Never | TyKind::InferDelegation(..) => {},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -728,7 +728,9 @@ impl<'a> FmtVisitor<'a> {
|
|||
(Const(..), Const(..)) | (MacCall(..), MacCall(..)) => {
|
||||
a.ident.as_str().cmp(b.ident.as_str())
|
||||
}
|
||||
(Fn(..), Fn(..)) => a.span.lo().cmp(&b.span.lo()),
|
||||
(Fn(..), Fn(..)) | (Delegation(..), Delegation(..)) => {
|
||||
a.span.lo().cmp(&b.span.lo())
|
||||
}
|
||||
(Type(ty), _) if is_type(&ty.ty) => Ordering::Less,
|
||||
(_, Type(ty)) if is_type(&ty.ty) => Ordering::Greater,
|
||||
(Type(..), _) => Ordering::Less,
|
||||
|
|
@ -737,6 +739,8 @@ impl<'a> FmtVisitor<'a> {
|
|||
(_, Const(..)) => Ordering::Greater,
|
||||
(MacCall(..), _) => Ordering::Less,
|
||||
(_, MacCall(..)) => Ordering::Greater,
|
||||
(Delegation(..), _) => Ordering::Less,
|
||||
(_, Delegation(..)) => Ordering::Greater,
|
||||
});
|
||||
let mut prev_kind = None;
|
||||
for (buf, item) in buffer {
|
||||
|
|
|
|||
|
|
@ -592,6 +592,11 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
|
|||
);
|
||||
self.push_rewrite(item.span, rewrite);
|
||||
}
|
||||
ast::ItemKind::Delegation(..) => {
|
||||
// TODO: rewrite delegation items once syntax is established.
|
||||
// For now, leave the contents of the Span unformatted.
|
||||
self.push_rewrite(item.span, None)
|
||||
}
|
||||
};
|
||||
}
|
||||
self.skip_context = skip_context_saved;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
|
|||
const ENTRY_LIMIT: usize = 900;
|
||||
// FIXME: The following limits should be reduced eventually.
|
||||
const ISSUES_ENTRY_LIMIT: usize = 1849;
|
||||
const ROOT_ENTRY_LIMIT: usize = 869;
|
||||
const ROOT_ENTRY_LIMIT: usize = 870;
|
||||
|
||||
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
|
||||
"rs", // test source files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue