Remove Ident::empty.
All uses have been removed. And it's nonsensical: an identifier by definition has at least one char. The commits adds an is-non-empty assertion to `Ident::new` to enforce this, and converts some `Ident` constructions to use `Ident::new`. Adding the assertion requires making `Ident::new` and `Ident::with_dummy_span` non-const, which is no great loss. The commit amends a couple of places that do path splitting to ensure no empty identifiers are created.
This commit is contained in:
@@ -50,21 +50,14 @@ fn trait_object_roundtrips() {
|
||||
}
|
||||
|
||||
fn trait_object_roundtrips_impl(syntax: TraitObjectSyntax) {
|
||||
let unambig = TyKind::TraitObject::<'_, ()>(
|
||||
&[],
|
||||
TaggedRef::new(
|
||||
&const {
|
||||
Lifetime {
|
||||
hir_id: HirId::INVALID,
|
||||
ident: Ident::new(sym::name, DUMMY_SP),
|
||||
kind: LifetimeKind::Static,
|
||||
source: LifetimeSource::Other,
|
||||
syntax: LifetimeSyntax::Hidden,
|
||||
}
|
||||
},
|
||||
syntax,
|
||||
),
|
||||
);
|
||||
let lt = Lifetime {
|
||||
hir_id: HirId::INVALID,
|
||||
ident: Ident::new(sym::name, DUMMY_SP),
|
||||
kind: LifetimeKind::Static,
|
||||
source: LifetimeSource::Other,
|
||||
syntax: LifetimeSyntax::Hidden,
|
||||
};
|
||||
let unambig = TyKind::TraitObject::<'_, ()>(&[], TaggedRef::new(<, syntax));
|
||||
let unambig_to_ambig = unsafe { std::mem::transmute::<_, TyKind<'_, AmbigArg>>(unambig) };
|
||||
|
||||
match unambig_to_ambig {
|
||||
|
||||
Reference in New Issue
Block a user