Skip to content

Commit

Permalink
Auto merge of rust-lang#97538 - compiler-errors:rollup-zp3ukke, r=com…
Browse files Browse the repository at this point in the history
…piler-errors

Rollup of 4 pull requests

Successful merges:

 - rust-lang#97493 (Use `type_is_copy_modulo_regions` check in intrisicck)
 - rust-lang#97518 (Fix order of closing HTML elements in rustdoc output)
 - rust-lang#97530 (Add more eslint checks)
 - rust-lang#97536 (Remove unused lifetimes from expand_macro)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed May 29, 2022
2 parents 28b8919 + f20bbc1 commit 6999ef2
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_expand/src/mbe/macro_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,16 @@ 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
/// input `arg`.
fn expand_macro<'cx, 'tt>(
fn expand_macro<'cx>(
cx: &'cx mut ExtCtxt<'_>,
sp: Span,
def_span: Span,
node_id: NodeId,
name: Ident,
transparency: Transparency,
arg: TokenStream,
lhses: &'tt [Vec<MatcherLoc>],
rhses: &'tt [mbe::TokenTree],
lhses: &[Vec<MatcherLoc>],
rhses: &[mbe::TokenTree],
) -> Box<dyn MacResult + 'cx> {
let sess = &cx.sess.parse_sess;
// Macros defined in the current crate have a real node id,
Expand Down
3 changes: 2 additions & 1 deletion compiler/rustc_typeck/src/check/intrinsicck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use rustc_session::lint;
use rustc_span::{Span, Symbol, DUMMY_SP};
use rustc_target::abi::{Pointer, VariantIdx};
use rustc_target::asm::{InlineAsmReg, InlineAsmRegClass, InlineAsmRegOrRegClass, InlineAsmType};
use rustc_trait_selection::infer::InferCtxtExt;

use super::FnCtxt;

Expand Down Expand Up @@ -210,7 +211,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

// Check that the type implements Copy. The only case where this can
// 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 mut err = self.tcx.sess.struct_span_err(expr.span, msg);
err.note(&format!("`{ty}` does not implement the Copy trait"));
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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><a id=\"all-types\" href=\"all.html\">All Items</a></li>");
buffer.write_str("</div></ul>");
buffer.write_str("</ul></div>");
}

match *it.kind {
Expand Down
7 changes: 7 additions & 0 deletions src/librustdoc/html/static/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,12 @@ module.exports = {
}
],
"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 changes: 12 additions & 0 deletions src/test/ui/asm/issue-97490.rs
Original file line number Diff line number Diff line change
@@ -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));
}
}

0 comments on commit 6999ef2

Please sign in to comment.