Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 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
3a3aede
Update some comparison tests now that they pass in LLVM20
scottmcm 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
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
d9c34a7
Rollup merge of #134943 - Shunpoco:116971-mir-opt-issues, r=DianQK
jieyouxu Feb 28, 2025
61e9004
Rollup merge of #137017 - bjorn3:ignore_invalid_bitcode, r=oli-obk
jieyouxu Feb 28, 2025
87cac9f
Rollup merge of #137197 - scottmcm:cmp-20, r=ibraheemdev
jieyouxu Feb 28, 2025
d09523d
Rollup merge of #137540 - yotamofek:pr/more-deprecated-test-directive…
jieyouxu Feb 28, 2025
50ef985
Rollup merge of #137551 - folkertdev:import-simd-intrinsics, r=RalfJung
jieyouxu Feb 28, 2025
50ed7f9
Rollup merge of #137599 - davidtwco:use-minicore-more, r=jieyouxu
jieyouxu Feb 28, 2025
4606610
Rollup merge of #137673 - ChrisDenton:search-path-bug, r=dtolnay
jieyouxu Feb 28, 2025
f1cdd3b
Rollup merge of #137676 - petrochenkov:winresp, r=Kobzol
jieyouxu Feb 28, 2025
9e1ead6
Rollup merge of #137693 - aDotInTheVoid:gaming, r=onur-ozkan,Guillaum…
jieyouxu Feb 28, 2025
0cb9827
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
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