1
+ // ignore-tidy-linelength
1
2
#![ allow( non_snake_case) ]
2
3
3
4
register_long_diagnostics ! {
@@ -1543,7 +1544,9 @@ fn f<T>() {}
1543
1544
1544
1545
It is not possible to declare type parameters on a function that has the `start`
1545
1546
attribute. Such a function must have the following type signature (for more
1546
- information: http://doc.rust-lang.org/stable/book/first-edition/no-stdlib.html):
1547
+ information, view [the unstable book][1]):
1548
+
1549
+ [1]: https://doc.rust-lang.org/unstable-book/language-features/lang-items.html#writing-an-executable-without-stdlib
1547
1550
1548
1551
```
1549
1552
# let _:
@@ -2917,10 +2920,11 @@ impl Baz for Bar { } // Note: This is OK
2917
2920
2918
2921
E0374 : r##"
2919
2922
A struct without a field containing an unsized type cannot implement
2920
- `CoerceUnsized`. An
2921
- [unsized type](https://doc.rust-lang.org/book/first-edition/unsized-types.html)
2922
- is any type that the compiler doesn't know the length or alignment of at
2923
- compile time. Any struct containing an unsized type is also unsized.
2923
+ `CoerceUnsized`. An [unsized type][1] is any type that the compiler
2924
+ doesn't know the length or alignment of at compile time. Any struct
2925
+ containing an unsized type is also unsized.
2926
+
2927
+ [1]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
2924
2928
2925
2929
Example of erroneous code:
2926
2930
@@ -2977,9 +2981,9 @@ A struct with more than one field containing an unsized type cannot implement
2977
2981
`CoerceUnsized`. This only occurs when you are trying to coerce one of the
2978
2982
types in your struct to another type in the struct. In this case we try to
2979
2983
impl `CoerceUnsized` from `T` to `U` which are both types that the struct
2980
- takes. An [unsized type] is any type that the compiler doesn't know the length
2981
- or alignment of at compile time. Any struct containing an unsized type is also
2982
- unsized.
2984
+ takes. An [unsized type][1] is any type that the compiler doesn't know the
2985
+ length or alignment of at compile time. Any struct containing an unsized type
2986
+ is also unsized.
2983
2987
2984
2988
Example of erroneous code:
2985
2989
@@ -3024,19 +3028,20 @@ fn coerce_foo<T: CoerceUnsized<U>, U>(t: T) -> Foo<U> {
3024
3028
}
3025
3029
```
3026
3030
3027
- [unsized type ]: https://doc.rust-lang.org/book/first-edition/unsized- types.html
3031
+ [1 ]: https://doc.rust-lang.org/book/ch19-04-advanced- types.html#dynamically-sized-types-and-the-sized-trait
3028
3032
"## ,
3029
3033
3030
3034
E0376 : r##"
3031
3035
The type you are trying to impl `CoerceUnsized` for is not a struct.
3032
3036
`CoerceUnsized` can only be implemented for a struct. Unsized types are
3033
3037
already able to be coerced without an implementation of `CoerceUnsized`
3034
3038
whereas a struct containing an unsized type needs to know the unsized type
3035
- field it's containing is able to be coerced. An
3036
- [unsized type](https://doc.rust-lang.org/book/first-edition/unsized-types.html)
3039
+ field it's containing is able to be coerced. An [unsized type][1]
3037
3040
is any type that the compiler doesn't know the length or alignment of at
3038
3041
compile time. Any struct containing an unsized type is also unsized.
3039
3042
3043
+ [1]: https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait
3044
+
3040
3045
Example of erroneous code:
3041
3046
3042
3047
```compile_fail,E0376
@@ -3882,8 +3887,10 @@ let c = 86u8 as char; // ok!
3882
3887
assert_eq!(c, 'V');
3883
3888
```
3884
3889
3885
- For more information about casts, take a look at The Book:
3886
- https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3890
+ For more information about casts, take a look at the Type cast section in
3891
+ [The Reference Book][1].
3892
+
3893
+ [1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
3887
3894
"## ,
3888
3895
3889
3896
E0605 : r##"
@@ -3911,8 +3918,10 @@ let v = 0 as *const u8;
3911
3918
v as *const i8; // ok!
3912
3919
```
3913
3920
3914
- For more information about casts, take a look at The Book:
3915
- https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3921
+ For more information about casts, take a look at the Type cast section in
3922
+ [The Reference Book][1].
3923
+
3924
+ [1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
3916
3925
"## ,
3917
3926
3918
3927
E0606 : r##"
@@ -3933,8 +3942,10 @@ let x = &0u8;
3933
3942
let y: u32 = *x as u32; // We dereference it first and then cast it.
3934
3943
```
3935
3944
3936
- For more information about casts, take a look at The Book:
3937
- https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3945
+ For more information about casts, take a look at the Type cast section in
3946
+ [The Reference Book][1].
3947
+
3948
+ [1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
3938
3949
"## ,
3939
3950
3940
3951
E0607 : r##"
@@ -3960,8 +3971,10 @@ pointer holds is their size.
3960
3971
3961
3972
To fix this error, don't try to cast directly between thin and fat pointers.
3962
3973
3963
- For more information about casts, take a look at The Book:
3964
- https://doc.rust-lang.org/book/first-edition/casting-between-types.html
3974
+ For more information about casts, take a look at the Type cast section in
3975
+ [The Reference Book][1].
3976
+
3977
+ [1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
3965
3978
"## ,
3966
3979
3967
3980
E0609 : r##"
@@ -4019,8 +4032,8 @@ println!("x: {}, y: {}", variable.x, variable.y);
4019
4032
```
4020
4033
4021
4034
For more information about primitives and structs, take a look at The Book:
4022
- https://doc.rust-lang.org/book/first-edition/primitive -types.html
4023
- https://doc.rust-lang.org/book/first-edition/ structs.html
4035
+ https://doc.rust-lang.org/book/ch03-02-data -types.html
4036
+ https://doc.rust-lang.org/book/ch05-00- structs.html
4024
4037
"## ,
4025
4038
4026
4039
E0614 : r##"
0 commit comments