Removes dead code from the compiler

This commit is contained in:
mu001999 2024-08-08 08:17:55 +08:00
parent f167efad2f
commit e7f11b6913
6 changed files with 2 additions and 25 deletions

View File

@ -99,6 +99,4 @@ incremental_unrecognized_depnode = unrecognized `DepNode` variant: {$name}
incremental_unrecognized_depnode_label = dep-node label `{$label}` not recognized incremental_unrecognized_depnode_label = dep-node label `{$label}` not recognized
incremental_write_dep_graph = failed to write dependency graph to `{$path}`: {$err}
incremental_write_new = failed to write {$name} to `{$path}`: {$err} incremental_write_new = failed to write {$name} to `{$path}`: {$err}

View File

@ -272,13 +272,6 @@ pub struct LoadDepGraph {
pub err: std::io::Error, pub err: std::io::Error,
} }
#[derive(Diagnostic)]
#[diag(incremental_write_dep_graph)]
pub struct WriteDepGraph<'a> {
pub path: &'a Path,
pub err: std::io::Error,
}
#[derive(Diagnostic)] #[derive(Diagnostic)]
#[diag(incremental_move_dep_graph)] #[diag(incremental_move_dep_graph)]
pub struct MoveDepGraph<'a> { pub struct MoveDepGraph<'a> {

View File

@ -481,10 +481,6 @@ passes_must_not_suspend =
`must_not_suspend` attribute should be applied to a struct, enum, union, or trait `must_not_suspend` attribute should be applied to a struct, enum, union, or trait
.label = is not a struct, enum, union, or trait .label = is not a struct, enum, union, or trait
passes_must_use_async =
`must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
.label = this attribute does nothing, the `Future`s returned by async functions are already `must_use`
passes_must_use_no_effect = passes_must_use_no_effect =
`#[must_use]` has no effect when applied to {$article} {$target} `#[must_use]` has no effect when applied to {$article} {$target}

View File

@ -371,13 +371,6 @@ pub struct FfiConstInvalidTarget {
pub attr_span: Span, pub attr_span: Span,
} }
#[derive(LintDiagnostic)]
#[diag(passes_must_use_async)]
pub struct MustUseAsync {
#[label]
pub span: Span,
}
#[derive(LintDiagnostic)] #[derive(LintDiagnostic)]
#[diag(passes_must_use_no_effect)] #[diag(passes_must_use_no_effect)]
pub struct MustUseNoEffect { pub struct MustUseNoEffect {

View File

@ -4,7 +4,6 @@ use crate::layout;
pub(crate) trait QueryContext { pub(crate) trait QueryContext {
type Def: layout::Def; type Def: layout::Def;
type Ref: layout::Ref; type Ref: layout::Ref;
type Scope: Copy;
} }
#[cfg(test)] #[cfg(test)]
@ -28,20 +27,17 @@ pub(crate) mod test {
impl QueryContext for UltraMinimal { impl QueryContext for UltraMinimal {
type Def = Def; type Def = Def;
type Ref = !; type Ref = !;
type Scope = ();
} }
} }
#[cfg(feature = "rustc")] #[cfg(feature = "rustc")]
mod rustc { mod rustc {
use rustc_middle::ty::{Ty, TyCtxt}; use rustc_middle::ty::TyCtxt;
use super::*; use super::*;
impl<'tcx> super::QueryContext for TyCtxt<'tcx> { impl<'tcx> super::QueryContext for TyCtxt<'tcx> {
type Def = layout::rustc::Def<'tcx>; type Def = layout::rustc::Def<'tcx>;
type Ref = layout::rustc::Ref<'tcx>; type Ref = layout::rustc::Ref<'tcx>;
type Scope = Ty<'tcx>;
} }
} }

View File

@ -59,6 +59,7 @@ fn box_deref_lval() {
assert_eq!(x.get(), 1000); assert_eq!(x.get(), 1000);
} }
#[allow(unused)]
pub struct ConstAllocator; pub struct ConstAllocator;
unsafe impl Allocator for ConstAllocator { unsafe impl Allocator for ConstAllocator {