Skip to content

Commit

Permalink
chore: fix some comments
Browse files Browse the repository at this point in the history
Signed-off-by: cuishuang <imcusg@gmail.com>
  • Loading branch information
cuishuang committed Sep 2, 2024
1 parent c7f4874 commit ddb1e41
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ impl SourceToDefCtx<'_, '_> {
let (body, source_map) = self.db.body_with_source_map(container);
let src = src.cloned().map(ast::Pat::from);
let pat_id = source_map.node_pat(src.as_ref())?;
// the pattern could resolve to a constant, verify that that is not the case
// the pattern could resolve to a constant, verify that this is not the case
if let crate::Pat::Bind { id, .. } = body[pat_id] {
Some((container, id))
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ macro_rules! define_symbols {
(@WITH_NAME: $($alias:ident = $value:literal,)* @PLAIN: $($name:ident,)*) => {
// Ideally we would be emitting `const` here, but then we no longer have stable addresses
// which is what we are relying on for equality! In the future if consts can refer to
// statics we should swap these for `const`s and have the the string literal being pointed
// statics we should swap these for `const`s and have the string literal being pointed
// to be statics to refer to such that their address is stable.
$(
pub static $name: Symbol = Symbol { repr: TaggedArcPtr::non_arc(&stringify!($name)) };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl flags::Scip {
let mut symbol_roles = Default::default();

if let Some(def) = token.definition {
// if the the range of the def and the range of the token are the same, this must be the definition.
// if the range of the def and the range of the token are the same, this must be the definition.
// they also must be in the same file. See https://github.com/rust-lang/rust-analyzer/pull/17988
if def.file_id == file_id && def.range == text_range {
symbol_roles |= scip_types::SymbolRole::Definition as i32;
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/span/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub struct SyntaxContextData {
/// Invariant: Only [`SyntaxContextId::ROOT`] has a [`None`] outer expansion.
// FIXME: The None case needs to encode the context crate id. We can encode that as the MSB of
// MacroCallId is reserved anyways so we can do bit tagging here just fine.
// The bigger issue is that that will cause interning to now create completely separate chains
// The bigger issue is that this will cause interning to now create completely separate chains
// per crate. Though that is likely not a problem as `MacroCallId`s are already crate calling dependent.
pub outer_expn: Option<MacroCallId>,
pub outer_transparency: Transparency,
Expand Down

0 comments on commit ddb1e41

Please sign in to comment.