File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -1915,6 +1915,45 @@ More details can be found in [RFC 438].
1915
1915
[RFC 438]: https://github.com/rust-lang/rfcs/pull/438
1916
1916
"## ,
1917
1917
1918
+ E0182 : r##"
1919
+ You bound an associated type in an expression path which is not
1920
+ allowed.
1921
+
1922
+ Erroneous code example:
1923
+
1924
+ ```compile_fail,E0182
1925
+ trait Foo {
1926
+ type A;
1927
+ fn bar() -> isize;
1928
+ }
1929
+
1930
+ impl Foo for isize {
1931
+ type A = usize;
1932
+ fn bar() -> isize { 42 }
1933
+ }
1934
+
1935
+ // error: unexpected binding of associated item in expression path
1936
+ let x: isize = Foo::<A=usize>::bar();
1937
+ ```
1938
+
1939
+ To give a concrete type when using the Universal Function Call Syntax,
1940
+ use "Type as Trait". Example:
1941
+
1942
+ ```
1943
+ trait Foo {
1944
+ type A;
1945
+ fn bar() -> isize;
1946
+ }
1947
+
1948
+ impl Foo for isize {
1949
+ type A = usize;
1950
+ fn bar() -> isize { 42 }
1951
+ }
1952
+
1953
+ let x: isize = <isize as Foo>::bar(); // ok!
1954
+ ```
1955
+ "## ,
1956
+
1918
1957
E0184 : r##"
1919
1958
Explicitly implementing both Drop and Copy for a type is currently disallowed.
1920
1959
This feature can make some sense in theory, but the current implementation is
@@ -4054,7 +4093,6 @@ register_diagnostics! {
4054
4093
// E0168,
4055
4094
// E0173, // manual implementations of unboxed closure traits are experimental
4056
4095
// E0174,
4057
- E0182 ,
4058
4096
E0183 ,
4059
4097
// E0187, // can't infer the kind of the closure
4060
4098
// E0188, // can not cast an immutable reference to a mutable pointer
You can’t perform that action at this time.
0 commit comments