diff --git a/gcc/rust/checks/errors/rust-feature-gate.cc b/gcc/rust/checks/errors/rust-feature-gate.cc index b2ef807371ef..2b15f1142a62 100644 --- a/gcc/rust/checks/errors/rust-feature-gate.cc +++ b/gcc/rust/checks/errors/rust-feature-gate.cc @@ -275,15 +275,9 @@ FeatureGate::visit (AST::ImplTraitTypeOneBound &type) void FeatureGate::visit (AST::Attribute &attr) { - if (attr.get_path().as_string() == "register_tool") + if (attr.get_path ().as_string () == "register_tool") gate (Feature::Name::REGISTER_TOOL, attr.get_locus (), "register tool is an experimental feature"); } -void -FeatureGate::visit (AST::TypeAlias &type) -{ - -} - } // namespace Rust diff --git a/gcc/rust/checks/errors/rust-feature-gate.h b/gcc/rust/checks/errors/rust-feature-gate.h index 73c448948b31..d5b5041de8b0 100644 --- a/gcc/rust/checks/errors/rust-feature-gate.h +++ b/gcc/rust/checks/errors/rust-feature-gate.h @@ -55,7 +55,6 @@ class FeatureGate : public AST::DefaultASTVisitor void visit (AST::ImplTraitType &type) override; void visit (AST::ImplTraitTypeOneBound &type) override; void visit (AST::Attribute &attr) override; - void visit (AST::TypeAlias &attr) override; private: void gate (Feature::Name name, location_t loc, const std::string &error_msg); diff --git a/gcc/testsuite/rust/compile/features/associated_type_defaults_activated.rs b/gcc/testsuite/rust/compile/features/associated_type_defaults_activated.rs index ab4d135b6626..90bb023f7055 100644 --- a/gcc/testsuite/rust/compile/features/associated_type_defaults_activated.rs +++ b/gcc/testsuite/rust/compile/features/associated_type_defaults_activated.rs @@ -1 +1,15 @@ +// check-pass + +// This is another instance of the "normalizations don't work" issue with +// defaulted associated types. + #![feature(associated_type_defaults)] + +pub trait Emitter<'a> { + type Ctxt: 'a; + type CtxtBrw: 'a = &'a Self::Ctxt; + + fn get_cx(&'a self) -> Self::CtxtBrw; +} + +fn main() {} diff --git a/gcc/testsuite/rust/compile/features/associated_type_defaults_not_activated.rs b/gcc/testsuite/rust/compile/features/associated_type_defaults_not_activated.rs new file mode 100644 index 000000000000..579703a1d132 --- /dev/null +++ b/gcc/testsuite/rust/compile/features/associated_type_defaults_not_activated.rs @@ -0,0 +1,15 @@ +// check-pass + +// This is another instance of the "normalizations don't work" issue with +// defaulted associated types. + +// #![feature(associated_type_defaults)] + +pub trait Emitter<'a> { + type Ctxt: 'a; + type CtxtBrw: 'a = &'a Self::Ctxt; + + fn get_cx(&'a self) -> Self::CtxtBrw; +} + +fn main() {}