未验证 提交 378c2fd6 编写于 作者: M Matthias Krüger 提交者: GitHub

Rollup merge of #114752 - RickleAndMortimer:issue-113788-fix, r=compiler-errors

fixed *const [type error] does not implement the Copy trait

Removes "error: arguments for inline assembly must be copyable" when moving an unknown type

Fixes: #113788
......@@ -68,7 +68,7 @@ fn check_asm_operand_type(
let asm_ty = match *ty.kind() {
// `!` is allowed for input but not for output (issue #87802)
ty::Never if is_input => return None,
ty::Error(_) => return None,
_ if ty.references_error() => return None,
ty::Int(IntTy::I8) | ty::Uint(UintTy::U8) => Some(InlineAsmType::I8),
ty::Int(IntTy::I16) | ty::Uint(UintTy::U16) => Some(InlineAsmType::I16),
ty::Int(IntTy::I32) | ty::Uint(UintTy::U32) => Some(InlineAsmType::I32),
......
// test that "error: arguments for inline assembly must be copyable" doesn't show up in this code
// needs-asm-support
// only-x86_64
fn main() {
let peb: *const PEB; //~ ERROR cannot find type `PEB` in this scope [E0412]
unsafe { std::arch::asm!("mov {0}, fs:[0x30]", out(reg) peb); }
}
error[E0412]: cannot find type `PEB` in this scope
--> $DIR/issue-113788.rs:5:21
|
LL | let peb: *const PEB;
| ^^^ not found in this scope
error: aborting due to previous error
For more information about this error, try `rustc --explain E0412`.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册