Skip to content
Merged
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
7 changes: 6 additions & 1 deletion compiler/rustc_attr_data_structures/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ use crate::RustcVersion;
/// `since` field of the `#[stable]` attribute.
///
/// For more, see [this pull request](https://github.com/rust-lang/rust/pull/100591).
pub const VERSION_PLACEHOLDER: &str = "CURRENT_RUSTC_VERSION";
pub const VERSION_PLACEHOLDER: &str = concat!("CURRENT_RUSTC_VERSIO", "N");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmao

// Note that the `concat!` macro above prevents `src/tools/replace-version-placeholder` from
// replacing the constant with the current version. Hardcoding the tool to skip this file doesn't
// work as the file can (and at some point will) be moved around.
Comment on lines +13 to +15
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lmaoooo

//
// Turning the `concat!` macro into a string literal will make Pietro cry. That'd be sad :(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't cry Pietro :(


/// Represents the following attributes:
///
Expand Down
7 changes: 1 addition & 6 deletions src/tools/replace-version-placeholder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,7 @@ fn main() {
let version_str = version_str.trim();
walk::walk_many(
&[&root_path.join("compiler"), &root_path.join("library")],
|path, _is_dir| {
walk::filter_dirs(path)
// We exempt these as they require the placeholder
// for their operation
|| path.ends_with("compiler/rustc_attr/src/builtin.rs")
},
|path, _is_dir| walk::filter_dirs(path),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nice, it even makes the actual code simpler.

&mut |entry, contents| {
if !contents.contains(VERSION_PLACEHOLDER) {
return;
Expand Down
Loading