1
Fork 0

Add extended error message for E0523

Adds the extended error documentation for E0523 to indicate that the
error is no longer produced by the compiler.

Update the E0464 documentation to include example code that produces the
error.

Remove the error message E0523 from the compiler and replace it with an
internal compiler error.
This commit is contained in:
Matthew Kelly 2023-02-04 13:01:49 -05:00
parent 0c13c17250
commit 2bcd4e256a
9 changed files with 75 additions and 15 deletions

View file

@ -356,7 +356,12 @@ impl<'a> CrateLoader<'a> {
for (_, other) in self.cstore.iter_crate_data() {
// Same stable crate id but different SVH
if other.stable_crate_id() == root.stable_crate_id() && other.hash() != root.hash() {
return Err(CrateError::SymbolConflictsOthers(root.name()));
bug!(
"Previously returned E0523 here. \
See https://github.com/rust-lang/rust/pull/100599 for additional discussion.\
root.name() = {}.",
root.name()
);
}
}

View file

@ -511,14 +511,6 @@ pub struct SymbolConflictsCurrent {
pub crate_name: Symbol,
}
#[derive(Diagnostic)]
#[diag(metadata_symbol_conflicts_others, code = "E0523")]
pub struct SymbolConflictsOthers {
#[primary_span]
pub span: Span,
pub crate_name: Symbol,
}
#[derive(Diagnostic)]
#[diag(metadata_stable_crate_id_collision)]
pub struct StableCrateIdCollision {

View file

@ -945,7 +945,6 @@ pub(crate) enum CrateError {
ExternLocationNotFile(Symbol, PathBuf),
MultipleCandidates(Symbol, CrateFlavor, Vec<PathBuf>),
SymbolConflictsCurrent(Symbol),
SymbolConflictsOthers(Symbol),
StableCrateIdCollision(Symbol, Symbol),
DlOpen(String),
DlSym(String),
@ -989,9 +988,6 @@ impl CrateError {
CrateError::SymbolConflictsCurrent(root_name) => {
sess.emit_err(errors::SymbolConflictsCurrent { span, crate_name: root_name });
}
CrateError::SymbolConflictsOthers(root_name) => {
sess.emit_err(errors::SymbolConflictsOthers { span, crate_name: root_name });
}
CrateError::StableCrateIdCollision(crate_name0, crate_name1) => {
sess.emit_err(errors::StableCrateIdCollision { span, crate_name0, crate_name1 });
}