Skip to content

Commit 68391bf

Browse files
committed
---
yaml --- r: 211198 b: refs/heads/try c: 8db699d h: refs/heads/master v: v3
1 parent cd6e26d commit 68391bf

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: 98f41ff3555dba80b47ebee6f6bc8a7df697240c
5+
refs/heads/try: 8db699d18d263bf779f260ba55221a8c0ff2f5d8
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

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