Auto merge of #97538 - compiler-errors:rollup-zp3ukke, r=compiler-errors
Rollup of 4 pull requests Successful merges: - #97493 (Use `type_is_copy_modulo_regions` check in intrisicck) - #97518 (Fix order of closing HTML elements in rustdoc output) - #97530 (Add more eslint checks) - #97536 (Remove unused lifetimes from expand_macro) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
6999ef2564
@ -204,7 +204,7 @@ fn trace_macros_note(cx_expansions: &mut FxHashMap<Span, Vec<String>>, sp: Span,
|
|||||||
|
|
||||||
/// Expands the rules based macro defined by `lhses` and `rhses` for a given
|
/// Expands the rules based macro defined by `lhses` and `rhses` for a given
|
||||||
/// input `arg`.
|
/// input `arg`.
|
||||||
fn expand_macro<'cx, 'tt>(
|
fn expand_macro<'cx>(
|
||||||
cx: &'cx mut ExtCtxt<'_>,
|
cx: &'cx mut ExtCtxt<'_>,
|
||||||
sp: Span,
|
sp: Span,
|
||||||
def_span: Span,
|
def_span: Span,
|
||||||
@ -212,8 +212,8 @@ fn expand_macro<'cx, 'tt>(
|
|||||||
name: Ident,
|
name: Ident,
|
||||||
transparency: Transparency,
|
transparency: Transparency,
|
||||||
arg: TokenStream,
|
arg: TokenStream,
|
||||||
lhses: &'tt [Vec<MatcherLoc>],
|
lhses: &[Vec<MatcherLoc>],
|
||||||
rhses: &'tt [mbe::TokenTree],
|
rhses: &[mbe::TokenTree],
|
||||||
) -> Box<dyn MacResult + 'cx> {
|
) -> Box<dyn MacResult + 'cx> {
|
||||||
let sess = &cx.sess.parse_sess;
|
let sess = &cx.sess.parse_sess;
|
||||||
// Macros defined in the current crate have a real node id,
|
// Macros defined in the current crate have a real node id,
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
use rustc_span::{Span, Symbol, DUMMY_SP};
|
use rustc_span::{Span, Symbol, DUMMY_SP};
|
||||||
use rustc_target::abi::{Pointer, VariantIdx};
|
use rustc_target::abi::{Pointer, VariantIdx};
|
||||||
use rustc_target::asm::{InlineAsmReg, InlineAsmRegClass, InlineAsmRegOrRegClass, InlineAsmType};
|
use rustc_target::asm::{InlineAsmReg, InlineAsmRegClass, InlineAsmRegOrRegClass, InlineAsmType};
|
||||||
|
use rustc_trait_selection::infer::InferCtxtExt;
|
||||||
|
|
||||||
use super::FnCtxt;
|
use super::FnCtxt;
|
||||||
|
|
||||||
@ -210,7 +211,7 @@ fn check_asm_operand_type(
|
|||||||
|
|
||||||
// Check that the type implements Copy. The only case where this can
|
// Check that the type implements Copy. The only case where this can
|
||||||
// possibly fail is for SIMD types which don't #[derive(Copy)].
|
// possibly fail is for SIMD types which don't #[derive(Copy)].
|
||||||
if !ty.is_copy_modulo_regions(self.tcx.at(DUMMY_SP), self.param_env) {
|
if !self.infcx.type_is_copy_modulo_regions(self.param_env, ty, DUMMY_SP) {
|
||||||
let msg = "arguments for inline assembly must be copyable";
|
let msg = "arguments for inline assembly must be copyable";
|
||||||
let mut err = self.tcx.sess.struct_span_err(expr.span, msg);
|
let mut err = self.tcx.sess.struct_span_err(expr.span, msg);
|
||||||
err.note(&format!("`{ty}` does not implement the Copy trait"));
|
err.note(&format!("`{ty}` does not implement the Copy trait"));
|
||||||
|
@ -1764,7 +1764,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
|
|||||||
write!(buffer, "<li class=\"version\">Version {}</li>", Escape(version));
|
write!(buffer, "<li class=\"version\">Version {}</li>", Escape(version));
|
||||||
}
|
}
|
||||||
write!(buffer, "<li><a id=\"all-types\" href=\"all.html\">All Items</a></li>");
|
write!(buffer, "<li><a id=\"all-types\" href=\"all.html\">All Items</a></li>");
|
||||||
buffer.write_str("</div></ul>");
|
buffer.write_str("</ul></div>");
|
||||||
}
|
}
|
||||||
|
|
||||||
match *it.kind {
|
match *it.kind {
|
||||||
|
@ -63,5 +63,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"eqeqeq": "error",
|
"eqeqeq": "error",
|
||||||
|
"no-const-assign": "error",
|
||||||
|
"no-debugger": "error",
|
||||||
|
"no-dupe-args": "error",
|
||||||
|
"no-dupe-else-if": "error",
|
||||||
|
"no-dupe-keys": "error",
|
||||||
|
"no-duplicate-case": "error",
|
||||||
|
"no-ex-assign": "error",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
12
src/test/ui/asm/issue-97490.rs
Normal file
12
src/test/ui/asm/issue-97490.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// check-pass
|
||||||
|
// only-x86_64
|
||||||
|
// needs-asm-support
|
||||||
|
|
||||||
|
pub type Yes = extern "sysv64" fn(&'static u8) -> !;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
unsafe {
|
||||||
|
let yes = &6 as *const _ as *const Yes;
|
||||||
|
core::arch::asm!("call {}", in(reg) yes, options(noreturn));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user