diff options
| author | The Miri Cronjob Bot <miri@cron.bot> | 2025-01-26 05:11:44 +0000 |
|---|---|---|
| committer | The Miri Cronjob Bot <miri@cron.bot> | 2025-01-26 05:11:44 +0000 |
| commit | 06db6bba3b6f9853d692cc20ade7fbc121e27573 (patch) | |
| tree | e52f559fa38a8bb7c6f1d26ef966b9884f7892d9 /compiler/rustc_error_codes | |
| parent | 7209ae6dd021747401f6228318a10c8e7708efa0 (diff) | |
| parent | 2f0ad2a71e4a4528bb80bcb24bf8fa4e50cb87c2 (diff) | |
| download | rust-06db6bba3b6f9853d692cc20ade7fbc121e27573.tar.gz rust-06db6bba3b6f9853d692cc20ade7fbc121e27573.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0393.md | 12 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0433.md | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0393.md b/compiler/rustc_error_codes/src/error_codes/E0393.md index 50225b25163..c7260815905 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0393.md +++ b/compiler/rustc_error_codes/src/error_codes/E0393.md @@ -3,12 +3,10 @@ A type parameter which references `Self` in its default value was not specified. Erroneous code example: ```compile_fail,E0393 -trait A<T=Self> {} +trait A<T = Self> {} -fn together_we_will_rule_the_galaxy(son: &A) {} -// error: the type parameter `T` must be explicitly specified in an -// object type because its default value `Self` references the -// type `Self` +fn together_we_will_rule_the_galaxy(son: &dyn A) {} +// error: the type parameter `T` must be explicitly specified ``` A trait object is defined over a single, fully-defined trait. With a regular @@ -23,7 +21,7 @@ disallowed. Making the trait concrete by explicitly specifying the value of the defaulted parameter will fix this issue. Fixed example: ``` -trait A<T=Self> {} +trait A<T = Self> {} -fn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok! +fn together_we_will_rule_the_galaxy(son: &dyn A<i32>) {} // Ok! ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0433.md b/compiler/rustc_error_codes/src/error_codes/E0433.md index 5a64c13c9af..36e4b66e8dc 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0433.md +++ b/compiler/rustc_error_codes/src/error_codes/E0433.md @@ -19,7 +19,7 @@ If you've expected to use a crate name: ```compile_fail use ferris_wheel::BigO; -// error: failed to resolve: use of undeclared crate or module `ferris_wheel` +// error: failed to resolve: use of undeclared module or unlinked crate ``` Make sure the crate has been added as a dependency in `Cargo.toml`. |
