rustup update to 2021-05-17 (#621)

This commit is contained in:
Ashley Hauck 2021-05-20 14:46:09 +02:00 committed by GitHub
parent e76247213c
commit ca988f95de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 30 deletions

View File

@ -518,7 +518,9 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
fn set_span(&mut self, span: Span) {
self.current_span = Some(span);
let loc = self.cx.tcx.sess.source_map().lookup_char_pos(span.lo());
let file = self.builder.def_string(format!("{}", loc.file.name));
let file = self
.builder
.def_string(format!("{}", loc.file.name.prefer_remapped()));
self.emit()
.line(file, loc.line as u32, loc.col_display as u32);
}

View File

@ -747,7 +747,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
token: Token<'a, 'cx, 'tcx>,
) -> Option<OutRegister<'a>> {
match token {
Token::Word(word) => match word.strip_prefix("%") {
Token::Word(word) => match word.strip_prefix('%') {
Some(id) => Some(OutRegister::Regular({
let num = *id_map.entry(id).or_insert_with(|| self.emit().id());
if !defined_ids.insert(num) {
@ -835,7 +835,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
token: Token<'a, 'cx, 'tcx>,
) -> Option<Word> {
match token {
Token::Word(word) => match word.strip_prefix("%") {
Token::Word(word) => match word.strip_prefix('%') {
Some(id) => Some(*id_map.entry(id).or_insert_with(|| self.emit().id())),
None => {
self.err("expected ID");

View File

@ -212,10 +212,13 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'tcx> {
let linkage = match linkage {
Linkage::External => Some(LinkageType::Export),
Linkage::Internal => None,
other => self.tcx.sess.fatal(&format!(
"TODO: Linkage type not supported yet: {:?}",
other
)),
other => {
self.tcx.sess.err(&format!(
"TODO: Linkage type {:?} not supported yet for static var symbol {}",
other, symbol_name
));
None
}
};
let g = self.declare_global(span, spvty);
@ -231,15 +234,21 @@ impl<'tcx> PreDefineMethods<'tcx> for CodegenCx<'tcx> {
instance: Instance<'tcx>,
linkage: Linkage,
_visibility: Visibility,
_symbol_name: &str,
symbol_name: &str,
) {
let linkage2 = match linkage {
Linkage::External => Some(LinkageType::Export),
// super sketchy hack: memcpy, memmove, memset, memcmp, and bcmp in the
// compiler_builtins crate use the WeakAny linkage type. Treat it as actually External
// linkage because we know there's only one of them.
Linkage::External | Linkage::WeakAny => Some(LinkageType::Export),
Linkage::Internal => None,
other => self.tcx.sess.fatal(&format!(
"TODO: Linkage type not supported yet: {:?}",
other
)),
other => {
self.tcx.sess.err(&format!(
"TODO: Linkage type {:?} not supported yet for function symbol {}",
other, symbol_name
));
None
}
};
let declared = self.declare_fn_ext(instance, linkage2);

View File

@ -14,12 +14,13 @@ use crate::target::SpirvTarget;
use rspirv::dr::{Module, Operand};
use rspirv::spirv::{AddressingModel, Decoration, LinkageType, Op, Word};
use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_codegen_ssa::mir::debuginfo::{FunctionDebugContext, VariableKind};
use rustc_codegen_ssa::traits::{
AsmMethods, BackendTypes, CoverageInfoMethods, DebugInfoMethods, MiscMethods,
AsmMethods, BackendTypes, CoverageInfoMethods, DebugInfoMethods, GlobalAsmOperandRef,
MiscMethods,
};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir::GlobalAsm;
use rustc_middle::mir::mono::CodegenUnit;
use rustc_middle::mir::Body;
use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt};
@ -616,7 +617,13 @@ impl<'tcx> CoverageInfoMethods<'tcx> for CodegenCx<'tcx> {
}
impl<'tcx> AsmMethods for CodegenCx<'tcx> {
fn codegen_global_asm(&self, _ga: &GlobalAsm) {
fn codegen_global_asm(
&self,
_template: &[InlineAsmTemplatePiece],
_operands: &[GlobalAsmOperandRef],
_options: InlineAsmOptions,
_line_spans: &[Span],
) {
todo!()
}
}

View File

@ -197,7 +197,7 @@ impl SerializedSpan {
file: match &file.name {
// We can only support real files, not "synthetic" ones (which
// are almost never exposed to the compiler backend anyway).
FileName::Real(real_name) => real_name.local_path().to_path_buf(),
FileName::Real(real_name) => real_name.local_path()?.to_path_buf(),
_ => return None,
},
hash: file.src_hash.into(),

View File

@ -328,6 +328,12 @@ impl CodegenBackend for SpirvCodegenBackend {
Box::new(rustc_codegen_ssa::base::codegen_crate(
Self,
tcx,
tcx.sess
.opts
.cg
.target_cpu
.clone()
.unwrap_or_else(|| tcx.sess.target.cpu.clone()),
metadata,
need_metadata_module,
))
@ -472,7 +478,7 @@ impl WriteBackendMethods for SpirvCodegenBackend {
_: &ModuleCodegen<Self::Module>,
_: &ModuleConfig,
_: bool,
) {
) -> Result<(), FatalError> {
todo!()
}
}

View File

@ -86,10 +86,16 @@ fn link_rlib(sess: &Session, codegen_results: &CodegenResults, out_filename: &Pa
}
for lib in codegen_results.crate_info.used_libraries.iter() {
match lib.kind {
NativeLibKind::StaticBundle => {}
NativeLibKind::StaticNoBundle
| NativeLibKind::Dylib
| NativeLibKind::Framework
NativeLibKind::Static {
bundle: None | Some(true),
..
} => {}
NativeLibKind::Static {
bundle: Some(false),
..
}
| NativeLibKind::Dylib { .. }
| NativeLibKind::Framework { .. }
| NativeLibKind::RawDylib
| NativeLibKind::Unspecified => continue,
}
@ -335,15 +341,18 @@ fn add_upstream_native_libraries(
continue;
}
match lib.kind {
NativeLibKind::Dylib | NativeLibKind::Unspecified => sess.fatal(&format!(
NativeLibKind::Dylib { .. } | NativeLibKind::Unspecified => sess.fatal(&format!(
"TODO: dylib nativelibkind not supported yet: {}",
name
)),
NativeLibKind::Framework => sess.fatal(&format!(
NativeLibKind::Framework { .. } => sess.fatal(&format!(
"TODO: framework nativelibkind not supported yet: {}",
name
)),
NativeLibKind::StaticNoBundle => {
NativeLibKind::Static {
bundle: Some(false),
..
} => {
if data[cnum.as_usize() - 1] == Linkage::Static {
sess.fatal(&format!(
"TODO: staticnobundle nativelibkind not supported yet: {}",
@ -351,7 +360,10 @@ fn add_upstream_native_libraries(
))
}
}
NativeLibKind::StaticBundle => {}
NativeLibKind::Static {
bundle: None | Some(true),
..
} => {}
NativeLibKind::RawDylib => {
sess.fatal(&format!("raw_dylib feature not yet implemented: {}", name))
}

View File

@ -5,5 +5,5 @@
# to the user in the error, instead of "error: invalid channel name '[toolchain]'".
[toolchain]
channel = "nightly-2021-04-25"
channel = "nightly-2021-05-17"
components = ["rust-src", "rustc-dev", "llvm-tools-preview"]

View File

@ -7,7 +7,7 @@ OpLine %9 7 35
%10 = OpLoad %11 %4
OpLine %9 7 13
OpStore %8 %10
OpLine %12 886 8
OpLine %12 878 8
OpCopyMemory %6 %8
OpLine %9 8 1
OpReturn

View File

@ -7,7 +7,7 @@ OpLine %9 7 37
%10 = OpLoad %11 %4
OpLine %12 1012 17
OpStore %8 %10
OpLine %13 886 8
OpLine %13 878 8
OpCopyMemory %6 %8
OpLine %9 8 1
OpReturn

View File

@ -25,7 +25,7 @@ error: entry parameter type must be by-reference: `&spirv_std::image::Image<f32,
15 | pub fn issue_585(invalid: Image!(2D, type=f32)) {}
| ^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in the macro `Image` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors; 1 warning emitted