Skip to content
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

bump: rust 1.64.0 #474

Merged
merged 3 commits into from
Nov 6, 2022
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

- uses: Swatinem/rust-cache@v1
if: matrix.os != 'windows-latest'

- name: Doctests
uses: actions-rs/cargo@v1
env:
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
uses: actions-rs/install@v0.1
with:
crate: mdbook
version: 0.4.7
version: 0.4.21
use-tool-cache: true

- name: mdbook test
Expand Down Expand Up @@ -186,33 +186,33 @@ jobs:
with:
command: build
args: -p mun -p mun_runtime_capi

- name: Create build folder (debug)
run: cmake -E make_directory ${{ runner.workspace }}/build/debug

- name: Create build folder (release)
run: cmake -E make_directory ${{ runner.workspace }}/build/release

- name: Configure cmake (debug)
working-directory: ${{ runner.workspace }}/build/debug
run: cmake -DCMAKE_BUILD_TYPE=Debug -S ${{ github.workspace }} -Dmun_build_examples=ON -Dmun_build_tests=ON -Dmun_binaries_path=${{ github.workspace }}/target/debug/ -Dmun_examples_path=${{ github.workspace }}/examples

- name: Configure cmake (release)
working-directory: ${{ runner.workspace }}/build/release
run: cmake -DCMAKE_BUILD_TYPE=Release -S ${{ github.workspace }} -Dmun_build_examples=ON -Dmun_build_tests=ON -Dmun_binaries_path=${{ github.workspace }}/target/debug/ -Dmun_examples_path=${{ github.workspace }}/examples

- name: Build (debug)
working-directory: ${{ runner.workspace }}/build/debug
run: cmake --build . --config Debug

- name: Build (release)
working-directory: ${{ runner.workspace }}/build/release
run: cmake --build . --config Release

- name: Test (debug)
working-directory: ${{ runner.workspace }}/build/debug
run: ctest -C Debug

