Skip to content

Rollup of 5 pull requests #140079

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

Merged
merged 49 commits into from
Apr 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
c285fe7
Fix link to rustc_* TEST attributes in ui.md
smanilov Apr 11, 2025
5806cb5
Merge pull request #2324 from smanilov/patch-3
tshepang Apr 11, 2025
b2fce61
Update table of contents in about-this-guide.md
smanilov Apr 8, 2025
e6eb98f
Merge pull request #2320 from smanilov/patch-1
tshepang Apr 11, 2025
c5e2369
Update "crater" link to actually point to crater.md
freyacodes Apr 11, 2025
46df457
Merge pull request #2325 from freyacodes/crater-link-fix
tshepang Apr 12, 2025
e0a2250
ease copy-paste
tshepang Apr 12, 2025
1a20e21
Merge pull request #2326 from rust-lang/tshepang-patch-3
tshepang Apr 12, 2025
3ae1c9d
use more simple language
tshepang Apr 12, 2025
770a6fc
remove implied text
tshepang Apr 12, 2025
7ba53b7
add missing word
tshepang Apr 12, 2025
af4419a
Merge pull request #2328 from rust-lang/tshepang-patch-3
jieyouxu Apr 12, 2025
208e421
Merge pull request #2329 from rust-lang/tshepang-patch-4
tshepang Apr 12, 2025
14ea903
Merge pull request #2327 from rust-lang/tshepang-patch-1
jieyouxu Apr 12, 2025
e33a6d6
date-check rdg contribution section
tshepang Apr 12, 2025
f79a89d
Merge pull request #2330 from rust-lang/tshepang-patch-5
tshepang Apr 12, 2025
667aa2e
fix path
tshepang Apr 12, 2025
17f72ff
Merge pull request #2331 from rust-lang/tshepang-patch-6
tshepang Apr 12, 2025
2af7ec3
use consistent title capitalization
tshepang Apr 12, 2025
40bfc14
Enable [canonicalize-issue-links] and [no-mentions] in triagebot.toml
Urgau Apr 12, 2025
de1dfd3
Merge pull request #2335 from Urgau/triagebot-feat-1
Urgau Apr 12, 2025
8c378f7
tests: document `-A {unused,internal_features}` ui test mode presets
jieyouxu Apr 9, 2025
38f06e3
Merge pull request #2321 from jieyouxu/ui-lint-allows
jieyouxu Apr 13, 2025
b3b89b6
Merge pull request #2334 from rust-lang/consistency
jieyouxu Apr 13, 2025
9e99fc3
clean "Coding conventions" chapter
tshepang Apr 14, 2025
97be6a6
Merge pull request #2333 from rust-lang/convetions-chapt-cleaning
tshepang Apr 14, 2025
855ecf9
Remind to update dev branch while behind too many commits
xizheyin Apr 16, 2025
a9bcdb0
Merge pull request #2337 from xizheyin/sync-code
Kobzol Apr 16, 2025
1236dcb
add a first version of autodiff docs
ZuseZ4 Apr 17, 2025
35a3c3b
Merge pull request #2339 from rust-lang/autodiff-docs
jieyouxu Apr 17, 2025
834dbf5
upstream autodiff build instructions
ZuseZ4 Apr 18, 2025
9e2e6d7
Merge pull request #2340 from rust-lang/autodiff-build-instr
ZuseZ4 Apr 18, 2025
311ef44
readme: be copy-paste friendly
tshepang Apr 19, 2025
52616fa
Merge pull request #2344 from rust-lang/tshepang-patch-1
tshepang Apr 19, 2025
a0c64dc
Preparing for merge from rustc
invalid-email-address Apr 19, 2025
3b2302e
Merge from rustc
invalid-email-address Apr 19, 2025
07b7f00
fix broken link
tshepang Apr 19, 2025
b886a8e
Merge pull request #2347 from rust-lang/rustc-pull
tshepang Apr 19, 2025
1ab497b
document `#[cfg(bootstrap)]` in dependencies
folkertdev Apr 19, 2025
976d13f
Merge pull request #2346 from folkertdev/bootstrap-in-dependencies
jieyouxu Apr 19, 2025
f3b7e23
Switch exploit mitigations to mdbook footnotes
ehuss Apr 19, 2025
6486538
docs: fix typo change from inconstants to invariants
c-git Apr 19, 2025
957b548
transmutability: remove NFA intermediate representation
jswrenn Apr 17, 2025
566dfd1
simd intrinsics with mask: accept unsigned integer masks
RalfJung Mar 3, 2025
d15c603
Rollup merge of #137953 - RalfJung:simd-intrinsic-masks, r=WaffleLapkin
ChrisDenton Apr 20, 2025
5a961da
Rollup merge of #139990 - jswrenn:no-nfas, r=tmiasko
ChrisDenton Apr 20, 2025
67539ce
Rollup merge of #140044 - tshepang:rdg-push, r=jieyouxu
ChrisDenton Apr 20, 2025
c113a3b
Rollup merge of #140051 - ehuss:exploit-footnotes, r=jieyouxu
ChrisDenton Apr 20, 2025
d3fab38
Rollup merge of #140054 - c-git:patch-1, r=joboet
ChrisDenton Apr 20, 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
25 changes: 11 additions & 14 deletions compiler/rustc_codegen_gcc/src/intrinsic/simd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
m_len == v_len,
InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len }
);
// TODO: also support unsigned integers.
match *m_elem_ty.kind() {
ty::Int(_) => {}
_ => return_error!(InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty }),
_ => return_error!(InvalidMonomorphization::MaskWrongElementType {
span,
name,
ty: m_elem_ty
}),
}
return Ok(bx.vector_select(args[0].immediate(), args[1].immediate(), args[2].immediate()));
}
Expand Down Expand Up @@ -991,19 +996,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
assert_eq!(pointer_count - 1, ptr_count(element_ty0));
assert_eq!(underlying_ty, non_ptr(element_ty0));

