Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b4781c8
Use default field values in a few more cases
estebank Jan 15, 2026
996d72b
compiletest: Support `--extern` modifiers with `proc-macro` directive
Enselic Jan 17, 2026
0271b6b
regression test for alias-relate changes in lub
jdonszelmann Jan 30, 2026
8c0d93b
Skip overlapping spans in argument error suggestions
chenyukang Jan 31, 2026
caaee92
more float constants: sqrt(5), 1/sqrt(5)
joshuarayton Sep 23, 2025
cd1c773
Remove `lift_query_info`.
nnethercote Jan 30, 2026
4ff360e
Rename some query-related things.
nnethercote Jan 30, 2026
8e2c9c6
Eliminate some `'a` lifetimes.
nnethercote Jan 30, 2026
c6afd45
Move `depth_limit_error` out of `QueryContext` trait.
nnethercote Feb 1, 2026
59868c1
Fix uninitialized UEFI globals in tests
nicholasbishop Jan 23, 2026
09de0fd
Use `#![feature(adt_const_params)]` for static query flags
Zalathar Jan 30, 2026
c725637
explain why we dont skip some of this work when there are field proje…
RalfJung Feb 2, 2026
c0393cf
resolve: Report more early resolution ambiguities for imports
petrochenkov Oct 24, 2025
629ff9b
Update tests/ui/traits/next-solver/generalize/relate-alias-in-lub.rs
jdonszelmann Feb 2, 2026
82a530c
Port
crazazy Feb 2, 2026
c63ef81
Rollup merge of #149596 - petrochenkov:visambig2, r=yaahc
JonathanBrouwer Feb 2, 2026
0486548
Rollup merge of #151695 - Enselic:proc-macro-priv-v2, r=Zalathar
JonathanBrouwer Feb 2, 2026
d8c7b74
Rollup merge of #151938 - Zalathar:adt-query-flags, r=nnethercote
JonathanBrouwer Feb 2, 2026
1fc4260
Rollup merge of #151172 - estebank:default-field-values, r=dianne
JonathanBrouwer Feb 2, 2026
81af082
Rollup merge of #151825 - joshuarayton:more-float-constants, r=tgross35
JonathanBrouwer Feb 2, 2026
d0c8bc2
Rollup merge of #151870 - jdonszelmann:regression-test-alias-relate, …
JonathanBrouwer Feb 2, 2026
d856522
Rollup merge of #151902 - RalfJung:place-ty-opt, r=Kobzol
JonathanBrouwer Feb 2, 2026
eb32f2e
Rollup merge of #151909 - chenyukang:yukang-fix-151607-disjoint-spans…
JonathanBrouwer Feb 2, 2026
f3f1118
Rollup merge of #151978 - nnethercote:query-cleanups, r=Zalathar
JonathanBrouwer Feb 2, 2026
60133a3
Rollup merge of #151979 - nicholasbishop:push-ssmqyutnpypo, r=jhpratt
JonathanBrouwer Feb 2, 2026
47dc9c9
Rollup merge of #151992 - crazazy:main, r=JonathanBrouwer
JonathanBrouwer Feb 2, 2026
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
compiletest: Support --extern modifiers with proc-macro directive
So that `pub-priv1.rs` test does not have to (ab)use the `aux-crate`
directive for this purpose.

This is very edge-casey so I don't think we should document this in
rustc-dev-guide. If someone needs to do this they will look at the code
and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can
make our directives work however we want. And I think this is a fine
pragmatic approach. Doing it "the right way" would be a lot of work for
not much gain. Plus, that work can be done incrementally in small steps
in the future if wanted.
  • Loading branch information
Enselic committed Jan 26, 2026
commit 996d72bce8845a4c4dcb0d41823cf0af4c11c59a
20 changes: 18 additions & 2 deletions src/tools/compiletest/src/directives/auxiliary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ pub struct AuxCrate {
}

/// The value of a `proc-macro` directive.
#[derive(Clone, Debug, Default)]
#[derive(Clone, Debug, Default, PartialEq, Eq)]
pub(crate) struct ProcMacro {
/// Contains `--extern` modifiers, if any. See the tracking issue for more
/// info: <https://github.com/rust-lang/rust/issues/98405>
/// With `proc-macro: noprelude:bar.rs` this will be `noprelude`.
pub extern_modifiers: Option<String>,
/// With `proc-macro: bar.rs` this will be `bar.rs`.
pub path: String,
}
Expand Down Expand Up @@ -108,5 +112,17 @@ fn parse_aux_crate(r: String) -> AuxCrate {
}

fn parse_proc_macro(r: String) -> ProcMacro {
ProcMacro { path: r.trim().to_string() }
let r = r.trim();

// Matches:
// path
// modifiers:path
let caps = static_regex!(r"^(?:(?<modifiers>[^=]*?):)?(?<path>.*)$")
.captures(r)
.expect("can never fail");

let modifiers = caps.name("modifiers").map(|m| m.as_str().to_string());
let path = caps["path"].to_string();

ProcMacro { extern_modifiers: modifiers, path }
}
16 changes: 16 additions & 0 deletions src/tools/compiletest/src/directives/auxiliary/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ fn test_aux_crate_value_with_modifiers() {
fn test_aux_crate_value_invalid() {
parse_aux_crate("foo.rs".to_string());
}

#[test]
fn test_proc_macro_value_no_modifiers() {
assert_eq!(
ProcMacro { extern_modifiers: None, path: "foo.rs".to_string() },
parse_proc_macro("foo.rs".to_string())
);
}

#[test]
fn test_proc_macro_value_with_modifiers() {
assert_eq!(
ProcMacro { extern_modifiers: Some("noprelude".to_string()), path: "foo.rs".to_string() },
parse_proc_macro("noprelude:foo.rs".to_string())
);
}
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ impl<'test> TestCx<'test> {
let crate_name = path_to_crate_name(&proc_macro.path);
add_extern(
rustc,
None, // `extern_modifiers`
proc_macro.extern_modifiers.as_deref(),
&crate_name,
&proc_macro.path,
AuxType::ProcMacro,
Expand Down
5 changes: 0 additions & 5 deletions tests/ui/privacy/pub-priv-dep/auxiliary/pm.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
//@ force-host
//@ no-prefer-dynamic

#![crate_type = "proc-macro"]

extern crate proc_macro;
use proc_macro::TokenStream;

Expand Down
2 changes: 1 addition & 1 deletion tests/ui/privacy/pub-priv-dep/pub-priv1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ aux-crate:priv:priv_dep=priv_dep.rs
//@ aux-build:pub_dep.rs
//@ aux-crate:priv:pm=pm.rs
//@ proc-macro:priv:pm.rs
//@ compile-flags: -Zunstable-options

// Basic behavior check of exported_private_dependencies from either a public
Expand Down
Loading