Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
27f8efb
Bump object
heiher Jun 4, 2025
387dae9
Move canonicalization into current_dll_path
bjorn3 Jun 5, 2025
dff8ee5
Replace all uses of sysroot_candidates with get_or_default_sysroot
bjorn3 Jun 5, 2025
38d69c3
Add new Tier-3 targets: `loongarch32-unknown-none*`
heiher Jan 9, 2025
d945c85
compiler: Add track_caller to AbiMapping::unwrap
workingjubilee Jun 6, 2025
e4c4c4c
Fix review comments
bjorn3 Jun 6, 2025
bafe406
UnsafePinned: update get() docs and signature to allow shared mutation
RalfJung Jun 7, 2025
bd0a81e
centralize aliasing rules discussion in UnsafeCell docs
RalfJung Jun 7, 2025
a50bd7c
store `target.min_global_align` as an `Align`
folkertdev Jun 7, 2025
3380a91
cleaned up some tests
Kivooeo Jun 6, 2025
143354c
added test for 30904
Kivooeo Jun 7, 2025
85ce9ee
cleaned up some tests
Kivooeo Jun 7, 2025
9223704
Remove all unused feature gates from the compiler
bjorn3 Jun 8, 2025
b189d29
Do not free disk space in the `mingw-check-tidy` job
Kobzol Jun 8, 2025
e82630c
Run `mingw-check-tidy` on auto builds
Kobzol Jun 8, 2025
2e19658
Remove rustc's notion of "preferred" alignment AKA `__alignof`
workingjubilee Feb 12, 2025
ec13ae6
compiler: add Deref to AbiAlign to ease transition
workingjubilee Jun 4, 2025
1df69bc
Rollup merge of #141803 - workingjubilee:remove-pref-align, r=bjorn3
workingjubilee Jun 9, 2025
840baa4
Rollup merge of #142053 - heiher:loong32-none, r=wesleywiser
workingjubilee Jun 9, 2025
41bc5d7
Rollup merge of #142089 - bjorn3:sysroot_handling_cleanup3, r=petroch…
workingjubilee Jun 9, 2025
ed61e50
Rollup merge of #142108 - workingjubilee:track-caller-in-abi-map, r=j…
workingjubilee Jun 9, 2025
a5b8a45
Rollup merge of #142132 - Kivooeo:tf6, r=workingjubilee
workingjubilee Jun 9, 2025
faab021
Rollup merge of #142162 - RalfJung:unsafe-pinned-get, r=workingjubile…
workingjubilee Jun 9, 2025
277f57e
Rollup merge of #142171 - Kivooeo:tf7, r=workingjubilee
workingjubilee Jun 9, 2025
48667dd
Rollup merge of #142179 - folkertdev:min-global-align-parse, r=workin…
workingjubilee Jun 9, 2025
29ef4c8
Rollup merge of #142183 - Kivooeo:30904-test, r=compiler-errors
workingjubilee Jun 9, 2025
940a436
Rollup merge of #142194 - bjorn3:less_unstable_features, r=jieyouxu
workingjubilee Jun 9, 2025
66b6da5
Rollup merge of #142199 - Kobzol:tidy-speed-up, r=Mark-Simulacrum
workingjubilee Jun 9, 2025
e91f985
Rollup merge of #142210 - Kobzol:tidy-auto-builds, r=Mark-Simulacrum
workingjubilee Jun 9, 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
39 changes: 39 additions & 0 deletions tests/ui/unboxed-closures/fn-traits-hrtb-coercion.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//! Test for issue <github.com/rust-lang/rust/issues/30904>
//! Related to higher-ranked lifetime inference with unboxed closures and FnOnce.

#![feature(fn_traits, unboxed_closures)]

fn test<F: for<'x> FnOnce<(&'x str,)>>(_: F) {}

struct Compose<F, G>(F, G);

impl<T, F, G> FnOnce<(T,)> for Compose<F, G>
where
F: FnOnce<(T,)>,
G: FnOnce<(F::Output,)>,
{
type Output = G::Output;
extern "rust-call" fn call_once(self, (x,): (T,)) -> G::Output {
(self.1)((self.0)(x))
}
}

struct Str<'a>(&'a str);

fn mk_str<'a>(s: &'a str) -> Str<'a> {
Str(s)
}

fn main() {
let _: for<'a> fn(&'a str) -> Str<'a> = mk_str;
let _: for<'a> fn(&'a str) -> Str<'a> = Str;
//~^ ERROR: mismatched types

test(|_: &str| {});
test(mk_str);
test(Str);

test(Compose(|_: &str| {}, |_| {}));
test(Compose(mk_str, |_| {}));
test(Compose(Str, |_| {}));
}
14 changes: 14 additions & 0 deletions tests/ui/unboxed-closures/fn-traits-hrtb-coercion.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0308]: mismatched types
--> $DIR/fn-traits-hrtb-coercion.rs:29:45
|
LL | let _: for<'a> fn(&'a str) -> Str<'a> = Str;
| ------------------------------ ^^^ one type is more general than the other
| |
| expected due to this
|
= note: expected fn pointer `for<'a> fn(&'a _) -> Str<'a>`
found struct constructor `fn(&_) -> Str<'_> {Str::<'_>}`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0308`.