- name: Test (release)
working-directory: ${{ runner.workspace }}/build/release
run: ctest -C Release
Expand Down
4 changes: 2 additions & 2 deletions crates/mun_abi/src/dispatch_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ impl<'a> DispatchTable<'a> {
&mut self,
) -> impl Iterator<Item = (&mut *const c_void, &FunctionPrototype<'a>)> {
if self.num_entries == 0 {
(&mut []).iter_mut().zip((&[]).iter())
([]).iter_mut().zip(([]).iter())
} else {
let ptrs =
unsafe { slice::from_raw_parts_mut(self.fn_ptrs, self.num_entries as usize) };
Expand All @@ -34,7 +34,7 @@ impl<'a> DispatchTable<'a> {
/// Returns an iterator over pairs of function pointers and signatures.
pub fn iter(&self) -> impl Iterator<Item = (&*const c_void, &FunctionPrototype<'a>)> {
if self.num_entries == 0 {
(&[]).iter().zip((&[]).iter())
([]).iter().zip(([]).iter())
} else {
let ptrs =
unsafe { slice::from_raw_parts_mut(self.fn_ptrs, self.num_entries as usize) };
Expand Down
4 changes: 2 additions & 2 deletions crates/mun_abi/src/type_lut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'a> TypeLut<'a> {

(type_ids.iter(), ptrs.iter(), type_names.iter())
} else {
((&[]).iter(), (&[]).iter(), (&[]).iter())
(([]).iter(), ([]).iter(), ([]).iter())
};

izip!(type_ids, type_ptrs, type_names).map(|(id, ptr, type_name)| {
Expand All @@ -56,7 +56,7 @@ impl<'a> TypeLut<'a> {

(type_ids.iter(), ptrs.iter_mut(), type_names.iter())
} else {
((&[]).iter(), (&mut []).iter_mut(), (&[]).iter())
(([]).iter(), ([]).iter_mut(), ([]).iter())
};

izip!(type_ids, type_ptrs, type_names).map(|(id, ptr, type_name)| {
Expand Down
10 changes: 5 additions & 5 deletions crates/mun_compiler/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@ pub struct CompilerDatabase {

impl Upcast<dyn mun_hir::AstDatabase> for CompilerDatabase {
fn upcast(&self) -> &(dyn mun_hir::AstDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn mun_hir::SourceDatabase> for CompilerDatabase {
fn upcast(&self) -> &(dyn mun_hir::SourceDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn mun_hir::DefDatabase> for CompilerDatabase {
fn upcast(&self) -> &(dyn mun_hir::DefDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn mun_hir::HirDatabase> for CompilerDatabase {
fn upcast(&self) -> &(dyn mun_hir::HirDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn CodeGenDatabase> for CompilerDatabase {
fn upcast(&self) -> &(dyn CodeGenDatabase + 'static) {
&*self
self
}
}

Expand Down
3 changes: 2 additions & 1 deletion crates/mun_hir/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ impl dyn Diagnostic {
}

type DiagnosticCallback<'a> = Box<dyn FnMut(&dyn Diagnostic) -> Result<(), ()> + 'a>;
type DefaultDiagnosticsCallback<'a> = Box<dyn FnMut(&dyn Diagnostic) + 'a>;

pub struct DiagnosticSink<'a> {
callbacks: Vec<DiagnosticCallback<'a>>,
default_callback: Box<dyn FnMut(&dyn Diagnostic) + 'a>,
default_callback: DefaultDiagnosticsCallback<'a>,
}

impl<'a> DiagnosticSink<'a> {
Expand Down
2 changes: 1 addition & 1 deletion crates/mun_hir/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl Path {
fn lower_use_tree(
prefix: Option<Path>,
tree: &ast::UseTree,
cb: &mut dyn FnMut(Path, &ast::UseTree, bool, Option<ImportAlias>),
cb: &mut impl FnMut(Path, &ast::UseTree, bool, Option<ImportAlias>),
) {
if let Some(use_tree_list) = tree.use_tree_list() {
let prefix = match tree.path() {
Expand Down
8 changes: 4 additions & 4 deletions crates/mun_language_server/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,25 @@ impl salsa::Database for AnalysisDatabase {

impl Upcast<dyn mun_hir::AstDatabase> for AnalysisDatabase {
fn upcast(&self) -> &(dyn mun_hir::AstDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn mun_hir::SourceDatabase> for AnalysisDatabase {
fn upcast(&self) -> &(dyn mun_hir::SourceDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn mun_hir::DefDatabase> for AnalysisDatabase {
fn upcast(&self) -> &(dyn mun_hir::DefDatabase + 'static) {
&*self
self
}
}

impl Upcast<dyn mun_hir::HirDatabase> for AnalysisDatabase {
fn upcast(&self) -> &(dyn mun_hir::HirDatabase + 'static) {
&*self
self
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/mun_project/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ use std::str::FromStr;
mod toml;

/// Contains all information of a package. Usually this information is read from a mun.toml file.
#[derive(PartialEq, Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Manifest {
package_id: PackageId,
metadata: ManifestMetadata,
}

/// General metadata for a package.
#[derive(PartialEq, Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ManifestMetadata {
pub authors: Vec<String>,
}

/// Unique identifier of a package and version
#[derive(PartialEq, Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PackageId {
name: String,
version: semver::Version,
Expand Down
2 changes: 1 addition & 1 deletion crates/mun_project/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use semver::Version;
use std::fmt;
use std::path::{Path, PathBuf};

#[derive(Clone, PartialEq, Debug)]
#[derive(Clone, PartialEq, Eq, Debug)]
pub struct Package {
// The manifest of the package
manifest: Manifest,
Expand Down
4 changes: 2 additions & 2 deletions crates/mun_target/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum LinkerFlavor {

/// Everything Mun knows about a target.
/// Every field must be specified, there are no default values.
#[derive(PartialEq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Target {
/// Target triple to pass to LLVM
pub llvm_target: String,
Expand All @@ -33,7 +33,7 @@ pub struct Target {
}

/// Optional aspects of target specification.
#[derive(PartialEq, Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct TargetOptions {
/// True if this is a built-in target
pub is_builtin: bool,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.62
1.64