@@ -1886,7 +1886,117 @@ This explicitly states that you expect the trait object `SomeTrait` to
1886
1886
contain references (with a maximum lifetime of `'a`).
1887
1887
1888
1888
[1]: https://github.com/rust-lang/rfcs/pull/1156
1889
- "##
1889
+ "## ,
1890
+
1891
+ E0454 : r##"
1892
+ A link name was given with an empty name. Erroneous code example:
1893
+
1894
+ ```
1895
+ #[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
1896
+ ```
1897
+
1898
+ The rust compiler cannot link to an external library if you don't give it its
1899
+ name. Example:
1900
+
1901
+ ```
1902
+ #[link(name = "some_lib")] extern {} // ok!
1903
+ ```
1904
+ "## ,
1905
+
1906
+ E0458 : r##"
1907
+ An unknown "kind" was specified for a link attribute. Erroneous code example:
1908
+
1909
+ ```
1910
+ #[link(kind = "wonderful_unicorn")] extern {}
1911
+ // error: unknown kind: `wonderful_unicorn`
1912
+ ```
1913
+
1914
+ Please specify a valid "kind" value, from one of the following:
1915
+ * static
1916
+ * dylib
1917
+ * framework
1918
+ "## ,
1919
+
1920
+ E0459 : r##"
1921
+ A link was used without a name parameter. Erroneous code example:
1922
+
1923
+ ```
1924
+ #[link(kind = "dylib")] extern {}
1925
+ // error: #[link(...)] specified without `name = "foo"`
1926
+ ```
1927
+
1928
+ Please add the name parameter to allow the rust compiler to find the library
1929
+ you want. Example:
1930
+
1931
+ ```
1932
+ #[link(kind = "dylib", name = "some_lib")] extern {} // ok!
1933
+ ```
1934
+ "## ,
1935
+
1936
+ E0493 : r##"
1937
+ A type with a destructor was assigned to an invalid type of variable. Erroneous
1938
+ code example:
1939
+
1940
+ ```
1941
+ struct Foo {
1942
+ a: u32
1943
+ }
1944
+
1945
+ impl Drop for Foo {
1946
+ fn drop(&mut self) {}
1947
+ }
1948
+
1949
+ const F : Foo = Foo { a : 0 };
1950
+ // error: constants are not allowed to have destructors
1951
+ static S : Foo = Foo { a : 0 };
1952
+ // error: statics are not allowed to have destructors
1953
+ ```
1954
+
1955
+ To solve this issue, please use a type which does allow the usage of type with
1956
+ destructors.
1957
+ "## ,
1958
+
1959
+ E0494 : r##"
1960
+ A reference of an interior static was assigned to another const/static.
1961
+ Erroneous code example:
1962
+
1963
+ ```
1964
+ struct Foo {
1965
+ a: u32
1966
+ }
1967
+
1968
+ static S : Foo = Foo { a : 0 };
1969
+ static A : &'static u32 = &S.a;
1970
+ // error: cannot refer to the interior of another static, use a
1971
+ // constant instead
1972
+ ```
1973
+
1974
+ The "base" variable has to be a const if you want another static/const variable
1975
+ to refer to one of its fields. Example:
1976
+
1977
+ ```
1978
+ struct Foo {
1979
+ a: u32
1980
+ }
1981
+
1982
+ const S : Foo = Foo { a : 0 };
1983
+ static A : &'static u32 = &S.a; // ok!
1984
+ ```
1985
+ "## ,
1986
+
1987
+ E0497 : r##"
1988
+ A stability attribute was used outside of the standard library. Erroneous code
1989
+ example:
1990
+
1991
+ ```
1992
+ #[stable] // error: stability attributes may not be used outside of the
1993
+ // standard library
1994
+ fn foo() {}
1995
+ ```
1996
+
1997
+ It is not possible to use stability attributes outside of the standard library.
1998
+ Also, for now, it is not possible to write deprecation messages either.
1999
+ "## ,
1890
2000
1891
2001
}
1892
2002
@@ -1914,5 +2024,46 @@ register_diagnostics! {
1914
2024
E0314 , // closure outlives stack frame
1915
2025
E0315 , // cannot invoke closure outside of its lifetime
1916
2026
E0316 , // nested quantification of lifetimes
1917
- E0400 // overloaded derefs are not allowed in constants
2027
+ E0400 , // overloaded derefs are not allowed in constants
2028
+ E0452 , // malformed lint attribute
2029
+ E0453 , // overruled by outer forbid
2030
+ E0455 , // native frameworks are only available on OSX targets
2031
+ E0456 , // plugin `..` is not available for triple `..`
2032
+ E0457 , // plugin `..` only found in rlib format, but must be available...
2033
+ E0460 , // found possibly newer version of crate `..`
2034
+ E0461 , // couldn't find crate `..` with expected target triple ..
2035
+ E0462 , // found staticlib `..` instead of rlib or dylib
2036
+ E0463 , // can't find crate for `..`
2037
+ E0464 , // multiple matching crates for `..`
2038
+ E0465 , // multiple .. candidates for `..` found
2039
+ E0466 , // bad macro import
2040
+ E0467 , // bad macro reexport
2041
+ E0468 , // an `extern crate` loading macros must be at the crate root
2042
+ E0469 , // imported macro not found
2043
+ E0470 , // reexported macro not found
2044
+ E0471 , // constant evaluation error: ..
2045
+ E0472 , // asm! is unsupported on this target
2046
+ E0473 , // dereference of reference outside its lifetime
2047
+ E0474 , // captured variable `..` does not outlive the enclosing closure
2048
+ E0475 , // index of slice outside its lifetime
2049
+ E0476 , // lifetime of the source pointer does not outlive lifetime bound...
2050
+ E0477 , // the type `..` does not fulfill the required lifetime...
2051
+ E0478 , // lifetime bound not satisfied
2052
+ E0479 , // the type `..` (provided as the value of a type parameter) is...
2053
+ E0480 , // lifetime of method receiver does not outlive the method call
2054
+ E0481 , // lifetime of function argument does not outlive the function call
2055
+ E0482 , // lifetime of return value does not outlive the function call
2056
+ E0483 , // lifetime of operand does not outlive the operation
2057
+ E0484 , // reference is not valid at the time of borrow
2058
+ E0485 , // automatically reference is not valid at the time of borrow
2059
+ E0486 , // type of expression contains references that are not valid during...
2060
+ E0487 , // unsafe use of destructor: destructor might be called while...
2061
+ E0488 , // lifetime of variable does not enclose its declaration
2062
+ E0489 , // type/lifetime parameter not in scope here
2063
+ E0490 , // a value of type `..` is borrowed for too long
2064
+ E0491 , // in type `..`, reference has a longer lifetime than the data it...
2065
+ E0492 , // cannot borrow a constant which contains interior mutability
2066
+ E0495 , // cannot infer an appropriate lifetime due to conflicting requirements
2067
+ E0496 , // .. name `..` shadows a .. name that is already in scope
2068
+ E0498 , // malformed plugin attribute
1918
2069
}
0 commit comments