Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2a43428

Browse files
committed
Auto merge of rust-lang#104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#103117 (Use `IsTerminal` in place of `atty`) - rust-lang#103969 (Partial support for running UI tests with `download-rustc`) - rust-lang#103989 (Fix build of std for thumbv7a-pc-windows-msvc) - rust-lang#104076 (fix sysroot issue which appears for ci downloaded rustc) - rust-lang#104469 (Make "long type" printing type aware and trim types in E0275) - rust-lang#104497 (detect () to avoid redundant <> suggestion for type) - rust-lang#104577 (Don't focus on notable trait parent when hiding it) - rust-lang#104587 (Update cargo) - rust-lang#104593 (Improve spans for RPITIT object-safety errors) - rust-lang#104604 (Migrate top buttons style to CSS variables) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 62c627c + f69f4cb commit 2a43428

File tree

64 files changed

+488
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+488
-226
lines changed

Cargo.lock

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ dependencies = [
307307
"glob",
308308
"hex 0.4.2",
309309
"home",
310+
"http-auth",
310311
"humantime 2.0.1",
311312
"ignore",
312313
"im-rc",
@@ -349,11 +350,11 @@ dependencies = [
349350

350351
[[package]]
351352
name = "cargo-credential"
352-
version = "0.1.0"
353+
version = "0.2.0"
353354

354355
[[package]]
355356
name = "cargo-credential-1password"
356-
version = "0.1.0"
357+
version = "0.2.0"
357358
dependencies = [
358359
"cargo-credential",
359360
"serde",
@@ -362,15 +363,15 @@ dependencies = [
362363

363364
[[package]]
364365
name = "cargo-credential-macos-keychain"
365-
version = "0.1.0"
366+
version = "0.2.0"
366367
dependencies = [
367368
"cargo-credential",
368369
"security-framework",
369370
]
370371

371372
[[package]]
372373
name = "cargo-credential-wincred"
373-
version = "0.1.0"
374+
version = "0.2.0"
374375
dependencies = [
375376
"cargo-credential",
376377
"winapi",
@@ -1692,6 +1693,15 @@ dependencies = [
16921693
"syn",
16931694
]
16941695

1696+
[[package]]
1697+
name = "http-auth"
1698+
version = "0.1.6"
1699+
source = "registry+https://github.com/rust-lang/crates.io-index"
1700+
checksum = "c0b40b39d66c28829a0cf4d09f7e139ff8201f7500a5083732848ed3b4b4d850"
1701+
dependencies = [
1702+
"memchr",
1703+
]
1704+
16951705
[[package]]
16961706
name = "humantime"
16971707
version = "1.3.0"
@@ -3535,7 +3545,6 @@ name = "rustc_errors"
35353545
version = "0.0.0"
35363546
dependencies = [
35373547
"annotate-snippets",
3538-
"atty",
35393548
"rustc_ast",
35403549
"rustc_ast_pretty",
35413550
"rustc_data_structures",
@@ -3834,7 +3843,6 @@ dependencies = [
38343843
name = "rustc_log"
38353844
version = "0.0.0"
38363845
dependencies = [
3837-
"atty",
38383846
"rustc_span",
38393847
"tracing",
38403848
"tracing-subscriber",
@@ -4389,7 +4397,6 @@ version = "0.0.0"
43894397
dependencies = [
43904398
"arrayvec",
43914399
"askama",
4392-
"atty",
43934400
"expect-test",
43944401
"itertools",
43954402
"minifier",

compiler/rustc_const_eval/src/transform/check_consts/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<'mir, 'tcx> ConstCx<'mir, 'tcx> {
6262
}
6363

6464
fn is_async(&self) -> bool {
65-
self.tcx.asyncness(self.def_id()) == hir::IsAsync::Async
65+
self.tcx.asyncness(self.def_id()).is_async()
6666
}
6767
}
6868

compiler/rustc_driver/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
//! This API is completely unstable and subject to change.
66
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
8+
#![feature(is_terminal)]
89
#![feature(once_cell)]
910
#![feature(decl_macro)]
1011
#![recursion_limit = "256"]
@@ -27,7 +28,6 @@ use rustc_feature::find_gated_cfg;
2728
use rustc_interface::util::{self, collect_crate_types, get_codegen_backend};
2829
use rustc_interface::{interface, Queries};
2930
use rustc_lint::LintStore;
30-
use rustc_log::stdout_isatty;
3131
use rustc_metadata::locator;
3232
use rustc_save_analysis as save;
3333
use rustc_save_analysis::DumpHandler;
@@ -48,7 +48,7 @@ use std::default::Default;
4848
use std::env;
4949
use std::ffi::OsString;
5050
use std::fs;
51-
use std::io::{self, Read, Write};
51+
use std::io::{self, IsTerminal, Read, Write};
5252
use std::panic::{self, catch_unwind};
5353
use std::path::PathBuf;
5454
use std::process::{self, Command, Stdio};
@@ -515,7 +515,7 @@ fn handle_explain(registry: Registry, code: &str, output: ErrorOutputType) {
515515
}
516516
text.push('\n');
517517
}
518-
if stdout_isatty() {
518+
if io::stdout().is_terminal() {
519519
show_content_with_pager(&text);
520520
} else {
521521
print!("{}", text);

compiler/rustc_errors/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ rustc_target = { path = "../rustc_target" }
1818
rustc_hir = { path = "../rustc_hir" }
1919
rustc_lint_defs = { path = "../rustc_lint_defs" }
2020
unicode-width = "0.1.4"
21-
atty = "0.2"
2221
termcolor = "1.0"
2322
annotate-snippets = "0.9"
2423
termize = "0.1.1"

compiler/rustc_errors/src/emitter.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ use rustc_error_messages::FluentArgs;
2828
use rustc_span::hygiene::{ExpnKind, MacroKind};
2929
use std::borrow::Cow;
3030
use std::cmp::{max, min, Reverse};
31-
use std::io;
3231
use std::io::prelude::*;
32+
use std::io::{self, IsTerminal};
3333
use std::iter;
3434
use std::path::Path;
3535
use termcolor::{Ansi, BufferWriter, ColorChoice, ColorSpec, StandardStream};
@@ -619,14 +619,14 @@ impl ColorConfig {
619619
fn to_color_choice(self) -> ColorChoice {
620620
match self {
621621
ColorConfig::Always => {
622-
if atty::is(atty::Stream::Stderr) {
622+
if io::stderr().is_terminal() {
623623
ColorChoice::Always
624624
} else {
625625
ColorChoice::AlwaysAnsi
626626
}
627627
}
628628
ColorConfig::Never => ColorChoice::Never,
629-
ColorConfig::Auto if atty::is(atty::Stream::Stderr) => ColorChoice::Auto,
629+
ColorConfig::Auto if io::stderr().is_terminal() => ColorChoice::Auto,
630630
ColorConfig::Auto => ColorChoice::Never,
631631
}
632632
}

compiler/rustc_errors/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
66
#![feature(drain_filter)]
77
#![feature(if_let_guard)]
8+
#![feature(is_terminal)]
89
#![feature(adt_const_params)]
910
#![feature(let_chains)]
1011
#![feature(never_type)]

compiler/rustc_hir/src/hir.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,6 +2720,12 @@ pub enum IsAsync {
27202720
NotAsync,
27212721
}
27222722

2723+
impl IsAsync {
2724+
pub fn is_async(self) -> bool {
2725+
self == IsAsync::Async
2726+
}
2727+
}
2728+
27232729
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encodable, Decodable, HashStable_Generic)]
27242730
pub enum Defaultness {
27252731
Default { has_value: bool },

compiler/rustc_hir_analysis/src/check/compare_method.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -684,9 +684,7 @@ fn report_trait_method_mismatch<'tcx>(
684684
// Suggestion to change output type. We do not suggest in `async` functions
685685
// to avoid complex logic or incorrect output.
686686
match tcx.hir().expect_impl_item(impl_m.def_id.expect_local()).kind {
687-
ImplItemKind::Fn(ref sig, _)
688-
if sig.header.asyncness == hir::IsAsync::NotAsync =>
689-
{
687+
ImplItemKind::Fn(ref sig, _) if !sig.header.asyncness.is_async() => {
690688
let msg = "change the output type to match the trait";
691689
let ap = Applicability::MachineApplicable;
692690
match sig.decl.output {

compiler/rustc_hir_typeck/src/method/suggest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,12 +1918,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
19181918
| ty::Str
19191919
| ty::Projection(_)
19201920
| ty::Param(_) => format!("{deref_ty}"),
1921-
// we need to test something like <&[_]>::len
1921+
// we need to test something like <&[_]>::len or <(&[u32])>::len
19221922
// and Vec::function();
1923-
// <&[_]>::len doesn't need an extra "<>" between
1923+
// <&[_]>::len or <&[u32]>::len doesn't need an extra "<>" between
19241924
// but for Adt type like Vec::function()
19251925
// we would suggest <[_]>::function();
1926-
_ if self.tcx.sess.source_map().span_wrapped_by_angle_bracket(ty.span) => format!("{deref_ty}"),
1926+
_ if self.tcx.sess.source_map().span_wrapped_by_angle_or_parentheses(ty.span) => format!("{deref_ty}"),
19271927
_ => format!("<{deref_ty}>"),
19281928
};
19291929
err.span_suggestion_verbose(

compiler/rustc_log/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7-
atty = "0.2"
87
tracing = "0.1.28"
98
tracing-subscriber = { version = "0.3.3", default-features = false, features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"] }
109
tracing-tree = "0.2.0"

0 commit comments

Comments
 (0)