Skip to content

Rollup of 8 pull requests #140043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 47 commits into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
199ee40
Move errors
mejrs Mar 25, 2025
2007c89
Write the format string parserand split it from conditions parser
mejrs Mar 27, 2025
ba9f51b
Parse condition options into a struct
mejrs Mar 27, 2025
8586cad
Documentation and finishing touches
mejrs Mar 29, 2025
9abaa9d
Disable usage on trait impls and aliases
mejrs Mar 29, 2025
10ec5cb
Raise errors on bad rustc_on_unimplemented format strings again
mejrs Mar 29, 2025
40e76c1
Test that `Self` properly works in filters
mejrs Apr 1, 2025
4a5369b
Remove rustc_on_unimplemented on impl tests
mejrs Apr 10, 2025
1c1febc
add new config option: `include`
onur-ozkan Apr 1, 2025
89e3bef
document config extensions
onur-ozkan Mar 25, 2025
4e80659
implement cyclic inclusion handling
onur-ozkan Apr 1, 2025
78cb453
document `include` in `bootstrap.example.toml`
onur-ozkan Apr 1, 2025
3f70f19
apply nit notes
onur-ozkan Apr 1, 2025
8e6f50b
fix path and the ordering logic
onur-ozkan Apr 15, 2025
7dfb457
add FIXME note in `TomlConfig::merge`
onur-ozkan Apr 15, 2025
6d52b51
add comment in `TomlConfig::merge` about the merge order
onur-ozkan Apr 15, 2025
2024e26
Don't canonicalize crate paths
ChrisDenton Apr 15, 2025
52f35d0
Test for relative paths in crate path diagnostics
ChrisDenton Apr 15, 2025
8270478
resolve config include FIXME
onur-ozkan Apr 16, 2025
d14df26
Make `parent` in `download_auto_job_metrics` optional
Kobzol Apr 16, 2025
111c15c
Extract function for normalizing path delimiters to `utils`
Kobzol Apr 16, 2025
c8a882b
Add command to `citool` for generating a test dashboard
Kobzol Apr 17, 2025
a326afd
Add buttons for expanding and collapsing all test suites
Kobzol Apr 17, 2025
4b31033
Add a note about how to find tests that haven't been executed anywhere.
Kobzol Apr 17, 2025
1a6e0d5
Render test revisions separately
Kobzol Apr 17, 2025
d2c1763
Create a macro for rendering test results
Kobzol Apr 17, 2025
aa9cb70
Print number of root tests and subdirectories
Kobzol Apr 17, 2025
08cb187
Turn `test_dashboard` into a file
Kobzol Apr 17, 2025
cecf167
Add a note about the test dashboard to the post-merge report
Kobzol Apr 17, 2025
e882ff4
Don't assemble non-env/bound candidates if projection is rigid
compiler-errors Apr 17, 2025
65ce38a
Add a note that explains the counts
Kobzol Apr 18, 2025
b18e373
Reduce duplicated test prefixes in nested subdirectories
Kobzol Apr 18, 2025
ac7d1be
add coverage on config include logic
onur-ozkan Apr 16, 2025
41ddf86
Make `#[naked]` an unsafe attribute
folkertdev Mar 29, 2025
e0d9244
Sort Unix env constants alphabetically by target_os
thaliaarchi Apr 15, 2025
37712cc
Combine env consts into std::sys::env_consts
thaliaarchi Apr 15, 2025
670ff84
Handle unsupported fallback
thaliaarchi Apr 15, 2025
93fa96c
Use struct update syntax for some TargetOptions
thaliaarchi Apr 18, 2025
3eaa4b9
Cleaned up 4 tests in `tests/ui/issues`
spencer3035 Apr 16, 2025
237064a
Rollup merge of #138934 - onur-ozkan:extended-config-profiles, r=Kobzol
ChrisDenton Apr 19, 2025
aad59a3
Rollup merge of #139091 - mejrs:format, r=compiler-errors
ChrisDenton Apr 19, 2025
1a5e486
Rollup merge of #139753 - folkertdev:naked-function-unsafe-attribute,…
ChrisDenton Apr 19, 2025
688478f
Rollup merge of #139762 - compiler-errors:non-env, r=lcnr
ChrisDenton Apr 19, 2025
2d4f113
Rollup merge of #139834 - ChrisDenton:spf, r=WaffleLapkin
ChrisDenton Apr 19, 2025
709f4fe
Rollup merge of #139868 - thaliaarchi:move-env-consts-pal, r=joboet
ChrisDenton Apr 19, 2025
56cef5c
Rollup merge of #139978 - Kobzol:ci-test-summary, r=jieyouxu
ChrisDenton Apr 19, 2025
f0a0efd
Rollup merge of #139995 - spencer3035:clean-ui-tests-4-of-n, r=jieyouxu
ChrisDenton Apr 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Write the format string parserand split it from conditions parser
  • Loading branch information
mejrs committed Apr 10, 2025
commit 2007c8994db6d46533f84f4697fea5734c6df53d
1 change: 1 addition & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ symbols! {
SyncUnsafeCell,
T,
Target,
This,
ToOwned,
ToString,
TokenStream,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pub mod ambiguity;
pub mod call_kind;
mod fulfillment_errors;
pub mod on_unimplemented;
pub mod on_unimplemented_condition;
pub mod on_unimplemented_format;
mod overflow;
pub mod suggestions;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
use rustc_ast::MetaItemInner;
use rustc_attr_parsing as attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_middle::ty::{self, TyCtxt};
use rustc_parse_format::{ParseMode, Parser, Piece, Position};
use rustc_span::{Span, Symbol, sym};

pub static ALLOWED_CONDITION_SYMBOLS: &[Symbol] = &[
sym::from_desugaring,
sym::direct,
sym::cause,
sym::integral,
sym::integer_,
sym::float,
sym::_Self,
sym::crate_local,
];

#[derive(Debug)]
pub struct Condition {
pub inner: MetaItemInner,
}

impl Condition {
pub fn span(&self) -> Span {
self.inner.span()
}

pub fn matches_predicate<'tcx>(
&self,
tcx: TyCtxt<'tcx>,
options: &[(Symbol, Option<String>)],
options_map: &FxHashMap<Symbol, String>,
) -> bool {
attr::eval_condition(&self.inner, tcx.sess, Some(tcx.features()), &mut |cfg| {
let value = cfg.value.map(|v| {
// `with_no_visible_paths` is also used when generating the options,
// so we need to match it here.
ty::print::with_no_visible_paths!({
let mut parser = Parser::new(v.as_str(), None, None, false, ParseMode::Format);
let constructed_message = (&mut parser)
.map(|p| match p {
Piece::Lit(s) => s.to_owned(),
Piece::NextArgument(a) => match a.position {
Position::ArgumentNamed(arg) => {
let s = Symbol::intern(arg);
match options_map.get(&s) {
Some(val) => val.to_string(),
None => format!("{{{arg}}}"),
}
}
Position::ArgumentImplicitlyIs(_) => String::from("{}"),
Position::ArgumentIs(idx) => format!("{{{idx}}}"),
},
})
.collect();
constructed_message
})
});

options.contains(&(cfg.name, value))
})
}
}
Loading