Skip to content

Bump rust nightly -> 2022-12-15 #79

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

Merged
merged 1 commit into from
Jan 6, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-03
toolchain: nightly-2022-12-15
components: cargo, clippy, rustfmt
- run: rustc -vV
- run: cargo build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rust_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-11-03
toolchain: nightly-2022-12-15
components: cargo, clippy, rustfmt
- run: rustc -vV
- run: cargo build
Expand Down
2 changes: 1 addition & 1 deletion cargo-marker/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::ExitStatus;
/// This is the driver version and toolchain, that is used by the setup command
/// to install the driver.
static DEFAULT_DRIVER_INFO: Lazy<RustcDriverInfo> = Lazy::new(|| RustcDriverInfo {
toolchain: "nightly-2022-11-03".to_string(),
toolchain: "nightly-2022-12-15".to_string(),
version: "0.1.0".to_string(),
api_version: "0.1.0".to_string(),
});
Expand Down
2 changes: 1 addition & 1 deletion marker_adapter/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extern "C" fn item<'ast>(data: &(), id: ItemId) -> FfiOption<ItemKind<'ast>> {
wrapper.driver_cx.item(id).into()
}

extern "C" fn emit_lint<'ast>(data: &(), lint: &'static Lint, msg: ffi::Str, span: &Span<'ast>) {
extern "C" fn emit_lint(data: &(), lint: &'static Lint, msg: ffi::Str, span: &Span<'_>) {
let wrapper = unsafe { &*(data as *const ()).cast::<DriverContextWrapper>() };
wrapper.driver_cx.emit_lint(lint, (&msg).into(), span);
}
Expand Down
2 changes: 1 addition & 1 deletion marker_driver_rustc/src/conversion/common/ast_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{context::RustcContext, conversion::generic::to_api_generic_args_opt}

use super::to_symbol_id;

pub fn to_api_path<'ast, 'tcx>(cx: &'ast RustcContext<'ast, 'tcx>, path: &hir::Path<'tcx>) -> AstPath<'ast> {
pub fn to_api_path<'ast, 'tcx, T>(cx: &'ast RustcContext<'ast, 'tcx>, path: &hir::Path<'tcx, T>) -> AstPath<'ast> {
AstPath::new(
cx.storage
.alloc_slice_iter(path.segments.iter().map(|seg| conv_segment(cx, seg))),
Expand Down
18 changes: 8 additions & 10 deletions marker_driver_rustc/src/conversion/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,22 @@ use crate::context::RustcContext;

use super::{to_generic_id, to_item_id, to_span_id, to_symbol_id, ty::TyConverter};

pub fn to_api_lifetime<'ast, 'tcx>(
_cx: &'ast RustcContext<'ast, 'tcx>,
pub fn to_api_lifetime<'ast>(
_cx: &'ast RustcContext<'ast, '_>,
rust_lt: &rustc_hir::Lifetime,
) -> Option<Lifetime<'ast>> {
let kind = match rust_lt.name {
rustc_hir::LifetimeName::Param(local_id, rustc_hir::ParamName::Plain(ident)) => {
LifetimeKind::Label(to_symbol_id(ident.name), to_generic_id(local_id.to_def_id()))
let kind = match rust_lt.res {
rustc_hir::LifetimeName::Param(_) if rust_lt.is_anonymous() => return None,
rustc_hir::LifetimeName::Param(local_id) => {
LifetimeKind::Label(to_symbol_id(rust_lt.ident.name), to_generic_id(local_id.to_def_id()))
},
rustc_hir::LifetimeName::Param(_local_id, rustc_hir::ParamName::Fresh) => return None,
rustc_hir::LifetimeName::ImplicitObjectLifetimeDefault => return None,
rustc_hir::LifetimeName::Infer => LifetimeKind::Infer,
rustc_hir::LifetimeName::Static => LifetimeKind::Static,
rustc_hir::LifetimeName::Param(_, rustc_hir::ParamName::Error) | rustc_hir::LifetimeName::Error => {
unreachable!("would have triggered a rustc error")
},
rustc_hir::LifetimeName::Error => unreachable!("would have triggered a rustc error"),
};

Some(Lifetime::new(Some(to_span_id(rust_lt.span)), kind))
Some(Lifetime::new(Some(to_span_id(rust_lt.ident.span)), kind))
}

pub fn to_api_generic_args_from_path<'ast, 'tcx>(
Expand Down
4 changes: 2 additions & 2 deletions marker_driver_rustc/src/conversion/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,8 +425,8 @@ impl<'ast, 'tcx> ItemConverter<'ast, 'tcx> {
fn conv_variant_data(&self, var_data: &'tcx hir::VariantData) -> AdtKind<'ast> {
match var_data {
hir::VariantData::Struct(fields, _recovered) => AdtKind::Field(self.conv_field_defs(fields).into()),
hir::VariantData::Tuple(fields, _) => AdtKind::Tuple(self.conv_field_defs(fields).into()),
hir::VariantData::Unit(_) => AdtKind::Unit,
hir::VariantData::Tuple(fields, ..) => AdtKind::Tuple(self.conv_field_defs(fields).into()),
hir::VariantData::Unit(..) => AdtKind::Unit,
}
}

Expand Down
6 changes: 5 additions & 1 deletion marker_driver_rustc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#![warn(clippy::pedantic)]
#![allow(clippy::missing_panics_doc)]
#![allow(clippy::module_name_repetitions)]
#![allow(
clippy::needless_lifetimes,
reason = "some lifetimes will be required to fix ICEs, <'ast, '_> also looks weird"
)]
#![allow(clippy::needless_collect, reason = "it has false positives for `alloc_slice_iter`")]
#![allow(
clippy::too_many_lines,
Expand Down Expand Up @@ -35,7 +39,7 @@ use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::process::{exit, Command};

const RUSTC_TOOLCHAIN_VERSION: &str = "nightly-2022-11-03";
const RUSTC_TOOLCHAIN_VERSION: &str = "nightly-2022-12-15";

struct DefaultCallbacks;
impl rustc_driver::Callbacks for DefaultCallbacks {}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2022-11-03"
channel = "nightly-2022-12-15"
components = ["cargo", "llvm-tools-preview", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
# This has to be synced with the toolchain in `github/workflows`
2 changes: 1 addition & 1 deletion util/update-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

if [[ $1 == nightly-????-??-?? ]]
then
sed -i "s/nightly-2022-11-03/$1/g" ./marker_driver_rustc/src/main.rs ./rust-toolchain .github/workflows/* ./util/update-toolchain.sh cargo-marker/src/main.rs
sed -i "s/nightly-2022-12-15/$1/g" ./marker_driver_rustc/src/main.rs ./rust-toolchain .github/workflows/* ./util/update-toolchain.sh cargo-marker/src/driver.rs
else
echo "Please enter a valid toolchain like \`nightly-2022-01-01\`"
fi;