Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Rustup to the latest nightly #116

Merged
merged 5 commits into from
Apr 20, 2020
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
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ matrix:
env: RUST_BACKTRACE=full
- name: "osx"
os: osx
osx_image: xcode10
osx_image: xcode11.3
env: RUST_BACKTRACE=full
- name: "windows"
os: windows
Expand All @@ -29,7 +29,7 @@ matrix:
- name: "clippy"
script: |
if rustup component add clippy-preview rustc-dev; then
cargo clippy --all -- -D clippy::pedantic
cargo clippy --all
fi
- name: "Shellcheck"
script:
Expand Down
1 change: 1 addition & 0 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ case "${TRAVIS_OS_NAME}" in
TEST_TARGET=x86_64-unknown-linux-gnu cargo test --verbose -- --nocapture
;;
*"windows"*)
rustup target add x86_64-pc-windows-msvc
TEST_TARGET=x86_64-pc-windows-msvc cargo test --verbose -- --nocapture
;;
*"macos"*)
Expand Down
5 changes: 3 additions & 2 deletions src/bin/cargo_semver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
#![allow(clippy::too_many_lines)]

extern crate curl;
extern crate getopts;
#[macro_use]
extern crate serde;
extern crate rustc_session;
extern crate serde_json;

use cargo::core::{Package, PackageId, Source, SourceId, Workspace};
use cargo::sources::RegistrySource;
use curl::easy::Easy;
use log::debug;
use rand::Rng;
use rustc_session::getopts;
use std::collections::HashSet;
use std::{
env,
Expand Down Expand Up @@ -268,8 +269,8 @@ fn run(config: &cargo::Config, matches: &getopts::Matches) -> Result<()> {

/// CLI utils
mod cli {
extern crate getopts;
use cargo::util::CliError;
use rustc_session::getopts;

/// CLI options
pub fn options() -> getopts::Options {
Expand Down
8 changes: 4 additions & 4 deletions src/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ impl Hash for InherentEntry {

// FIXME derive Hash again once AssocKind derives Hash again.
match self.kind {
AssocKind::Const => 0u8.hash(hasher),
AssocKind::Method => 1u8.hash(hasher),
AssocKind::OpaqueTy => 2u8.hash(hasher),
AssocKind::Type => 3u8.hash(hasher),
AssocKind::Const => 0_u8.hash(hasher),
AssocKind::Fn => 1_u8.hash(hasher),
AssocKind::OpaqueTy => 2_u8.hash(hasher),
AssocKind::Type => 3_u8.hash(hasher),
}

self.name.hash(hasher);
Expand Down
2 changes: 2 additions & 0 deletions src/mismatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ impl<'a, 'tcx> TypeRelation<'tcx> for MismatchRelation<'a, 'tcx> {
Relate::relate(self, a, b)
}

// Allow this since that lint is too pedantic here.
#[allow(clippy::similar_names)]
fn tys(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
use rustc_middle::ty::TyKind;

Expand Down
13 changes: 7 additions & 6 deletions src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ fn diff_fn<'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'tcx>, old: Res, new: Res)

/// Given two method items, perform structural checks.
fn diff_method<'tcx>(changes: &mut ChangeSet, tcx: TyCtxt<'tcx>, old: AssocItem, new: AssocItem) {
if old.method_has_self_argument != new.method_has_self_argument {
if old.fn_has_self_parameter != new.fn_has_self_parameter {
changes.add_change(
ChangeType::MethodSelfChanged {
now_self: new.method_has_self_argument,
now_self: new.fn_has_self_parameter,
},
old.def_id,
None,
Expand Down Expand Up @@ -628,8 +628,8 @@ fn diff_traits<'tcx>(
(Some(old_item), Some(new_item)) => {
let old_def_id = old_item.def_id;
let new_def_id = new_item.def_id;
let old_res = Res::Def(old_item.def_kind(), old_def_id);
let new_res = Res::Def(new_item.def_kind(), new_def_id);
let old_res = Res::Def(old_item.kind.as_def_kind(), old_def_id);
let new_res = Res::Def(new_item.kind.as_def_kind(), new_def_id);

id_mapping.add_trait_item(old_res, new_res, old);
changes.new_change(
Expand Down Expand Up @@ -1127,7 +1127,8 @@ fn is_impl_trait_public<'tcx>(tcx: TyCtxt<'tcx>, impl_def_id: DefId) -> bool {

// Check if all input types of the trait implementation are public (including `Self`).
let is_public = trait_ref
.input_types()
.substs
.types()
.map(|t| type_visibility(tcx, t))
.all(|v| v == Visibility::Public);

Expand Down Expand Up @@ -1275,7 +1276,7 @@ fn match_inherent_impl<'tcx>(
infcx.tcx.type_of(orig_item_def_id),
infcx.tcx.type_of(target_item_def_id),
),
(AssocKind::Method, AssocKind::Method) => {
(AssocKind::Fn, AssocKind::Fn) => {
diff_method(changes, tcx, orig_item, target_item);
let orig_sig = infcx.tcx.type_of(orig_item_def_id).fn_sig(tcx);
let target_sig = infcx.tcx.type_of(target_item_def_id).fn_sig(tcx);
Expand Down
2 changes: 2 additions & 0 deletions tests/cases/addition/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ warning: path changes to `Cde`
|
= note: added definition (technically breaking)

warning: 6 warnings emitted

3 changes: 3 additions & 0 deletions tests/cases/addition_path/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ warning: path changes to `d`
| |_^
|
= note: added definition (technically breaking)

warning: 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/addition_use/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ warning: path changes to `Bcd`
|
= note: added definition (technically breaking)

error: aborting due to previous error
error: aborting due to previous error; 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/bounds/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ warning: technically breaking changes in `def`
|
= note: removed bound: `A: std::clone::Clone` (technically breaking)

error: aborting due to 2 previous errors
error: aborting due to 2 previous errors; 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/consts/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ warning: non-breaking changes in `E`
|
= note: static item made mutable (non-breaking)

error: aborting due to 3 previous errors
error: aborting due to 3 previous errors; 1 warning emitted

2 changes: 1 addition & 1 deletion tests/cases/func/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ error: breaking changes in `ijk`
|
= warning: fn item made non-const (breaking)

error: aborting due to 6 previous errors
error: aborting due to 6 previous errors; 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/inherent_impls/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ warning: technically breaking changes in `def`
|
= note: added item in inherent impl (technically breaking)

error: aborting due to 4 previous errors
error: aborting due to 4 previous errors; 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/macros/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ warning: path changes to `quux2`
|
= note: added definition (technically breaking)

error: aborting due to 2 previous errors
error: aborting due to 2 previous errors; 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/mix/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ note: added path (technically breaking)
10 | pub use self::a::Def;
| ^^^^^^^^^^^^

error: aborting due to 3 previous errors
error: aborting due to 3 previous errors; 1 warning emitted
2 changes: 2 additions & 0 deletions tests/cases/pathologic_paths/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ warning: path changes to `b`
|
= note: added definition (technically breaking)

warning: 2 warnings emitted

2 changes: 2 additions & 0 deletions tests/cases/sealed_traits/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ note: added item to sealed trait (technically breaking)
2 | fn abc(&self) -> bool;
| ^^^^^^^^^^^^^^^^^^^^^^

warning: 1 warning emitted

2 changes: 1 addition & 1 deletion tests/cases/structs/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ warning: tuple struct with no public fields changed to a regular struct (breakin
28 | | }
| |_^

error: aborting due to 4 previous errors
error: aborting due to 4 previous errors; 2 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/trait_impls/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ warning: technically breaking changes in `<std::cell::Cell<(bool, T)> as new::Ab
|
= note: trait impl generalized or newly added (technically breaking)

error: aborting due to 2 previous errors
error: aborting due to 2 previous errors; 4 warnings emitted

2 changes: 1 addition & 1 deletion tests/cases/traits/stdout
Original file line number Diff line number Diff line change
Expand Up @@ -156,5 +156,5 @@ error: breaking changes in `Tuv`
|
= warning: removed bound on trait definition: `A: std::clone::Clone` (breaking)

error: aborting due to 13 previous errors
error: aborting due to 13 previous errors; 1 warning emitted

2 changes: 1 addition & 1 deletion tests/full_cases/libc-0.2.28-0.2.31.linux
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,6 @@ note: added path (technically breaking)
284 | pub use unix::*;
| ^^^^^^^

error: aborting due to 11 previous errors
error: aborting due to 11 previous errors; 63 warnings emitted

error: rustc-semverver errored
2 changes: 1 addition & 1 deletion tests/full_cases/libc-0.2.28-0.2.31.osx
Original file line number Diff line number Diff line change
Expand Up @@ -2367,6 +2367,6 @@ note: added path (technically breaking)
284 | pub use unix::*;
| ^^^^^^^

error: aborting due to previous error
error: aborting due to previous error; 194 warnings emitted

error: rustc-semverver errored
6 changes: 4 additions & 2 deletions tests/full_cases/log-0.3.4-0.3.8.linux
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ warning: technically breaking changes in `<new::LogRecord<'a> as std::fmt::Debug
|
= note: trait impl generalized or newly added (technically breaking)

warning: technically breaking changes in `<new::LogMetadata<'a> as std::cmp::Eq>`
warning: technically breaking changes in `<new::LogMetadata<'a> as std::marker::StructuralEq>`
--> log-0.3.8/src/lib.rs:552:10
|
552 | #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
Expand Down Expand Up @@ -71,7 +71,7 @@ warning: technically breaking changes in `<new::LogMetadata<'a> as std::fmt::Deb
|
= note: trait impl generalized or newly added (technically breaking)

warning: technically breaking changes in `<new::LogLocation as std::cmp::Eq>`
warning: technically breaking changes in `<new::LogLocation as std::marker::StructuralEq>`
--> log-0.3.8/src/lib.rs:604:30
|
604 | #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
Expand Down Expand Up @@ -157,3 +157,5 @@ warning: path changes to `ShutdownLoggerError`
|
= note: added definition (technically breaking)

warning: 18 warnings emitted

6 changes: 4 additions & 2 deletions tests/full_cases/log-0.3.4-0.3.8.osx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ warning: technically breaking changes in `<new::LogRecord<'a> as std::fmt::Debug
|
= note: trait impl generalized or newly added (technically breaking)

warning: technically breaking changes in `<new::LogMetadata<'a> as std::cmp::Eq>`
warning: technically breaking changes in `<new::LogMetadata<'a> as std::marker::StructuralEq>`
--> log-0.3.8/src/lib.rs:552:10
|
552 | #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
Expand Down Expand Up @@ -71,7 +71,7 @@ warning: technically breaking changes in `<new::LogMetadata<'a> as std::fmt::Deb
|
= note: trait impl generalized or newly added (technically breaking)

warning: technically breaking changes in `<new::LogLocation as std::cmp::Eq>`
warning: technically breaking changes in `<new::LogLocation as std::marker::StructuralEq>`
--> log-0.3.8/src/lib.rs:604:30
|
604 | #[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
Expand Down Expand Up @@ -157,3 +157,5 @@ warning: path changes to `ShutdownLoggerError`
|
= note: added definition (technically breaking)

warning: 18 warnings emitted

2 changes: 2 additions & 0 deletions tests/full_cases/log-0.3.4-0.3.8.windows_msvc
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,5 @@ warning: path changes to `ShutdownLoggerError`
|
= note: added definition (technically breaking)

warning: 18 warnings emitted

2 changes: 1 addition & 1 deletion tests/full_cases/rmpv-0.4.0-0.4.1.linux
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ warning: technically breaking changes in `<new::decode::Error as std::convert::F
|
= note: trait impl generalized or newly added (technically breaking)

error: aborting due to 4 previous errors
error: aborting due to 4 previous errors; 4 warnings emitted

error: rustc-semverver errored
2 changes: 1 addition & 1 deletion tests/full_cases/rmpv-0.4.0-0.4.1.osx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ warning: technically breaking changes in `<new::decode::Error as std::convert::F
|
= note: trait impl generalized or newly added (technically breaking)

error: aborting due to 4 previous errors
error: aborting due to 4 previous errors; 4 warnings emitted

error: rustc-semverver errored
2 changes: 1 addition & 1 deletion tests/full_cases/rmpv-0.4.0-0.4.1.windows_msvc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ warning: technically breaking changes in `<new::decode::Error as std::convert::F
|
= note: trait impl generalized or newly added (technically breaking)

error: aborting due to 4 previous errors
error: aborting due to 4 previous errors; 4 warnings emitted

error: rustc-semverver errored