Skip to content

Commit 8b293ec

Browse files
committed
Also, revert the following commits: - cc8b57a - 7e9057f
1 parent 41eabfc commit 8b293ec

File tree

7 files changed

+172
-9
lines changed

7 files changed

+172
-9
lines changed

cargo-dylint/tests/boundary_toolchains.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ use tempfile::tempdir;
66
use test_log::test;
77

88
// smoelius: The channel date is one day later than the `rustc --version` date.
9-
const BOUNDARIES: [(&str, &str); 2] = [("2022-07-14", "2022-07-15"), ("2022-09-08", "2022-09-09")];
9+
// smoelius: Put recent boundaries first, since they're more likely to cause problems.
10+
const BOUNDARIES: [(&str, &str); 3] = [
11+
("2023-01-19", "2023-01-20"),
12+
("2022-09-08", "2022-09-09"),
13+
("2022-07-14", "2022-07-15"),
14+
];
1015

1116
#[test]
1217
fn boundary_toolchains() {

scripts/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ published() {
5050
echo '[workspace]' >> Cargo.toml
5151
cat > rust-toolchain << EOF
5252
[toolchain]
53-
channel = "nightly-2023-01-19"
53+
channel = "nightly"
5454
components = ["llvm-tools-preview", "rustc-dev"]
5555
EOF
5656
echo "Checking whether \`$1:$2\` is published ..." >&2

utils/linting/Cargo.lock

Lines changed: 120 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/linting/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ toml = "0.5"
1717

1818
dylint_internal = { version = "=2.1.3", path = "../../internal" }
1919

20+
[dev-dependencies]
21+
assert_cmd = "2.0"
22+
2023
[package.metadata.docs.rs]
2124
rustdoc-args = ["--cfg", "docsrs"]
2225

utils/linting/rust-toolchain

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[toolchain]
2-
# smoelius: Temporarily pin to `nightly-2023-01-19` until rust-lang/rust#106810 can be dealt with.
3-
channel = "nightly-2023-01-19"
2+
channel = "nightly"
43
components = ["llvm-tools-preview", "rustc-dev"]

utils/linting/src/lib.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ use cargo_metadata::{Metadata, MetadataCommand};
1616
use dylint_internal::env;
1717
use rustc_session::Session;
1818
use rustc_span::Symbol;
19-
use std::{any::type_name, cell::RefCell, fs::read_to_string, path::Path, sync::Mutex};
19+
use std::{
20+
any::type_name,
21+
cell::RefCell,
22+
fs::read_to_string,
23+
path::{Path, PathBuf},
24+
sync::Mutex,
25+
};
2026
use thiserror::Error;
2127

2228
pub const DYLINT_VERSION: &str = "0.1.0";
@@ -72,8 +78,8 @@ macro_rules! __make_late_closure {
7278
}
7379

7480
// smoelius: Relevant PR and merge commit:
75-
// * https://github.com/rust-lang/rust/pull/101501
76-
// * https://github.com/rust-lang/rust/commit/87788097b776f8e3662f76627944230684b671bd
81+
// - https://github.com/rust-lang/rust/pull/101501
82+
// - https://github.com/rust-lang/rust/commit/87788097b776f8e3662f76627944230684b671bd
7783
#[rustversion::since(2022-09-08)]
7884
#[doc(hidden)]
7985
#[macro_export]
@@ -310,8 +316,7 @@ pub fn try_init_config(sess: &Session) -> ConfigResult<()> {
310316
Some(Symbol::intern(&value)),
311317
));
312318
Some(value)
313-
} else if let Some(local_crate_source_file) = sess
314-
.local_crate_source_file
319+
} else if let Some(local_crate_source_file) = local_crate_source_file(sess)
315320
.as_deref()
316321
.map(Path::canonicalize)
317322
.transpose()?
@@ -363,3 +368,16 @@ pub fn try_init_config(sess: &Session) -> ConfigResult<()> {
363368

364369
Ok(())
365370
}
371+
372+
#[rustversion::before(2023-01-19)]
373+
fn local_crate_source_file(sess: &Session) -> Option<PathBuf> {
374+
sess.local_crate_source_file.clone()
375+
}
376+
377+
// smoelius: Relevant PR and merge commit:
378+
// - https://github.com/rust-lang/rust/pull/106810
379+
// - https://github.com/rust-lang/rust/commit/65d2f2a5f9c323c88d1068e8e90d0b47a20d491c
380+
#[rustversion::since(2023-01-19)]
381+
fn local_crate_source_file(sess: &Session) -> Option<PathBuf> {
382+
sess.local_crate_source_file()
383+
}

utils/linting/tests/build.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use assert_cmd::{assert::AssertResult, prelude::*};
2+
3+
#[test]
4+
fn builds_with_latest_nightly() {
5+
update_nightly().unwrap();
6+
7+
std::process::Command::new("cargo")
8+
.args(["+nightly", "build"])
9+
.assert()
10+
.success();
11+
}
12+
13+
fn update_nightly() -> AssertResult {
14+
std::process::Command::new("rustup")
15+
.args(["update", "--no-self-update", "nightly"])
16+
.assert()
17+
.try_success()
18+
}

0 commit comments

Comments
 (0)