Skip to content

Rollup of 12 pull requests #137789

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

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7061551
Add FileCheck annotations to mir-opt/issues
Shunpoco Dec 30, 2024
736ef0a
Don't error when adding a staticlib with bitcode files compiled by ne…
bjorn3 Feb 14, 2025
9147b6d
Add test
bjorn3 Feb 14, 2025
809858e
After introducing the warning in 1.83, now also warn in deps
tdittr Jan 20, 2025
e6d3987
Bless UI tests
tdittr Jan 20, 2025
3a3aede
Update some comparison tests now that they pass in LLVM20
scottmcm Feb 18, 2025
ab4ad6b
Change variadic-ffi-2 to use a platform independant ABI
tdittr Feb 18, 2025
ec45166
Tell llvm-ar to not create a symbol table
bjorn3 Feb 21, 2025
92eb445
tests: use minicore more
davidtwco Feb 24, 2025
7041eed
Prefer a two value enum over bool
oli-obk Feb 12, 2025
0ea02cd
Avoid having to handle an `Option` in the type system
oli-obk Feb 5, 2025
ff7c93f
Remove the `Option` part of range ends in the HIR
oli-obk Feb 5, 2025
73b7e5f
Hide the end of ranges in pretty printing if it's also the maximum of…
oli-obk Feb 5, 2025
9f190d7
Restore usage of io::Error
bjorn3 Feb 26, 2025
4fcebee
Fix Windows `Command` search path bug
ChrisDenton Feb 26, 2025
9a2362a
linker: Fix escaping style for response files on Windows
petrochenkov Feb 26, 2025
e28500d
Re-enable `--generate-link-to-defintion` for tools internal rustdoc
aDotInTheVoid Feb 26, 2025
d8a067b
remove most `simd_` intrinsic declaration in tests
folkertdev Feb 24, 2025
a837e99
simplify some imports with `simd::*`
folkertdev Feb 24, 2025
4e961dc
make `simd_insert` and `simd_extract` `const fn`s
folkertdev Feb 24, 2025
038f4e2
use the right feature in codegen tests
folkertdev Feb 24, 2025
660241d
Fix test directives that were accidentally ignored
yotamofek Feb 24, 2025
0881dba
Move "unused_exter_crate" test from rustdoc-ui to rustdoc
yotamofek Feb 27, 2025
b67b6c0
Fix sized constraint for unsafe binder
compiler-errors Feb 28, 2025
1afa069
Rollup merge of #134943 - Shunpoco:116971-mir-opt-issues, r=DianQK
jieyouxu Feb 28, 2025
671a420
Rollup merge of #135767 - tdittr:fn_ptr_calling_conventions-in-deps, …
jieyouxu Feb 28, 2025
996e86a
Rollup merge of #136922 - oli-obk:pattern-types-option-ends, r=BoxyUwU
jieyouxu Feb 28, 2025
02047d2
Rollup merge of #137017 - bjorn3:ignore_invalid_bitcode, r=oli-obk
jieyouxu Feb 28, 2025
6e2ccb2
Rollup merge of #137197 - scottmcm:cmp-20, r=ibraheemdev
jieyouxu Feb 28, 2025
08f194f
Rollup merge of #137540 - yotamofek:pr/more-deprecated-test-directive…
jieyouxu Feb 28, 2025
94fec13
Rollup merge of #137551 - folkertdev:import-simd-intrinsics, r=RalfJung
jieyouxu Feb 28, 2025
89080b2
Rollup merge of #137599 - davidtwco:use-minicore-more, r=jieyouxu
jieyouxu Feb 28, 2025
8447cf9
Rollup merge of #137673 - ChrisDenton:search-path-bug, r=dtolnay
jieyouxu Feb 28, 2025
c14e217
Rollup merge of #137676 - petrochenkov:winresp, r=Kobzol
jieyouxu Feb 28, 2025
3f9ee0f
Rollup merge of #137693 - aDotInTheVoid:gaming, r=onur-ozkan,Guillaum…
jieyouxu Feb 28, 2025
e5ca055
Rollup merge of #137770 - compiler-errors:unsafe-binder-sized-crit, r…
jieyouxu Feb 28, 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
Fix sized constraint for unsafe binder
  • Loading branch information
compiler-errors committed Feb 28, 2025
commit b67b6c05032e98a5984ebb39f581125e7d0b48b9
9 changes: 6 additions & 3 deletions compiler/rustc_ty_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ fn sized_constraint_for_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'
| Never
| Dynamic(_, _, ty::DynStar) => None,

UnsafeBinder(_) => todo!(),

// these are never sized
Str | Slice(..) | Dynamic(_, _, ty::Dyn) | Foreign(..) => Some(ty),

Expand All @@ -52,9 +50,14 @@ fn sized_constraint_for_ty<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Option<Ty<'
sized_constraint_for_ty(tcx, ty)
}),

// these can be sized or unsized
// these can be sized or unsized.
Param(..) | Alias(..) | Error(_) => Some(ty),

// We cannot instantiate the binder, so just return the *original* type back,
// but only if the inner type has a sized constraint. Thus we skip the binder,
// but don't actually use the result from `sized_constraint_for_ty`.
UnsafeBinder(inner_ty) => sized_constraint_for_ty(tcx, inner_ty.skip_binder()).map(|_| ty),

Placeholder(..) | Bound(..) | Infer(..) => {
bug!("unexpected type `{ty:?}` in sized_constraint_for_ty")
}
Expand Down
18 changes: 18 additions & 0 deletions tests/ui/unsafe-binders/binder-sized-crit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//@ check-pass

#![feature(unsafe_binders)]
//~^ WARN the feature `unsafe_binders` is incomplete

use std::unsafe_binder::wrap_binder;

struct A {
b: unsafe<> (),
}

fn main() {
unsafe {
let _ = A {
b: wrap_binder!(()),
};
}
}
11 changes: 11 additions & 0 deletions tests/ui/unsafe-binders/binder-sized-crit.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
warning: the feature `unsafe_binders` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/binder-sized-crit.rs:3:12
|
LL | #![feature(unsafe_binders)]
| ^^^^^^^^^^^^^^
|
= note: see issue #130516 <https://github.com/rust-lang/rust/issues/130516> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted

Loading