// The element type of the third argument must be a signed integer type of any width:
// The element type of the third argument must be an integer type of any width:
// TODO: also support unsigned integers.
let (_, element_ty2) = arg_tys[2].simd_size_and_type(bx.tcx());
match *element_ty2.kind() {
ty::Int(_) => (),
_ => {
require!(
false,
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
}
InvalidMonomorphization::MaskWrongElementType { span, name, ty: element_ty2 }
);
}
}
Expand Down Expand Up @@ -1109,17 +1110,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
assert_eq!(underlying_ty, non_ptr(element_ty0));

// The element type of the third argument must be a signed integer type of any width:
// TODO: also support unsigned integers.
match *element_ty2.kind() {
ty::Int(_) => (),
_ => {
require!(
false,
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
}
InvalidMonomorphization::MaskWrongElementType { span, name, ty: element_ty2 }
);
}
}
Expand Down
56 changes: 12 additions & 44 deletions compiler/rustc_codegen_llvm/src/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,18 +1184,6 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}};
}

/// Returns the bitwidth of the `$ty` argument if it is an `Int` type.
macro_rules! require_int_ty {
($ty: expr, $diag: expr) => {
match $ty {
ty::Int(i) => i.bit_width().unwrap_or_else(|| bx.data_layout().pointer_size.bits()),
_ => {
return_error!($diag);
}
}
};
}

/// Returns the bitwidth of the `$ty` argument if it is an `Int` or `Uint` type.
macro_rules! require_int_or_uint_ty {
($ty: expr, $diag: expr) => {
Expand Down Expand Up @@ -1485,9 +1473,9 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
m_len == v_len,
InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len }
);
let in_elem_bitwidth = require_int_ty!(
let in_elem_bitwidth = require_int_or_uint_ty!(
m_elem_ty.kind(),
InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty }
InvalidMonomorphization::MaskWrongElementType { span, name, ty: m_elem_ty }
);
let m_i1s = vector_mask_to_bitmask(bx, args[0].immediate(), in_elem_bitwidth, m_len);
return Ok(bx.select(m_i1s, args[1].immediate(), args[2].immediate()));
Expand All @@ -1508,7 +1496,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
// Integer vector <i{in_bitwidth} x in_len>:
let in_elem_bitwidth = require_int_or_uint_ty!(
in_elem.kind(),
InvalidMonomorphization::VectorArgument { span, name, in_ty, in_elem }
InvalidMonomorphization::MaskWrongElementType { span, name, ty: in_elem }
);

let i1xn = vector_mask_to_bitmask(bx, args[0].immediate(), in_elem_bitwidth, in_len);
Expand Down Expand Up @@ -1732,14 +1720,9 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}
);

let mask_elem_bitwidth = require_int_ty!(
let mask_elem_bitwidth = require_int_or_uint_ty!(
element_ty2.kind(),
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
}
InvalidMonomorphization::MaskWrongElementType { span, name, ty: element_ty2 }
);

// Alignment of T, must be a constant integer value:
Expand Down Expand Up @@ -1834,14 +1817,9 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}
);

let m_elem_bitwidth = require_int_ty!(
let m_elem_bitwidth = require_int_or_uint_ty!(
mask_elem.kind(),
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: values_elem,
third_arg: mask_ty,
}
InvalidMonomorphization::MaskWrongElementType { span, name, ty: mask_elem }
);

let mask = vector_mask_to_bitmask(bx, args[0].immediate(), m_elem_bitwidth, mask_len);
Expand Down Expand Up @@ -1924,14 +1902,9 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}
);

let m_elem_bitwidth = require_int_ty!(
let m_elem_bitwidth = require_int_or_uint_ty!(
mask_elem.kind(),
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: values_elem,
third_arg: mask_ty,
}
InvalidMonomorphization::MaskWrongElementType { span, name, ty: mask_elem }
);

