Skip to content

Commit 8c5605e

Browse files
committed
Auto merge of #152282 - JonathanBrouwer:rollup-EaeQJAR, r=JonathanBrouwer
Rollup of 8 pull requests Successful merges: - #148590 (Stabilize `atomic_try_update`and deprecate `fetch_update` starting 1.99.0) - #150522 (Stabilize new inclusive range type and iterator type) - #152235 (Convert to inline diagnostics in `rustc_parse`) - #152267 (feat: Implement `int_from_ascii` for `NonZero<T>`) - #151576 (Stabilize `core::hint::cold_path`) - #151933 (Linker-plugin-based LTO: give an explanation how to use linker-plugin-lto with full LTO) - #152010 (Ignore all debuginfo tests for LLDB that we do not run in CI) - #152199 (Move `rustc_query_system::cache`.)
2 parents 06cafcb + ae9d2d9 commit 8c5605e

70 files changed

Lines changed: 2004 additions & 2174 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4381,7 +4381,6 @@ dependencies = [
43814381
"rustc_data_structures",
43824382
"rustc_errors",
43834383
"rustc_feature",
4384-
"rustc_fluent_macro",
43854384
"rustc_index",
43864385
"rustc_lexer",
43874386
"rustc_macros",

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ pub fn default_translator() -> Translator {
114114
pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
115115
// tidy-alphabetical-start
116116
rustc_lint::DEFAULT_LOCALE_RESOURCE,
117-
rustc_parse::DEFAULT_LOCALE_RESOURCE,
118117
// tidy-alphabetical-end
119118
];
120119

compiler/rustc_interface/src/interface.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ pub struct Compiler {
5353
pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec<String>) -> Cfg {
5454
cfgs.into_iter()
5555
.map(|s| {
56-
let psess = ParseSess::emitter_with_note(
57-
vec![rustc_parse::DEFAULT_LOCALE_RESOURCE],
58-
format!("this occurred on the command line: `--cfg={s}`"),
59-
);
56+
let psess = ParseSess::emitter_with_note(format!(
57+
"this occurred on the command line: `--cfg={s}`"
58+
));
6059
let filename = FileName::cfg_spec_source_code(&s);
6160

6261
macro_rules! error {
@@ -125,10 +124,9 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
125124
let mut check_cfg = CheckCfg { exhaustive_names, exhaustive_values, ..CheckCfg::default() };
126125

127126
for s in specs {
128-
let psess = ParseSess::emitter_with_note(
129-
vec![rustc_parse::DEFAULT_LOCALE_RESOURCE],
130-
format!("this occurred on the command line: `--check-cfg={s}`"),
131-
);
127+
let psess = ParseSess::emitter_with_note(format!(
128+
"this occurred on the command line: `--check-cfg={s}`"
129+
));
132130
let filename = FileName::cfg_spec_source_code(&s);
133131

134132
const VISIT: &str =

compiler/rustc_macros/src/diagnostics/message.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use fluent_syntax::ast::{Expression, InlineExpression, Pattern, PatternElement};
33
use proc_macro2::{Span, TokenStream};
44
use quote::quote;
55
use syn::Path;
6+
use syn::ext::IdentExt;
67
use synstructure::{Structure, VariantInfo};
78

89
use crate::diagnostics::error::span_err;
@@ -100,7 +101,7 @@ fn verify_fluent_message(msg_span: Span, message_str: &str, variant: Option<&Var
100101
.bindings()
101102
.iter()
102103
.flat_map(|b| b.ast().ident.as_ref())
103-
.map(|id| id.to_string())
104+
.map(|id| id.unraw().to_string())
104105
.collect();
105106
for variable in variable_references(&message) {
106107
if !fields.iter().any(|f| f == variable) {
@@ -155,6 +156,8 @@ const ALLOWED_CAPITALIZED_WORDS: &[&str] = &[
155156
"MIR",
156157
"NaNs",
157158
"OK",
159+
"Rust",
160+
"Unicode",
158161
"VS",
159162
// tidy-alphabetical-end
160163
];
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,23 @@ use rustc_data_structures::sync::Lock;
77

88
use crate::dep_graph::{DepContext, DepNodeIndex};
99

10-
pub struct Cache<Key, Value> {
10+
pub struct WithDepNodeCache<Key, Value> {
1111
hashmap: Lock<FxHashMap<Key, WithDepNode<Value>>>,
1212
}
1313

14-
impl<Key: Clone, Value: Clone> Clone for Cache<Key, Value> {
14+
impl<Key: Clone, Value: Clone> Clone for WithDepNodeCache<Key, Value> {
1515
fn clone(&self) -> Self {
1616
Self { hashmap: Lock::new(self.hashmap.borrow().clone()) }
1717
}
1818
}
1919

20-
impl<Key, Value> Default for Cache<Key, Value> {
20+
impl<Key, Value> Default for WithDepNodeCache<Key, Value> {
2121
fn default() -> Self {
2222
Self { hashmap: Default::default() }
2323
}
2424
}
2525

26-
impl<Key: Eq + Hash, Value: Clone> Cache<Key, Value> {
26+
impl<Key: Eq + Hash, Value: Clone> WithDepNodeCache<Key, Value> {
2727
pub fn get<Tcx: DepContext>(&self, key: &Key, tcx: Tcx) -> Option<Value> {
2828
Some(self.hashmap.borrow().get(key)?.get(tcx))
2929
}

compiler/rustc_middle/src/traits/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//!
33
//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/traits/resolution.html
44
5+
pub mod cache;
56
pub mod query;
67
pub mod select;
78
pub mod solve;

compiler/rustc_middle/src/traits/select.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@
55
use rustc_errors::ErrorGuaranteed;
66
use rustc_hir::def_id::DefId;
77
use rustc_macros::{HashStable, TypeVisitable};
8-
use rustc_query_system::cache::Cache;
98
use rustc_type_ir::solve::AliasBoundKind;
109

1110
use self::EvaluationResult::*;
1211
use super::{SelectionError, SelectionResult};
12+
use crate::traits::cache::WithDepNodeCache;
1313
use crate::ty;
1414

15-
pub type SelectionCache<'tcx, ENV> =
16-
Cache<(ENV, ty::TraitPredicate<'tcx>), SelectionResult<'tcx, SelectionCandidate<'tcx>>>;
15+
pub type SelectionCache<'tcx, ENV> = WithDepNodeCache<
16+
(ENV, ty::TraitPredicate<'tcx>),
17+
SelectionResult<'tcx, SelectionCandidate<'tcx>>,
18+
>;
1719

18-
pub type EvaluationCache<'tcx, ENV> = Cache<(ENV, ty::PolyTraitPredicate<'tcx>), EvaluationResult>;
20+
pub type EvaluationCache<'tcx, ENV> =
21+
WithDepNodeCache<(ENV, ty::PolyTraitPredicate<'tcx>), EvaluationResult>;
1922

2023
/// The selection process begins by considering all impls, where
2124
/// clauses, and so forth that might resolve an obligation. Sometimes

compiler/rustc_middle/src/ty/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use rustc_hir::lang_items::LangItem;
4040
use rustc_hir::limit::Limit;
4141
use rustc_hir::{self as hir, HirId, Node, TraitCandidate, find_attr};
4242
use rustc_index::IndexVec;
43-
use rustc_query_system::cache::WithDepNode;
4443
use rustc_query_system::dep_graph::DepNodeIndex;
4544
use rustc_query_system::ich::StableHashingContext;
4645
use rustc_serialize::opaque::{FileEncodeResult, FileEncoder};
@@ -71,6 +70,7 @@ use crate::query::plumbing::QuerySystem;
7170
use crate::query::{IntoQueryParam, LocalCrate, Providers, TyCtxtAt};
7271
use crate::thir::Thir;
7372
use crate::traits;
73+
use crate::traits::cache::WithDepNode;
7474
use crate::traits::solve::{
7575
self, CanonicalInput, ExternalConstraints, ExternalConstraintsData, PredefinedOpaques,
7676
QueryResult, inspect,

compiler/rustc_parse/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }
1414
rustc_feature = { path = "../rustc_feature" }
15-
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1615
rustc_index = { path = "../rustc_index" }
1716
rustc_lexer = { path = "../rustc_lexer" }
1817
rustc_macros = { path = "../rustc_macros" }

0 commit comments

Comments
 (0)