Skip to content

Commit 5feb7af

Browse files
committed
---
yaml --- r: 209302 b: refs/heads/auto c: 8db699d h: refs/heads/master v: v3
1 parent 45b5a75 commit 5feb7af

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 98f41ff3555dba80b47ebee6f6bc8a7df697240c
13+
refs/heads/auto: 8db699d18d263bf779f260ba55221a8c0ff2f5d8
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc_typeck/check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3773,9 +3773,9 @@ pub fn resolve_ty_and_def_ufcs<'a, 'b, 'tcx>(fcx: &FnCtxt<'b, 'tcx>,
37733773
match def {
37743774
def::DefAssociatedConst(..) => {
37753775
if ty::type_has_params(ty) || ty::type_has_self(ty) {
3776-
fcx.sess().span_err(span,
3777-
"Associated consts cannot depend \
3778-
on type parameters or Self.");
3776+
span_err!(fcx.sess(), span, E0329,
3777+
"Associated consts cannot depend \
3778+
on type parameters or Self.");
37793779
fcx.write_error(node_id);
37803780
return true;
37813781
}

branches/auto/src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,7 @@ register_diagnostics! {
771771
E0326, // associated const implemented with different type from trait
772772
E0327, // referred to method instead of constant in match pattern
773773
E0328, // cannot implement Unsize explicitly
774+
E0329, // associated const depends on type parameter or Self.
774775
E0366, // dropck forbid specialization to concrete type or region
775776
E0367, // dropck forbid specialization to predicate not in struct/enum
776777
E0369, // binary operation `<op>` cannot be applied to types

branches/auto/src/test/compile-fail/associated-const-type-parameters.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ pub trait Foo {
1414
const MIN: i32;
1515

1616
fn get_min() -> i32 {
17-
Self::MIN //~ Associated consts cannot depend on type parameters or Self.
17+
Self::MIN //~ ERROR E0329
1818
}
1919
}
2020

2121
fn get_min<T: Foo>() -> i32 {
22-
T::MIN; //~ Associated consts cannot depend on type parameters or Self.
23-
<T as Foo>::MIN //~ Associated consts cannot depend on type parameters or Self.
22+
T::MIN; //~ ERROR E0329
23+
<T as Foo>::MIN //~ ERROR E0329
2424
}
2525

2626
fn main() {}

0 commit comments

Comments
 (0)