let mask = vector_mask_to_bitmask(bx, args[0].immediate(), m_elem_bitwidth, mask_len);
Expand Down Expand Up @@ -2019,15 +1992,10 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
}
);

// The element type of the third argument must be a signed integer type of any width:
let mask_elem_bitwidth = require_int_ty!(
// The element type of the third argument must be an integer type of any width:
let mask_elem_bitwidth = require_int_or_uint_ty!(
element_ty2.kind(),
InvalidMonomorphization::ThirdArgElementType {
span,
name,
expected_element: element_ty2,
third_arg: arg_tys[2]
}
InvalidMonomorphization::MaskWrongElementType { span, name, ty: element_ty2 }
);

// Alignment of T, must be a constant integer value:
Expand Down
7 changes: 1 addition & 6 deletions compiler/rustc_codegen_ssa/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ codegen_ssa_invalid_monomorphization_inserted_type = invalid monomorphization of

codegen_ssa_invalid_monomorphization_invalid_bitmask = invalid monomorphization of `{$name}` intrinsic: invalid bitmask `{$mask_ty}`, expected `u{$expected_int_bits}` or `[u8; {$expected_bytes}]`

codegen_ssa_invalid_monomorphization_mask_type = invalid monomorphization of `{$name}` intrinsic: found mask element type is `{$ty}`, expected a signed integer type
.note = the mask may be widened, which only has the correct behavior for signed integers
codegen_ssa_invalid_monomorphization_mask_wrong_element_type = invalid monomorphization of `{$name}` intrinsic: expected mask element type to be an integer, found `{$ty}`

codegen_ssa_invalid_monomorphization_mismatched_lengths = invalid monomorphization of `{$name}` intrinsic: mismatched lengths: mask length `{$m_len}` != other vector length `{$v_len}`

Expand Down Expand Up @@ -158,8 +157,6 @@ codegen_ssa_invalid_monomorphization_simd_shuffle = invalid monomorphization of

codegen_ssa_invalid_monomorphization_simd_third = invalid monomorphization of `{$name}` intrinsic: expected SIMD third type, found non-SIMD `{$ty}`

codegen_ssa_invalid_monomorphization_third_arg_element_type = invalid monomorphization of `{$name}` intrinsic: expected element type `{$expected_element}` of third argument `{$third_arg}` to be a signed integer type

codegen_ssa_invalid_monomorphization_third_argument_length = invalid monomorphization of `{$name}` intrinsic: expected third argument with length {$in_len} (same as input type `{$in_ty}`), found `{$arg_ty}` with length {$out_len}

codegen_ssa_invalid_monomorphization_unrecognized_intrinsic = invalid monomorphization of `{$name}` intrinsic: unrecognized intrinsic `{$name}`
Expand All @@ -172,8 +169,6 @@ codegen_ssa_invalid_monomorphization_unsupported_symbol = invalid monomorphizati

codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size = invalid monomorphization of `{$name}` intrinsic: unsupported {$symbol} from `{$in_ty}` with element `{$in_elem}` of size `{$size}` to `{$ret_ty}`

codegen_ssa_invalid_monomorphization_vector_argument = invalid monomorphization of `{$name}` intrinsic: vector argument `{$in_ty}`'s element type `{$in_elem}`, expected integer element type

codegen_ssa_invalid_no_sanitize = invalid argument for `no_sanitize`
.note = expected one of: `address`, `cfi`, `hwaddress`, `kcfi`, `memory`, `memtag`, `shadow-call-stack`, or `thread`

Expand Down
23 changes: 2 additions & 21 deletions compiler/rustc_codegen_ssa/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,24 +1037,14 @@ pub enum InvalidMonomorphization<'tcx> {
v_len: u64,
},

#[diag(codegen_ssa_invalid_monomorphization_mask_type, code = E0511)]
#[note]
MaskType {
#[diag(codegen_ssa_invalid_monomorphization_mask_wrong_element_type, code = E0511)]
MaskWrongElementType {
#[primary_span]
span: Span,
name: Symbol,
ty: Ty<'tcx>,
},

#[diag(codegen_ssa_invalid_monomorphization_vector_argument, code = E0511)]
VectorArgument {
#[primary_span]
span: Span,
name: Symbol,
in_ty: Ty<'tcx>,
in_elem: Ty<'tcx>,
},

#[diag(codegen_ssa_invalid_monomorphization_cannot_return, code = E0511)]
CannotReturn {
#[primary_span]
Expand All @@ -1077,15 +1067,6 @@ pub enum InvalidMonomorphization<'tcx> {
mutability: ExpectedPointerMutability,
},

#[diag(codegen_ssa_invalid_monomorphization_third_arg_element_type, code = E0511)]
ThirdArgElementType {
#[primary_span]
span: Span,
name: Symbol,
expected_element: Ty<'tcx>,
third_arg: Ty<'tcx>,
},

#[diag(codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size, code = E0511)]
UnsupportedSymbolOfSize {
#[primary_span]
Expand Down
Loading
Loading