Auto merge of #146938 - matthiaskrgr:rollup-y06ggfz, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang/rust#146632 (Fix uses of "adaptor") - rust-lang/rust#146731 (test: Use SVG for terminal url test) - rust-lang/rust#146775 (fixes for numerous clippy warnings) - rust-lang/rust#146784 ([win] Use find-msvc-tools instead of cc to find the linker and rc on Windows) - rust-lang/rust#146799 (Fix a dangling reference in `rustc_thread_pool`) - rust-lang/rust#146802 (mbe: Simplifications and refactoring) - rust-lang/rust#146806 (add private module override re-export test) - rust-lang/rust#146827 (Linker-plugin-based LTO: update list of good combinations (inc. beta + nightly)) - rust-lang/rust#146875 (tests/run-make/crate-loading: Rename source files for clarity) - rust-lang/rust#146877 (prevent line number from being copied in chrome) r? `@ghost` `@rustbot` modify labels: rollup
@@ -128,9 +128,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anstyle-svg"
|
||||
version = "0.1.10"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc03a770ef506fe1396c0e476120ac0e6523cf14b74218dd5f18cd6833326fa9"
|
||||
checksum = "26b9ec8c976eada1b0f9747a3d7cc4eae3bef10613e443746e7487f26c872fde"
|
||||
dependencies = [
|
||||
"anstyle",
|
||||
"anstyle-lossy",
|
||||
@@ -1332,6 +1332,12 @@ dependencies = [
|
||||
"windows-sys 0.59.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "find-msvc-tools"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.1.2"
|
||||
@@ -3556,7 +3562,7 @@ dependencies = [
|
||||
"ar_archive_writer",
|
||||
"bitflags",
|
||||
"bstr",
|
||||
"cc",
|
||||
"find-msvc-tools",
|
||||
"itertools",
|
||||
"libc",
|
||||
"object 0.37.3",
|
||||
@@ -4760,7 +4766,7 @@ dependencies = [
|
||||
name = "rustc_windows_rc"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"find-msvc-tools",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -8,9 +8,7 @@ edition = "2024"
|
||||
ar_archive_writer = "0.5"
|
||||
bitflags = "2.4.1"
|
||||
bstr = "1.11.3"
|
||||
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
|
||||
# per crate", so if you change this, you need to also change it in `rustc_llvm` and `rustc_windows_rc`.
|
||||
cc = "=1.2.16"
|
||||
find-msvc-tools = "0.1.2"
|
||||
itertools = "0.12"
|
||||
pathdiff = "0.2.0"
|
||||
regex = "1.4"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
use std::process::{Output, Stdio};
|
||||
use std::{env, fmt, fs, io, mem, str};
|
||||
|
||||
use cc::windows_registry;
|
||||
use find_msvc_tools;
|
||||
use itertools::Itertools;
|
||||
use regex::Regex;
|
||||
use rustc_arena::TypedArena;
|
||||
@@ -877,9 +877,9 @@ fn link_natively(
|
||||
// All Microsoft `link.exe` linking ror codes are
|
||||
// four digit numbers in the range 1000 to 9999 inclusive
|
||||
if is_msvc_link_exe && (code < 1000 || code > 9999) {
|
||||
let is_vs_installed = windows_registry::find_vs_version().is_ok();
|
||||
let is_vs_installed = find_msvc_tools::find_vs_version().is_ok();
|
||||
let has_linker =
|
||||
windows_registry::find_tool(&sess.target.arch, "link.exe").is_some();
|
||||
find_msvc_tools::find_tool(&sess.target.arch, "link.exe").is_some();
|
||||
|
||||
sess.dcx().emit_note(errors::LinkExeUnexpectedError);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::{env, io, iter, mem, str};
|
||||
|
||||
use cc::windows_registry;
|
||||
use find_msvc_tools;
|
||||
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
|
||||
use rustc_metadata::{
|
||||
find_native_static_library, try_find_native_dynamic_library, try_find_native_static_library,
|
||||
@@ -53,7 +53,7 @@ pub(crate) fn get_linker<'a>(
|
||||
self_contained: bool,
|
||||
target_cpu: &'a str,
|
||||
) -> Box<dyn Linker + 'a> {
|
||||
let msvc_tool = windows_registry::find_tool(&sess.target.arch, "link.exe");
|
||||
let msvc_tool = find_msvc_tools::find_tool(&sess.target.arch, "link.exe");
|
||||
|
||||
// If our linker looks like a batch script on Windows then to execute this
|
||||
// we'll need to spawn `cmd` explicitly. This is primarily done to handle
|
||||
@@ -117,7 +117,6 @@ pub(crate) fn get_linker<'a>(
|
||||
if sess.target.is_like_msvc
|
||||
&& let Some(ref tool) = msvc_tool
|
||||
{
|
||||
cmd.args(tool.args());
|
||||
for (k, v) in tool.env() {
|
||||
if k == "PATH" {
|
||||
new_path.extend(env::split_paths(v));
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
use rustc_errors::{Applicability, PResult};
|
||||
use rustc_macros::{Decodable, Encodable};
|
||||
use rustc_session::parse::ParseSess;
|
||||
use rustc_span::{Ident, Span, Symbol};
|
||||
use rustc_span::{Ident, Span, Symbol, sym};
|
||||
|
||||
use crate::errors;
|
||||
|
||||
@@ -69,15 +69,15 @@ pub(crate) fn parse<'psess>(
|
||||
}
|
||||
|
||||
let mut iter = args.iter();
|
||||
let rslt = match ident.as_str() {
|
||||
"concat" => parse_concat(&mut iter, psess, outer_span, ident.span)?,
|
||||
"count" => parse_count(&mut iter, psess, ident.span)?,
|
||||
"ignore" => {
|
||||
let rslt = match ident.name {
|
||||
sym::concat => parse_concat(&mut iter, psess, outer_span, ident.span)?,
|
||||
sym::count => parse_count(&mut iter, psess, ident.span)?,
|
||||
sym::ignore => {
|
||||
eat_dollar(&mut iter, psess, ident.span)?;
|
||||
MetaVarExpr::Ignore(parse_ident(&mut iter, psess, ident.span)?)
|
||||
}
|
||||
"index" => MetaVarExpr::Index(parse_depth(&mut iter, psess, ident.span)?),
|
||||
"len" => MetaVarExpr::Len(parse_depth(&mut iter, psess, ident.span)?),
|
||||
sym::index => MetaVarExpr::Index(parse_depth(&mut iter, psess, ident.span)?),
|
||||
sym::len => MetaVarExpr::Len(parse_depth(&mut iter, psess, ident.span)?),
|
||||
_ => {
|
||||
let err = errors::MveUnrecognizedExpr {
|
||||
span: ident.span,
|
||||
@@ -119,14 +119,13 @@ fn check_trailing_tokens<'psess>(
|
||||
}
|
||||
|
||||
// `None` for max indicates the arg count must be exact, `Some` indicates a range is accepted.
|
||||
let (min_or_exact_args, max_args) = match ident.as_str() {
|
||||
"concat" => panic!("concat takes unlimited tokens but didn't eat them all"),
|
||||
"ignore" => (1, None),
|
||||
let (min_or_exact_args, max_args) = match ident.name {
|
||||
sym::concat => panic!("concat takes unlimited tokens but didn't eat them all"),
|
||||
sym::ignore => (1, None),
|
||||
// 1 or 2 args
|
||||
"count" => (1, Some(2)),
|
||||
sym::count => (1, Some(2)),
|
||||
// 0 or 1 arg
|
||||
"index" => (0, Some(1)),
|
||||
"len" => (0, Some(1)),
|
||||
sym::index | sym::len => (0, Some(1)),
|
||||
other => unreachable!("unknown MVEs should be rejected earlier (got `{other}`)"),
|
||||
};
|
||||
|
||||
|
||||
@@ -375,6 +375,19 @@ fn transcribe_metavar<'tx>(
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
let MatchedSingle(pnr) = cur_matched else {
|
||||
// We were unable to descend far enough. This is an error.
|
||||
return Err(dcx.create_err(MacroVarStillRepeating { span: sp, ident }));
|
||||
};
|
||||
|
||||
transcribe_pnr(tscx, sp, pnr)
|
||||
}
|
||||
|
||||
fn transcribe_pnr<'tx>(
|
||||
tscx: &mut TranscrCtx<'tx, '_>,
|
||||
mut sp: Span,
|
||||
pnr: &ParseNtResult,
|
||||
) -> PResult<'tx, ()> {
|
||||
// We wrap the tokens in invisible delimiters, unless they are already wrapped
|
||||
// in invisible delimiters with the same `MetaVarKind`. Because some proc
|
||||
// macros can't handle multiple layers of invisible delimiters of the same
|
||||
@@ -404,33 +417,33 @@ fn transcribe_metavar<'tx>(
|
||||
)
|
||||
};
|
||||
|
||||
let tt = match cur_matched {
|
||||
MatchedSingle(ParseNtResult::Tt(tt)) => {
|
||||
let tt = match pnr {
|
||||
ParseNtResult::Tt(tt) => {
|
||||
// `tt`s are emitted into the output stream directly as "raw tokens",
|
||||
// without wrapping them into groups. Other variables are emitted into
|
||||
// the output stream as groups with `Delimiter::Invisible` to maintain
|
||||
// parsing priorities.
|
||||
maybe_use_metavar_location(tscx.psess, &tscx.stack, sp, tt, &mut tscx.marker)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Ident(ident, is_raw)) => {
|
||||
ParseNtResult::Ident(ident, is_raw) => {
|
||||
tscx.marker.mark_span(&mut sp);
|
||||
with_metavar_spans(|mspans| mspans.insert(ident.span, sp));
|
||||
let kind = token::NtIdent(*ident, *is_raw);
|
||||
TokenTree::token_alone(kind, sp)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Lifetime(ident, is_raw)) => {
|
||||
ParseNtResult::Lifetime(ident, is_raw) => {
|
||||
tscx.marker.mark_span(&mut sp);
|
||||
with_metavar_spans(|mspans| mspans.insert(ident.span, sp));
|
||||
let kind = token::NtLifetime(*ident, *is_raw);
|
||||
TokenTree::token_alone(kind, sp)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Item(item)) => {
|
||||
ParseNtResult::Item(item) => {
|
||||
mk_delimited(item.span, MetaVarKind::Item, TokenStream::from_ast(item))
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Block(block)) => {
|
||||
ParseNtResult::Block(block) => {
|
||||
mk_delimited(block.span, MetaVarKind::Block, TokenStream::from_ast(block))
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Stmt(stmt)) => {
|
||||
ParseNtResult::Stmt(stmt) => {
|
||||
let stream = if let StmtKind::Empty = stmt.kind {
|
||||
// FIXME: Properly collect tokens for empty statements.
|
||||
TokenStream::token_alone(token::Semi, stmt.span)
|
||||
@@ -439,10 +452,10 @@ fn transcribe_metavar<'tx>(
|
||||
};
|
||||
mk_delimited(stmt.span, MetaVarKind::Stmt, stream)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Pat(pat, pat_kind)) => {
|
||||
ParseNtResult::Pat(pat, pat_kind) => {
|
||||
mk_delimited(pat.span, MetaVarKind::Pat(*pat_kind), TokenStream::from_ast(pat))
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Expr(expr, kind)) => {
|
||||
ParseNtResult::Expr(expr, kind) => {
|
||||
let (can_begin_literal_maybe_minus, can_begin_string_literal) = match &expr.kind {
|
||||
ExprKind::Lit(_) => (true, true),
|
||||
ExprKind::Unary(UnOp::Neg, e) if matches!(&e.kind, ExprKind::Lit(_)) => {
|
||||
@@ -460,14 +473,14 @@ fn transcribe_metavar<'tx>(
|
||||
TokenStream::from_ast(expr),
|
||||
)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Literal(lit)) => {
|
||||
ParseNtResult::Literal(lit) => {
|
||||
mk_delimited(lit.span, MetaVarKind::Literal, TokenStream::from_ast(lit))
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Ty(ty)) => {
|
||||
ParseNtResult::Ty(ty) => {
|
||||
let is_path = matches!(&ty.kind, TyKind::Path(None, _path));
|
||||
mk_delimited(ty.span, MetaVarKind::Ty { is_path }, TokenStream::from_ast(ty))
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Meta(attr_item)) => {
|
||||
ParseNtResult::Meta(attr_item) => {
|
||||
let has_meta_form = attr_item.meta_kind().is_some();
|
||||
mk_delimited(
|
||||
attr_item.span(),
|
||||
@@ -475,16 +488,12 @@ fn transcribe_metavar<'tx>(
|
||||
TokenStream::from_ast(attr_item),
|
||||
)
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Path(path)) => {
|
||||
ParseNtResult::Path(path) => {
|
||||
mk_delimited(path.span, MetaVarKind::Path, TokenStream::from_ast(path))
|
||||
}
|
||||
MatchedSingle(ParseNtResult::Vis(vis)) => {
|
||||
ParseNtResult::Vis(vis) => {
|
||||
mk_delimited(vis.span, MetaVarKind::Vis, TokenStream::from_ast(vis))
|
||||
}
|
||||
MatchedSeq(..) => {
|
||||
// We were unable to descend far enough. This is an error.
|
||||
return Err(dcx.create_err(MacroVarStillRepeating { span: sp, ident }));
|
||||
}
|
||||
};
|
||||
|
||||
tscx.result.push(tt);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
https://doc.rust-lang.org/reference/types.html#trait-objects";
|
||||
|
||||
fn is_number(text: &str) -> bool {
|
||||
text.chars().all(|c: char| c.is_digit(10))
|
||||
text.chars().all(|c: char| c.is_ascii_digit())
|
||||
}
|
||||
|
||||
/// Information about the expected type at the top level of type checking a pattern.
|
||||
@@ -262,8 +262,9 @@ enum InheritedRefMatchRule {
|
||||
/// pattern matches a given type:
|
||||
/// - If the underlying type is not a reference, a reference pattern may eat the inherited reference;
|
||||
/// - If the underlying type is a reference, a reference pattern matches if it can eat either one
|
||||
/// of the underlying and inherited references. E.g. a `&mut` pattern is allowed if either the
|
||||
/// underlying type is `&mut` or the inherited reference is `&mut`.
|
||||
/// of the underlying and inherited references. E.g. a `&mut` pattern is allowed if either the
|
||||
/// underlying type is `&mut` or the inherited reference is `&mut`.
|
||||
///
|
||||
/// If `false`, a reference pattern is only matched against the underlying type.
|
||||
/// This is `false` for stable Rust and `true` for both the `ref_pat_eat_one_layer_2024` and
|
||||
/// `ref_pat_eat_one_layer_2024_structural` feature gates.
|
||||
@@ -1069,7 +1070,7 @@ fn check_pat_ident(
|
||||
{
|
||||
if !self.tcx.features().mut_ref() {
|
||||
feature_err(
|
||||
&self.tcx.sess,
|
||||
self.tcx.sess,
|
||||
sym::mut_ref,
|
||||
pat.span.until(ident.span),
|
||||
"binding cannot be both mutable and by-reference",
|
||||
@@ -1487,31 +1488,24 @@ fn maybe_suggest_range_literal(
|
||||
opt_def_id: Option<hir::def_id::DefId>,
|
||||
ident: Ident,
|
||||
) -> bool {
|
||||
match opt_def_id {
|
||||
Some(def_id) => match self.tcx.hir_get_if_local(def_id) {
|
||||
Some(hir::Node::Item(hir::Item {
|
||||
kind: hir::ItemKind::Const(_, _, _, body_id),
|
||||
..
|
||||
})) => match self.tcx.hir_node(body_id.hir_id) {
|
||||
hir::Node::Expr(expr) => {
|
||||
if hir::is_range_literal(expr) {
|
||||
let span = self.tcx.hir_span(body_id.hir_id);
|
||||
if let Ok(snip) = self.tcx.sess.source_map().span_to_snippet(span) {
|
||||
e.span_suggestion_verbose(
|
||||
ident.span,
|
||||
"you may want to move the range into the match block",
|
||||
snip,
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => (),
|
||||
},
|
||||
_ => (),
|
||||
},
|
||||
_ => (),
|
||||
if let Some(def_id) = opt_def_id
|
||||
&& let Some(hir::Node::Item(hir::Item {
|
||||
kind: hir::ItemKind::Const(_, _, _, body_id),
|
||||
..
|
||||
})) = self.tcx.hir_get_if_local(def_id)
|
||||
&& let hir::Node::Expr(expr) = self.tcx.hir_node(body_id.hir_id)
|
||||
&& hir::is_range_literal(expr)
|
||||
{
|
||||
let span = self.tcx.hir_span(body_id.hir_id);
|
||||
if let Ok(snip) = self.tcx.sess.source_map().span_to_snippet(span) {
|
||||
e.span_suggestion_verbose(
|
||||
ident.span,
|
||||
"you may want to move the range into the match block",
|
||||
snip,
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
@@ -1529,7 +1523,7 @@ fn emit_bad_pat_path(
|
||||
|
||||
if let Some(span) = self.tcx.hir_res_span(pat_res) {
|
||||
e.span_label(span, format!("{} defined here", res.descr()));
|
||||
if let [hir::PathSegment { ident, .. }] = &*segments {
|
||||
if let [hir::PathSegment { ident, .. }] = segments {
|
||||
e.span_label(
|
||||
pat_span,
|
||||
format!(
|
||||
@@ -1557,17 +1551,17 @@ fn emit_bad_pat_path(
|
||||
_ => (None, None),
|
||||
};
|
||||
|
||||
let is_range = match type_def_id.and_then(|id| self.tcx.as_lang_item(id)) {
|
||||
let is_range = matches!(
|
||||
type_def_id.and_then(|id| self.tcx.as_lang_item(id)),
|
||||
Some(
|
||||
LangItem::Range
|
||||
| LangItem::RangeFrom
|
||||
| LangItem::RangeTo
|
||||
| LangItem::RangeFull
|
||||
| LangItem::RangeInclusiveStruct
|
||||
| LangItem::RangeToInclusive,
|
||||
) => true,
|
||||
_ => false,
|
||||
};
|
||||
| LangItem::RangeFrom
|
||||
| LangItem::RangeTo
|
||||
| LangItem::RangeFull
|
||||
| LangItem::RangeInclusiveStruct
|
||||
| LangItem::RangeToInclusive,
|
||||
)
|
||||
);
|
||||
if is_range {
|
||||
if !self.maybe_suggest_range_literal(&mut e, item_def_id, *ident) {
|
||||
let msg = "constants only support matching by type, \
|
||||
|
||||
@@ -10,8 +10,7 @@ libc = "0.2.73"
|
||||
|
||||
[build-dependencies]
|
||||
# tidy-alphabetical-start
|
||||
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
|
||||
# per crate", so if you change this, you need to also change it in `rustc_codegen_ssa` and `rustc_windows_rc`.
|
||||
# `cc` updates often break things, so we pin it here.
|
||||
cc = "=1.2.16"
|
||||
# tidy-alphabetical-end
|
||||
|
||||
|
||||
@@ -388,13 +388,17 @@ impl Latch for CountLatch {
|
||||
#[inline]
|
||||
unsafe fn set(this: *const Self) {
|
||||
if unsafe { (*this).counter.fetch_sub(1, Ordering::SeqCst) == 1 } {
|
||||
// NOTE: Once we call `set` on the internal `latch`,
|
||||
// SAFETY: Once we call `set` on the internal `latch`,
|
||||
// the target may proceed and invalidate `this`!
|
||||
match unsafe { &(*this).kind } {
|
||||
CountLatchKind::Stealing { latch, registry, worker_index } => {
|
||||
let registry = Arc::clone(registry);
|
||||
let worker_index = *worker_index;
|
||||
// SAFETY: We don't use any references from `this` after this call.
|
||||
if unsafe { CoreLatch::set(latch) } {
|
||||
registry.notify_worker_latch_is_set(*worker_index);
|
||||
// We **must not** access any part of `this` anymore, which
|
||||
// is why we read and shadowed these fields beforehand.
|
||||
registry.notify_worker_latch_is_set(worker_index);
|
||||
}
|
||||
}
|
||||
CountLatchKind::Blocking { latch } => unsafe { LockLatch::set(latch) },
|
||||
|
||||
@@ -5,7 +5,5 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
#tidy-alphabetical-start
|
||||
# `cc` updates often break things, so we pin it here. Cargo enforces "max 1 semver-compat version
|
||||
# per crate", so if you change this, you need to also change it in `rustc_llvm` and `rustc_codegen_ssa`.
|
||||
cc = "=1.2.16"
|
||||
find-msvc-tools = "0.1.2"
|
||||
#tidy-alphabetical-end
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
//!
|
||||
//! Uses values from the `CFG_VERSION` and `CFG_RELEASE` environment variables
|
||||
//! to set the product and file version information in the Windows resource file.
|
||||
use std::{env, ffi, fs, path, process};
|
||||
|
||||
use cc::windows_registry;
|
||||
use std::{env, fs, path, process};
|
||||
|
||||
/// The template for the Windows resource file.
|
||||
const RESOURCE_TEMPLATE: &str = include_str!("../rustc.rc.in");
|
||||
@@ -38,7 +36,10 @@ pub fn compile_windows_resource_file(
|
||||
let resource_compiler = if let Ok(path) = env::var("RUSTC_WINDOWS_RC") {
|
||||
path.into()
|
||||
} else {
|
||||
find_resource_compiler(&env::var("CARGO_CFG_TARGET_ARCH").unwrap()).expect("found rc.exe")
|
||||
find_msvc_tools::find_tool(&env::var("CARGO_CFG_TARGET_ARCH").unwrap(), "rc.exe")
|
||||
.expect("found rc.exe")
|
||||
.path()
|
||||
.to_owned()
|
||||
};
|
||||
|
||||
let rc_path = resources_dir.join(file_stem.with_extension("rc"));
|
||||
@@ -134,28 +135,3 @@ fn parse_version(version: &str) -> Option<ResourceVersion> {
|
||||
Some(ResourceVersion { major, minor, patch, build: 0 })
|
||||
}
|
||||
}
|
||||
|
||||
/// Find the Windows SDK resource compiler `rc.exe` for the given architecture or target triple.
|
||||
/// Returns `None` if the tool could not be found.
|
||||
fn find_resource_compiler(arch_or_target: &str) -> Option<path::PathBuf> {
|
||||
find_windows_sdk_tool(arch_or_target, "rc.exe")
|
||||
}
|
||||
|
||||
/// Find a Windows SDK tool for the given architecture or target triple.
|
||||
/// Returns `None` if the tool could not be found.
|
||||
fn find_windows_sdk_tool(arch_or_target: &str, tool_name: &str) -> Option<path::PathBuf> {
|
||||
// windows_registry::find_tool can only find MSVC tools, not Windows SDK tools, but
|
||||
// cc does include the Windows SDK tools in the PATH environment of MSVC tools.
|
||||
|
||||
let msvc_linker = windows_registry::find_tool(arch_or_target, "link.exe")?;
|
||||
let path = &msvc_linker.env().iter().find(|(k, _)| k == "PATH")?.1;
|
||||
find_tool_in_path(tool_name, path)
|
||||
}
|
||||
|
||||
/// Find a tool in the directories in a given PATH-like string.
|
||||
fn find_tool_in_path<P: AsRef<ffi::OsStr>>(tool_name: &str, path: P) -> Option<path::PathBuf> {
|
||||
env::split_paths(path.as_ref()).find_map(|p| {
|
||||
let tool_path = p.join(tool_name);
|
||||
if tool_path.try_exists().unwrap_or(false) { Some(tool_path) } else { None }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -779,7 +779,7 @@ impl<T> OneShot for result::IterMut<'_, T> {}
|
||||
impl<T> OneShot for Empty<T> {}
|
||||
impl<T> OneShot for array::IntoIter<T, 0> {}
|
||||
|
||||
// These adaptors never increase the number of items.
|
||||
// These adapters never increase the number of items.
|
||||
// (There are more possible, but for now this matches BoundedSize above.)
|
||||
impl<I: OneShot> OneShot for Cloned<I> {}
|
||||
impl<I: OneShot> OneShot for Copied<I> {}
|
||||
|
||||
@@ -1081,7 +1081,7 @@ fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<()> {
|
||||
default_read_buf_exact(self, cursor)
|
||||
}
|
||||
|
||||
/// Creates a "by reference" adaptor for this instance of `Read`.
|
||||
/// Creates a "by reference" adapter for this instance of `Read`.
|
||||
///
|
||||
/// The returned adapter also implements `Read` and will simply borrow this
|
||||
/// current reader.
|
||||
|
||||
@@ -144,7 +144,7 @@ def minor_version(version):
|
||||
INSTALL_TOOLCHAIN = ["rustup", "toolchain", "install", "--profile", "minimal"]
|
||||
subprocess.run(INSTALL_TOOLCHAIN + ["nightly"])
|
||||
|
||||
LOWER_BOUND = 73
|
||||
LOWER_BOUND = 87
|
||||
NIGHTLY_VERSION = minor_version(subprocess.run(
|
||||
["rustc", "+nightly", "--version"],
|
||||
capture_output=True,
|
||||
@@ -201,6 +201,9 @@ The following table shows known good combinations of toolchain versions.
|
||||
| 1.65 - 1.69 | 15 |
|
||||
| 1.70 - 1.72 | 16 |
|
||||
| 1.73 - 1.77 | 17 |
|
||||
| 1.78 | 18 |
|
||||
| 1.78 - 1.81 | 18 |
|
||||
| 1.82 - 1.86 | 19 |
|
||||
| 1.87 - 1.90 | 20 |
|
||||
| 1.91 - 1.92 | 21 |
|
||||
|
||||
Note that the compatibility policy for this feature might change in the future.
|
||||
|
||||
@@ -2227,11 +2227,18 @@ function preLoadCss(cssUrl) {
|
||||
});
|
||||
}());
|
||||
|
||||
// This section is a bugfix for firefox: when copying text with `user-select: none`, it adds
|
||||
// extra backline characters.
|
||||
|
||||
// Workaround for browser-specific bugs when copying code snippets.
|
||||
//
|
||||
// Rustdoc issue: Workaround for https://github.com/rust-lang/rust/issues/141464
|
||||
// Firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1273836
|
||||
// * In Firefox, copying text that includes elements with `user-select: none`
|
||||
// inserts extra blank lines.
|
||||
// - Firefox issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1273836
|
||||
// - Rust issue: https://github.com/rust-lang/rust/issues/141464
|
||||
//
|
||||
// * In Chromium-based browsers, `document.getSelection()` includes elements
|
||||
// with `user-select: none`, causing unwanted line numbers to be copied.
|
||||
// - Chromium issue: https://issues.chromium.org/issues/446539520
|
||||
// - Rust issue: https://github.com/rust-lang/rust/issues/146816
|
||||
(function() {
|
||||
document.body.addEventListener("copy", event => {
|
||||
let target = nonnull(event.target);
|
||||
@@ -2248,9 +2255,13 @@ function preLoadCss(cssUrl) {
|
||||
if (!isInsideCode) {
|
||||
return;
|
||||
}
|
||||
const selection = document.getSelection();
|
||||
// @ts-expect-error
|
||||
nonnull(event.clipboardData).setData("text/plain", selection.toString());
|
||||
const selection = nonnull(document.getSelection());
|
||||
const text = Array.from({ length: selection.rangeCount }, (_, i) => {
|
||||
const fragment = selection.getRangeAt(i).cloneContents();
|
||||
fragment.querySelectorAll("[data-nosnippet]").forEach(el => el.remove());
|
||||
return fragment.textContent;
|
||||
}).join("");
|
||||
nonnull(event.clipboardData).setData("text/plain", text);
|
||||
event.preventDefault();
|
||||
});
|
||||
}());
|
||||
|
||||
@@ -12,7 +12,7 @@ path = "src/bin/main.rs"
|
||||
|
||||
[dependencies]
|
||||
# tidy-alphabetical-start
|
||||
anstyle-svg = "0.1.3"
|
||||
anstyle-svg = "0.1.11"
|
||||
build_helper = { path = "../../build_helper" }
|
||||
camino = "1"
|
||||
colored = "2"
|
||||
|
||||
@@ -367,6 +367,7 @@ macro_rules! location {
|
||||
"expect-test",
|
||||
"fallible-iterator", // dependency of `thorin`
|
||||
"fastrand",
|
||||
"find-msvc-tools",
|
||||
"flate2",
|
||||
"fluent-bundle",
|
||||
"fluent-langneg",
|
||||
|
||||
@@ -6,12 +6,9 @@
|
||||
use run_make_support::{diff, rust_lib_name, rustc};
|
||||
|
||||
fn main() {
|
||||
rustc().input("multiple-dep-versions-1.rs").run();
|
||||
rustc().input("multiple-dep-versions-2.rs").extra_filename("2").metadata("2").run();
|
||||
rustc()
|
||||
.input("multiple-dep-versions-3.rs")
|
||||
.extern_("dependency", rust_lib_name("dependency2"))
|
||||
.run();
|
||||
rustc().input("dependency-1.rs").run();
|
||||
rustc().input("dependency-2.rs").extra_filename("2").metadata("2").run();
|
||||
rustc().input("dep-2-reexport.rs").extern_("dependency", rust_lib_name("dependency2")).run();
|
||||
|
||||
let out = rustc()
|
||||
.input("multiple-dep-versions.rs")
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// https://github.com/rust-lang/rust/issues/60926
|
||||
#![crate_name = "foo"]
|
||||
|
||||
mod m1 {
|
||||
pub mod m2 {
|
||||
pub struct Foo;
|
||||
}
|
||||
}
|
||||
|
||||
pub use m1::*;
|
||||
use crate::m1::m2;
|
||||
|
||||
//@ count foo/index.html '//a[@class="mod"]' 0
|
||||
@@ -1,7 +1,7 @@
|
||||
<svg width="743px" height="758px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="740px" height="758px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
.container {
|
||||
|
||||
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="743px" height="758px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="740px" height="758px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
.container {
|
||||
|
||||
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="750px" height="74px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="740px" height="74px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-yellow { fill: #AA5500 }
|
||||
.container {
|
||||
padding: 0 10px;
|
||||
|
||||
|
Before Width: | Height: | Size: 817 B After Width: | Height: | Size: 811 B |
@@ -1,4 +1,4 @@
|
||||
//@ compile-flags: -Zterminal-urls=yes
|
||||
//@ compile-flags: -Zterminal-urls=yes --error-format=human --color=always
|
||||
fn main() {
|
||||
let () = 4; //~ ERROR
|
||||
let () = 4;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
error[]8;;https://doc.rust-lang.org/error_codes/E0308.htmlE0308]8;;]: mismatched types
|
||||
--> $DIR/terminal_urls.rs:3:9
|
||||
|
|
||||
LL | let () = 4;
|
||||
| ^^ - this expression has type `{integer}`
|
||||
| |
|
||||
| expected integer, found `()`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
@@ -0,0 +1,48 @@
|
||||
<svg width="740px" height="236px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
.container {
|
||||
padding: 0 10px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.bold { font-weight: bold; }
|
||||
tspan {
|
||||
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
|
||||
white-space: pre;
|
||||
line-height: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||
|
||||
<text xml:space="preserve" class="container fg">
|
||||
<tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[</tspan><tspan class="fg-ansi256-009 bold"><a href="https://doc.rust-lang.org/error_codes/E0308.html">E0308</a></tspan><tspan class="fg-ansi256-009 bold">]</tspan><tspan class="bold">: mismatched types</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/terminal_urls.rs:3:9</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="82px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> let () = 4;</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">-</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">this expression has type `{integer}`</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">expected integer, found `()`</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="154px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="172px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="bold">: aborting due to 1 previous error</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="190px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="208px"><tspan class="bold">For more information about this error, try `rustc --explain E0308`.</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="226px">
|
||||
</tspan>
|
||||
</text>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,49 @@
|
||||
<svg width="740px" height="236px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-014 { fill: #55FFFF }
|
||||
.fg-ansi256-015 { fill: #FFFFFF }
|
||||
.container {
|
||||
padding: 0 10px;
|
||||
line-height: 18px;
|
||||
}
|
||||
.bold { font-weight: bold; }
|
||||
tspan {
|
||||
font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
|
||||
white-space: pre;
|
||||
line-height: 18px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
|
||||
|
||||
<text xml:space="preserve" class="container fg">
|
||||
<tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[</tspan><tspan class="fg-ansi256-009 bold"><a href="https://doc.rust-lang.org/error_codes/E0308.html">E0308</a></tspan><tspan class="fg-ansi256-009 bold">]</tspan><tspan class="fg-ansi256-015 bold">: mismatched types</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-ansi256-014 bold">--> </tspan><tspan>$DIR/terminal_urls.rs:3:9</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-ansi256-014 bold">|</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="82px"><tspan class="fg-ansi256-014 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan> let () = 4;</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^</tspan><tspan> </tspan><tspan class="fg-ansi256-014 bold">-</tspan><tspan> </tspan><tspan class="fg-ansi256-014 bold">this expression has type `{integer}`</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">|</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-ansi256-014 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">expected integer, found `()`</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="154px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="172px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="fg-ansi256-015 bold">: aborting due to 1 previous error</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="190px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="208px"><tspan class="fg-ansi256-015 bold">For more information about this error, try `rustc --explain E0308`.</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="226px">
|
||||
</tspan>
|
||||
</text>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="740px" height="668px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
.fg-magenta { fill: #AA00AA }
|
||||
|
||||
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="785px" height="434px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="785px" height="434px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-014 { fill: #55FFFF }
|
||||
|
||||
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="1306px" height="866px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 8.9 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="1306px" height="866px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-014 { fill: #55FFFF }
|
||||
|
||||
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="2238px" height="3890px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="2288px" height="3890px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
|
||||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="785px" height="434px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
|
||||
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
@@ -1,7 +1,7 @@
|
||||
<svg width="1188px" height="398px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="1096px" height="398px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
@@ -2,7 +2,7 @@
|
||||
|
||||
//! This snippet causes the type length to blowup exponentially,
|
||||
//! so check that we don't accidentally exceed the type length limit.
|
||||
// FIXME: Once the size of iterator adaptors is further reduced,
|
||||
// FIXME: Once the size of iterator adapters is further reduced,
|
||||
// increase the complexity of this test.
|
||||
use std::collections::VecDeque;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<svg width="886px" height="9524px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
.bg { fill: #000000 }
|
||||
.fg-ansi256-009 { fill: #FF5555 }
|
||||
.fg-ansi256-010 { fill: #55FF55 }
|
||||
.fg-ansi256-012 { fill: #5555FF }
|
||||
|
||||
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 82 KiB |
@@ -1,7 +1,7 @@
|
||||
//@ compile-flags: -Znext-solver
|
||||
//@ check-pass
|
||||
|
||||
// Fixes a regression in icu_provider_adaptors where we weren't normalizing the
|
||||
// Fixes a regression in icu_provider_adapters where we weren't normalizing the
|
||||
// return type of a function type before performing a `Ty::builtin_deref` call,
|
||||
// leading to an ICE.
|
||||
|
||||
|
||||