}
pub fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
- ast::TraitRef { path, constness: None, ref_id: ast::DUMMY_NODE_ID }
+ ast::TraitRef { path, ref_id: ast::DUMMY_NODE_ID }
}
pub fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
pub fn to_bound(&self) -> Option<GenericBound> {
match &self.kind {
ExprKind::Path(None, path) => Some(GenericBound::Trait(
- PolyTraitRef::new(Vec::new(), path.clone(), None, self.span),
+ PolyTraitRef::new(Vec::new(), path.clone(), self.span),
TraitBoundModifier::None,
)),
_ => None,
pub struct TraitRef {
pub path: Path,
pub ref_id: NodeId,
-
- /// The `const` modifier, if any, that appears before this trait.
- ///
- /// | | `constness` |
- /// |----------------|-----------------------------|
- /// | `Trait` | `None` |
- /// | `const Trait` | `Some(Constness::Const)` |
- /// | `?const Trait` | `Some(Constness::NotConst)` |
- pub constness: Option<Constness>,
}
#[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
}
impl PolyTraitRef {
- pub fn new(
- generic_params: Vec<GenericParam>,
- path: Path,
- constness: Option<Constness>,
- span: Span,
- ) -> Self {
+ pub fn new(generic_params: Vec<GenericParam>, path: Path, span: Span) -> Self {
PolyTraitRef {
bound_generic_params: generic_params,
- trait_ref: TraitRef { path, constness, ref_id: DUMMY_NODE_ID },
+ trait_ref: TraitRef { path, ref_id: DUMMY_NODE_ID },
span,
}
}
}
}
-pub fn noop_visit_trait_ref<T: MutVisitor>(tr: &mut TraitRef, vis: &mut T) {
- let TraitRef { path, ref_id, constness: _ } = tr;
+pub fn noop_visit_trait_ref<T: MutVisitor>(TraitRef { path, ref_id }: &mut TraitRef, vis: &mut T) {
vis.visit_path(path);
vis.visit_id(ref_id);
}