-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #103197 (Stabilize proc_macro::Span::source_text) - #103251 (Fix item declaration highlighting) - #103262 (Adjusting test to needs-unwind, with linking issue) - #103268 (rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`) - #103272 (Remove extra spaces in docs) - #103276 (Erase regions before checking for `Default` in uninitialized binding error) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
10 changed files
with
191 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// This test ensures that the color of the items in the type decl are working as expected. | ||
define-function: ( | ||
"check-colors", | ||
( | ||
theme, | ||
attr_color, | ||
trait_color, | ||
struct_color, | ||
enum_color, | ||
primitive_color, | ||
constant_color, | ||
fn_color, | ||
assoc_type_color, | ||
), | ||
[ | ||
("goto", "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"), | ||
("show-text", true), | ||
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), | ||
("reload"), | ||
("assert-css", (".item-decl .code-attribute", {"color": |attr_color|}, ALL)), | ||
("assert-css", (".item-decl .trait", {"color": |trait_color|}, ALL)), | ||
// We need to add `code` here because otherwise it would select the parent too. | ||
("assert-css", (".item-decl code .struct", {"color": |struct_color|}, ALL)), | ||
("assert-css", (".item-decl .enum", {"color": |enum_color|}, ALL)), | ||
("assert-css", (".item-decl .primitive", {"color": |primitive_color|}, ALL)), | ||
("goto", "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithoutGenerics.html"), | ||
("assert-css", (".item-decl .constant", {"color": |constant_color|}, ALL)), | ||
("assert-css", (".item-decl .fnname", {"color": |fn_color|}, ALL)), | ||
("assert-css", (".item-decl .associatedtype", {"color": |assoc_type_color|}, ALL)), | ||
], | ||
) | ||
|
||
call-function: ( | ||
"check-colors", | ||
{ | ||
"theme": "ayu", | ||
"attr_color": "rgb(153, 153, 153)", | ||
"trait_color": "rgb(57, 175, 215)", | ||
"struct_color": "rgb(255, 160, 165)", | ||
"enum_color": "rgb(255, 160, 165)", | ||
"primitive_color": "rgb(255, 160, 165)", | ||
"constant_color": "rgb(57, 175, 215)", | ||
"fn_color": "rgb(253, 214, 135)", | ||
"assoc_type_color": "rgb(57, 175, 215)", | ||
}, | ||
) | ||
call-function: ( | ||
"check-colors", | ||
{ | ||
"theme": "dark", | ||
"attr_color": "rgb(153, 153, 153)", | ||
"trait_color": "rgb(183, 140, 242)", | ||
"struct_color": "rgb(45, 191, 184)", | ||
"enum_color": "rgb(45, 191, 184)", | ||
"primitive_color": "rgb(45, 191, 184)", | ||
"constant_color": "rgb(210, 153, 29)", | ||
"fn_color": "rgb(43, 171, 99)", | ||
"assoc_type_color": "rgb(210, 153, 29)", | ||
}, | ||
) | ||
call-function: ( | ||
"check-colors", | ||
{ | ||
"theme": "light", | ||
"attr_color": "rgb(153, 153, 153)", | ||
"trait_color": "rgb(110, 79, 201)", | ||
"struct_color": "rgb(173, 55, 138)", | ||
"enum_color": "rgb(173, 55, 138)", | ||
"primitive_color": "rgb(173, 55, 138)", | ||
"constant_color": "rgb(56, 115, 173)", | ||
"fn_color": "rgb(173, 124, 55)", | ||
"assoc_type_color": "rgb(56, 115, 173)", | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// edition:2021 | ||
|
||
type TranslateFn = Box<dyn Fn(String, String) -> String>; | ||
|
||
pub struct DeviceCluster { | ||
devices: Vec<Device>, | ||
} | ||
|
||
impl DeviceCluster { | ||
pub async fn do_something(&mut self) -> Result<String, Box<dyn std::error::Error>> { | ||
let mut last_error: Box<dyn std::error::Error>; | ||
|
||
for device in &mut self.devices { | ||
match device.do_something().await { | ||
Ok(info) => { | ||
return Ok(info); | ||
} | ||
Err(e) => {} | ||
} | ||
} | ||
|
||
Err(last_error) | ||
//~^ ERROR used binding `last_error` isn't initialized | ||
} | ||
} | ||
|
||
pub struct Device { | ||
translate_fn: Option<TranslateFn>, | ||
} | ||
|
||
impl Device { | ||
pub async fn do_something(&mut self) -> Result<String, Box<dyn std::error::Error>> { | ||
Ok(String::from("")) | ||
} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0381]: used binding `last_error` isn't initialized | ||
--> $DIR/issue-103250.rs:22:13 | ||
| | ||
LL | let mut last_error: Box<dyn std::error::Error>; | ||
| -------------- binding declared here but left uninitialized | ||
... | ||
LL | Err(last_error) | ||
| ^^^^^^^^^^ `last_error` used here but it isn't initialized | ||
| | ||
help: consider assigning a value | ||
| | ||
LL | let mut last_error: Box<dyn std::error::Error> = todo!(); | ||
| +++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0381`. |
2 changes: 1 addition & 1 deletion
2
src/test/ui/test-attrs/test-fn-signature-verification-for-explicit-return-type.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// run-pass | ||
// ignore-fuchsia Test must be run out-of-process | ||
// needs-unwind (#73509) | ||
|
||
#![feature(test)] | ||
|
||
|