Skip to content

Commit 23ff1ba

Browse files
committed
---
yaml --- r: 225263 b: refs/heads/stable c: 8db699d h: refs/heads/master i: 225261: e135b2b 225259: ac919d5 225255: 23fb74b 225247: c851b85 v: v3
1 parent d74fd5e commit 23ff1ba

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
@@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 98f41ff3555dba80b47ebee6f6bc8a7df697240c
32+
refs/heads/stable: 8db699d18d263bf779f260ba55221a8c0ff2f5d8
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b

branches/stable/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/stable/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/stable/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)