Skip to content

Commit 4093344

Browse files
committed
---
yaml --- r: 214727 b: refs/heads/beta c: 8db699d h: refs/heads/master i: 214725: ed56533 214723: fe6a514 214719: 3abdae7 v: v3
1 parent 4ce4990 commit 4093344

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

[refs]

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 98f41ff3555dba80b47ebee6f6bc8a7df697240c
26+
refs/heads/beta: 8db699d18d263bf779f260ba55221a8c0ff2f5d8
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 8c0aa6d64ebab528f7eb182812007155d6044972
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

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

+3-3
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/beta/src/librustc_typeck/diagnostics.rs

+1
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/beta/src/test/compile-fail/associated-const-type-parameters.rs

+3-3
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)