Auto merge of #121655 - matthiaskrgr:rollup-qpx3kks, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #121598 (rename 'try' intrinsic to 'catch_unwind') - #121639 (Update books) - #121648 (Update Vec and String `{from,into}_raw_parts`-family docs) - #121651 (Properly emit `expected ;` on `#[attr] expr`) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
71ffdf7ff7
36 changed files with 123 additions and 72 deletions
|
@ -23,7 +23,7 @@ use rustc_middle::ty::layout::{HasParamEnv, ValidityRequirement};
|
|||
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
|
||||
use rustc_middle::ty::GenericArgsRef;
|
||||
use rustc_span::source_map::Spanned;
|
||||
use rustc_span::symbol::{kw, sym, Symbol};
|
||||
use rustc_span::symbol::{sym, Symbol};
|
||||
|
||||
pub(crate) use self::llvm::codegen_llvm_intrinsic_call;
|
||||
use crate::prelude::*;
|
||||
|
@ -1132,7 +1132,7 @@ fn codegen_regular_intrinsic_call<'tcx>(
|
|||
ret.write_cvalue(fx, val);
|
||||
}
|
||||
|
||||
kw::Try => {
|
||||
sym::catch_unwind => {
|
||||
intrinsic_args!(fx, args => (f, data, catch_fn); intrinsic);
|
||||
let f = f.load_scalar(fx);
|
||||
let data = data.load_scalar(fx);
|
||||
|
|
|
@ -21,7 +21,7 @@ use rustc_middle::ty::{self, Instance, Ty};
|
|||
use rustc_middle::ty::layout::LayoutOf;
|
||||
#[cfg(feature="master")]
|
||||
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt};
|
||||
use rustc_span::{Span, Symbol, symbol::kw, sym};
|
||||
use rustc_span::{Span, Symbol, sym};
|
||||
use rustc_target::abi::HasDataLayout;
|
||||
use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode};
|
||||
use rustc_target::spec::PanicStrategy;
|
||||
|
@ -129,7 +129,7 @@ impl<'a, 'gcc, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'a, 'gcc, 'tcx> {
|
|||
let res = self.context.new_call(None, builtin, &[a]);
|
||||
self.icmp(IntPredicate::IntEQ, res, self.const_i32(0))
|
||||
}
|
||||
kw::Try => {
|
||||
sym::catch_unwind => {
|
||||
try_intrinsic(
|
||||
self,
|
||||
args[0].immediate(),
|
||||
|
|
|
@ -17,7 +17,7 @@ use rustc_hir as hir;
|
|||
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, LayoutOf};
|
||||
use rustc_middle::ty::{self, GenericArgsRef, Ty};
|
||||
use rustc_middle::{bug, span_bug};
|
||||
use rustc_span::{sym, symbol::kw, Span, Symbol};
|
||||
use rustc_span::{sym, Span, Symbol};
|
||||
use rustc_target::abi::{self, Align, HasDataLayout, Primitive};
|
||||
use rustc_target::spec::{HasTargetSpec, PanicStrategy};
|
||||
|
||||
|
@ -133,8 +133,8 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
|
|||
}
|
||||
sym::unlikely => self
|
||||
.call_intrinsic("llvm.expect.i1", &[args[0].immediate(), self.const_bool(false)]),
|
||||
kw::Try => {
|
||||
try_intrinsic(
|
||||
sym::catch_unwind => {
|
||||
catch_unwind_intrinsic(
|
||||
self,
|
||||
args[0].immediate(),
|
||||
args[1].immediate(),
|
||||
|
@ -457,7 +457,7 @@ impl<'ll, 'tcx> IntrinsicCallMethods<'tcx> for Builder<'_, 'll, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
fn try_intrinsic<'ll>(
|
||||
fn catch_unwind_intrinsic<'ll>(
|
||||
bx: &mut Builder<'_, 'll, '_>,
|
||||
try_func: &'ll Value,
|
||||
data: &'ll Value,
|
||||
|
|
|
@ -12,7 +12,7 @@ use rustc_hir as hir;
|
|||
use rustc_middle::traits::{ObligationCause, ObligationCauseCode};
|
||||
use rustc_middle::ty::{self, Ty, TyCtxt};
|
||||
use rustc_span::def_id::LocalDefId;
|
||||
use rustc_span::symbol::{kw, sym};
|
||||
use rustc_span::symbol::sym;
|
||||
use rustc_span::{Span, Symbol};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
|
||||
|
@ -445,7 +445,7 @@ pub fn check_intrinsic_type(
|
|||
)
|
||||
}
|
||||
|
||||
kw::Try => {
|
||||
sym::catch_unwind => {
|
||||
let mut_u8 = Ty::new_mut_ptr(tcx, tcx.types.u8);
|
||||
let try_fn_ty = ty::Binder::dummy(tcx.mk_fn_sig(
|
||||
[mut_u8],
|
||||
|
|
|
@ -800,9 +800,8 @@ impl<'a> Parser<'a> {
|
|||
{
|
||||
Ok(next_attr) => next_attr,
|
||||
Err(inner_err) => {
|
||||
err.cancel();
|
||||
inner_err.cancel();
|
||||
return self.dcx().span_delayed_bug(expr.span, "not a tail expression");
|
||||
return err.emit();
|
||||
}
|
||||
}
|
||||
&& let ast::AttrKind::Normal(next_attr_kind) = next_attr.kind
|
||||
|
@ -813,9 +812,8 @@ impl<'a> Parser<'a> {
|
|||
let next_expr = match snapshot.parse_expr() {
|
||||
Ok(next_expr) => next_expr,
|
||||
Err(inner_err) => {
|
||||
err.cancel();
|
||||
inner_err.cancel();
|
||||
return self.dcx().span_delayed_bug(expr.span, "not a tail expression");
|
||||
return err.emit();
|
||||
}
|
||||
};
|
||||
// We have for sure
|
||||
|
|
|
@ -487,6 +487,7 @@ symbols! {
|
|||
call_once,
|
||||
caller_location,
|
||||
capture_disjoint_fields,
|
||||
catch_unwind,
|
||||
cause,
|
||||
cdylib,
|
||||
ceilf32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue