Skip to content

Commit 37984d9

Browse files
committed
gcc/rust/ChangeLog:
* checks/errors/rust-feature-gate.cc (FeatureGate::visit): cleaning file. * checks/errors/rust-feature-gate.h: cleaning file. gcc/testsuite/ChangeLog: * rust/compile/features/associated_type_defaults_activated.rs: Changed test to code that used the tested feature. * rust/compile/features/associated_type_defaults_not_activated.rs: New test. Will be failing, but dg-error not set up yet. Signed-off-by: lucas.plantrose <[email protected]>
1 parent 453a6fa commit 37984d9

File tree

4 files changed

+30
-8
lines changed

4 files changed

+30
-8
lines changed

gcc/rust/checks/errors/rust-feature-gate.cc

+1-7
Original file line numberDiff line numberDiff line change
@@ -275,15 +275,9 @@ FeatureGate::visit (AST::ImplTraitTypeOneBound &type)
275275
void
276276
FeatureGate::visit (AST::Attribute &attr)
277277
{
278-
if (attr.get_path().as_string() == "register_tool")
278+
if (attr.get_path ().as_string () == "register_tool")
279279
gate (Feature::Name::REGISTER_TOOL, attr.get_locus (),
280280
"register tool is an experimental feature");
281281
}
282282

283-
void
284-
FeatureGate::visit (AST::TypeAlias &type)
285-
{
286-
287-
}
288-
289283
} // namespace Rust

gcc/rust/checks/errors/rust-feature-gate.h

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ class FeatureGate : public AST::DefaultASTVisitor
5555
void visit (AST::ImplTraitType &type) override;
5656
void visit (AST::ImplTraitTypeOneBound &type) override;
5757
void visit (AST::Attribute &attr) override;
58-
void visit (AST::TypeAlias &attr) override;
5958

6059
private:
6160
void gate (Feature::Name name, location_t loc, const std::string &error_msg);
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
// check-pass
2+
3+
// This is another instance of the "normalizations don't work" issue with
4+
// defaulted associated types.
5+
16
#![feature(associated_type_defaults)]
7+
8+
pub trait Emitter<'a> {
9+
type Ctxt: 'a;
10+
type CtxtBrw: 'a = &'a Self::Ctxt;
11+
12+
fn get_cx(&'a self) -> Self::CtxtBrw;
13+
}
14+
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// check-pass
2+
3+
// This is another instance of the "normalizations don't work" issue with
4+
// defaulted associated types.
5+
6+
// #![feature(associated_type_defaults)]
7+
8+
pub trait Emitter<'a> {
9+
type Ctxt: 'a;
10+
type CtxtBrw: 'a = &'a Self::Ctxt;
11+
12+
fn get_cx(&'a self) -> Self::CtxtBrw;
13+
}
14+
15+
fn main() {}

0 commit comments

Comments
 (0)