Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix non_camel_case_types for screaming single-words #116389

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ impl PartialEq<Symbol> for Path {
}
}

impl<CTX: rustc_span::HashStableContext> HashStable<CTX> for Path {
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
impl<Ctx: rustc_span::HashStableContext> HashStable<Ctx> for Path {
fn hash_stable(&self, hcx: &mut Ctx, hasher: &mut StableHasher) {
self.segments.len().hash_stable(hcx, hasher);
for segment in &self.segments {
segment.ident.hash_stable(hcx, hasher);
Expand Down Expand Up @@ -1680,11 +1680,11 @@ impl AttrArgs {
}
}

impl<CTX> HashStable<CTX> for AttrArgs
impl<Ctx> HashStable<Ctx> for AttrArgs
where
CTX: crate::HashStableContext,
Ctx: crate::HashStableContext,
{
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
fn hash_stable(&self, ctx: &mut Ctx, hasher: &mut StableHasher) {
mem::discriminant(self).hash_stable(ctx, hasher);
match self {
AttrArgs::Empty => {}
Expand Down Expand Up @@ -1716,11 +1716,11 @@ impl DelimArgs {
}
}

impl<CTX> HashStable<CTX> for DelimArgs
impl<Ctx> HashStable<Ctx> for DelimArgs
where
CTX: crate::HashStableContext,
Ctx: crate::HashStableContext,
{
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
fn hash_stable(&self, ctx: &mut Ctx, hasher: &mut StableHasher) {
let DelimArgs { dspan, delim, tokens } = self;
dspan.hash_stable(ctx, hasher);
delim.hash_stable(ctx, hasher);
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_ast/src/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ impl<D: Decoder, T: Decodable<D>> Decodable<D> for P<[T]> {
}
}

impl<CTX, T> HashStable<CTX> for P<T>
impl<Ctx, T> HashStable<Ctx> for P<T>
where
T: ?Sized + HashStable<CTX>,
T: ?Sized + HashStable<Ctx>,
{
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
fn hash_stable(&self, hcx: &mut Ctx, hasher: &mut StableHasher) {
(**self).hash_stable(hcx, hasher);
}
}
6 changes: 3 additions & 3 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,11 +948,11 @@ impl fmt::Debug for Nonterminal {
}
}

impl<CTX> HashStable<CTX> for Nonterminal
impl<Ctx> HashStable<Ctx> for Nonterminal
where
CTX: crate::HashStableContext,
Ctx: crate::HashStableContext,
{
fn hash_stable(&self, _hcx: &mut CTX, _hasher: &mut StableHasher) {
fn hash_stable(&self, _hcx: &mut Ctx, _hasher: &mut StableHasher) {
panic!("interpolated tokens should not be present in the HIR")
}
}
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ impl TokenTree {
}
}

impl<CTX> HashStable<CTX> for TokenStream
impl<Ctx> HashStable<Ctx> for TokenStream
where
CTX: crate::HashStableContext,
Ctx: crate::HashStableContext,
{
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
fn hash_stable(&self, hcx: &mut Ctx, hasher: &mut StableHasher) {
for sub_tt in self.trees() {
sub_tt.hash_stable(hcx, hasher);
}
Expand Down Expand Up @@ -166,8 +166,8 @@ impl<D: Decoder> Decodable<D> for LazyAttrTokenStream {
}
}

impl<CTX> HashStable<CTX> for LazyAttrTokenStream {
fn hash_stable(&self, _hcx: &mut CTX, _hasher: &mut StableHasher) {
impl<Ctx> HashStable<Ctx> for LazyAttrTokenStream {
fn hash_stable(&self, _hcx: &mut Ctx, _hasher: &mut StableHasher) {
panic!("Attempted to compute stable hash for LazyAttrTokenStream");
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_cranelift/src/driver/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ enum OngoingModuleCodegen {
Async(JoinHandle<Result<ModuleCodegenResult, String>>),
}

impl<HCX> HashStable<HCX> for OngoingModuleCodegen {
fn hash_stable(&self, _: &mut HCX, _: &mut StableHasher) {
impl<Hcx> HashStable<Hcx> for OngoingModuleCodegen {
fn hash_stable(&self, _: &mut Hcx, _: &mut StableHasher) {
// do nothing
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_ssa/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ mod temp_stable_hash_impls {
use crate::ModuleCodegen;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};

impl<HCX, M> HashStable<HCX> for ModuleCodegen<M> {
fn hash_stable(&self, _: &mut HCX, _: &mut StableHasher) {
impl<Hcx, M> HashStable<Hcx> for ModuleCodegen<M> {
fn hash_stable(&self, _: &mut Hcx, _: &mut StableHasher) {
// do nothing
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_data_structures/src/intern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ impl<'a, T> Hash for Interned<'a, T> {
}
}

impl<T, CTX> HashStable<CTX> for Interned<'_, T>
impl<T, Ctx> HashStable<Ctx> for Interned<'_, T>
where
T: HashStable<CTX>,
T: HashStable<Ctx>,
{
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
fn hash_stable(&self, hcx: &mut Ctx, hasher: &mut StableHasher) {
self.0.hash_stable(hcx, hasher);
}
}
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_data_structures/src/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub trait ForestObligation: Clone + Debug {
pub trait ObligationProcessor {
type Obligation: ForestObligation;
type Error: Debug;
type OUT: OutcomeTrait<Obligation = Self::Obligation, Error = Error<Self::Obligation, Self::Error>>;
type Out: OutcomeTrait<Obligation = Self::Obligation, Error = Error<Self::Obligation, Self::Error>>;

/// Implementations can provide a fast-path to obligation-processing
/// by counting the prefix of the passed iterator for which
Expand Down Expand Up @@ -416,11 +416,11 @@ impl<O: ForestObligation> ObligationForest<O> {

/// Performs a fixpoint computation over the obligation list.
#[inline(never)]
pub fn process_obligations<P>(&mut self, processor: &mut P) -> P::OUT
pub fn process_obligations<P>(&mut self, processor: &mut P) -> P::Out
where
P: ObligationProcessor<Obligation = O>,
{
let mut outcome = P::OUT::new();
let mut outcome = P::Out::new();

// Fixpoint computation: we repeat until the inner loop stalls.
loop {
Expand Down Expand Up @@ -576,7 +576,7 @@ impl<O: ForestObligation> ObligationForest<O> {

/// Report cycles between all `Success` nodes, and convert all `Success`
/// nodes to `Done`. This must be called after `mark_successes`.
fn process_cycles<P>(&mut self, processor: &mut P, outcome: &mut P::OUT)
fn process_cycles<P>(&mut self, processor: &mut P, outcome: &mut P::Out)
where
P: ObligationProcessor<Obligation = O>,
{
Expand All @@ -599,7 +599,7 @@ impl<O: ForestObligation> ObligationForest<O> {
stack: &mut Vec<usize>,
processor: &mut P,
index: usize,
outcome: &mut P::OUT,
outcome: &mut P::Out,
) where
P: ObligationProcessor<Obligation = O>,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ where
{
type Obligation = O;
type Error = E;
type OUT = TestOutcome<O, E>;
type Out = TestOutcome<O, E>;

fn needs_process_obligation(&self, _obligation: &Self::Obligation) -> bool {
true
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/profiling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ impl SelfProfiler {

/// Allocates a new string in the profiling data. Does not do any caching
/// or deduplication.
pub fn alloc_string<STR: SerializableString + ?Sized>(&self, s: &STR) -> StringId {
pub fn alloc_string<Str: SerializableString + ?Sized>(&self, s: &Str) -> StringId {
self.profiler.alloc_string(s)
}

Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_data_structures/src/sorted_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ impl<K: Ord, V> FromIterator<(K, V)> for SortedMap<K, V> {
}
}

impl<K: HashStable<CTX> + StableOrd, V: HashStable<CTX>, CTX> HashStable<CTX> for SortedMap<K, V> {
impl<K: HashStable<Ctx> + StableOrd, V: HashStable<Ctx>, Ctx> HashStable<Ctx> for SortedMap<K, V> {
#[inline]
fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) {
fn hash_stable(&self, ctx: &mut Ctx, hasher: &mut StableHasher) {
self.data.hash_stable(ctx, hasher);
}
}
Expand Down
Loading
Loading