Skip to content

Commit

Permalink
Merge #79
Browse files Browse the repository at this point in the history
79: Bump rust nightly -> 2022-12-15 r=xFrednet a=xFrednet

Closes #55 

Co-authored-by: xFrednet <xFrednet@gmail.com>
  • Loading branch information
bors[bot] and xFrednet committed Jan 6, 2023
2 parents 0a449ed + fce9f3c commit bae724e
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 17 deletions.
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_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
14 changes: 6 additions & 8 deletions marker_driver_rustc/src/conversion/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ pub fn to_api_lifetime<'ast, 'tcx>(
_cx: &'ast RustcContext<'ast, 'tcx>,
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
2 changes: 1 addition & 1 deletion marker_driver_rustc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,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;

0 comments on commit bae724e

Please sign in to comment.