Skip to content

Commit

Permalink
Auto merge of rust-lang#113271 - matthiaskrgr:rollup-2ik4vaj, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#113253 (Fixed documentation of from<CString> for Rc<CStr>: Arc -> Rc)
 - rust-lang#113258 (Migrate GUI colors test to original CSS color format)
 - rust-lang#113259 (Suggest `x build library` for a custom toolchain that fails to load `core`)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jul 3, 2023
2 parents d5a7424 + 1366ad3 commit 1623634
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
3 changes: 3 additions & 0 deletions compiler/rustc_metadata/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ metadata_conflicting_alloc_error_handler =
metadata_conflicting_global_alloc =
the `#[global_allocator]` in {$other_crate_name} conflicts with global allocator in: {$crate_name}
metadata_consider_adding_std =
consider adding the standard library to the sysroot with `x build library --target {$locator_triple}`
metadata_consider_building_std =
consider building the standard library from source with `cargo build -Zbuild-std`
Expand Down
14 changes: 10 additions & 4 deletions compiler/rustc_metadata/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,12 +646,18 @@ impl IntoDiagnostic<'_> for CannotFindCrate {
} else {
diag.note(fluent::metadata_target_no_std_support);
}
// NOTE: this suggests using rustup, even though the user may not have it installed.
// That's because they could choose to install it; or this may give them a hint which
// target they need to install from their distro.

if self.missing_core {
diag.help(fluent::metadata_consider_downloading_target);
if env!("CFG_RELEASE_CHANNEL") == "dev" {
diag.help(fluent::metadata_consider_adding_std);
} else {
// NOTE: this suggests using rustup, even though the user may not have it installed.
// That's because they could choose to install it; or this may give them a hint which
// target they need to install from their distro.
diag.help(fluent::metadata_consider_downloading_target);
}
}

// Suggest using #![no_std]. #[no_core] is unstable and not really supported anyway.
// NOTE: this is a dummy span if `extern crate std` was injected by the compiler.
// If it's not a dummy, that means someone added `extern crate std` explicitly and
Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ impl From<&CStr> for Arc<CStr> {
#[stable(feature = "shared_from_slice2", since = "1.24.0")]
impl From<CString> for Rc<CStr> {
/// Converts a [`CString`] into an <code>[Rc]<[CStr]></code> by moving the [`CString`]
/// data into a new [`Arc`] buffer.
/// data into a new [`Rc`] buffer.
#[inline]
fn from(s: CString) -> Rc<CStr> {
let rc: Rc<[u8]> = Rc::from(s.into_inner());
Expand Down
30 changes: 15 additions & 15 deletions tests/rustdoc-gui/notable-trait.goml
Original file line number Diff line number Diff line change
Expand Up @@ -175,35 +175,35 @@ call-function: (
"check-colors",
{
"theme": "ayu",
"link_color": "rgb(57, 175, 215)",
"content_color": "rgb(230, 225, 207)",
"header_color": "rgb(255, 255, 255)",
"type_color": "rgb(255, 160, 165)",
"trait_color": "rgb(57, 175, 215)",
"link_color": "#39afd7",
"content_color": "#e6e1cf",
"header_color": "#fff",
"type_color": "#ffa0a5",
"trait_color": "#39afd7",
},
)

call-function: (
"check-colors",
{
"theme": "dark",
"link_color": "rgb(210, 153, 29)",
"content_color": "rgb(221, 221, 221)",
"header_color": "rgb(221, 221, 221)",
"type_color": "rgb(45, 191, 184)",
"trait_color": "rgb(183, 140, 242)",
"link_color": "#d2991d",
"content_color": "#ddd",
"header_color": "#ddd",
"type_color": "#2dbfb8",
"trait_color": "#b78cf2",
},
)

call-function: (
"check-colors",
{
"theme": "light",
"link_color": "rgb(56, 115, 173)",
"content_color": "rgb(0, 0, 0)",
"header_color": "rgb(0, 0, 0)",
"type_color": "rgb(173, 55, 138)",
"trait_color": "rgb(110, 79, 201)",
"link_color": "#3873ad",
"content_color": "black",
"header_color": "black",
"type_color": "#ad378a",
"trait_color": "#6e4fc9",
},
)

Expand Down

0 comments on commit 1623634

Please sign in to comment.