Skip to content
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
3 changes: 0 additions & 3 deletions compiler/rustc_lint/src/early/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@ impl<'a> Diagnostic<'a, ()> for DecorateBuiltinLint<'_, '_> {
.into_diag(dcx, level)
}

BuiltinLintDiag::UnusedCrateDependency { extern_crate, local_crate } => {
lints::UnusedCrateDependency { extern_crate, local_crate }.into_diag(dcx, level)
}
BuiltinLintDiag::AttributeLint(kind) => {
DecorateAttrLint { sess: self.sess, tcx: self.tcx, diagnostic: &kind }
.into_diag(dcx, level)
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_lint/src/lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2994,14 +2994,6 @@ pub(crate) mod unexpected_cfg_value {
}
}

#[derive(Diagnostic)]
#[diag("extern crate `{$extern_crate}` is unused in crate `{$local_crate}`")]
#[help("remove the dependency or add `use {$extern_crate} as _;` to the crate root")]
pub(crate) struct UnusedCrateDependency {
pub extern_crate: Symbol,
pub local_crate: Symbol,
}

// FIXME(jdonszelmann): duplicated in rustc_attr_parsing, should be moved there completely.
#[derive(Diagnostic)]
#[diag(
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_lint_defs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,6 @@ pub enum BuiltinLintDiag {
/// Indicates if the named argument is used as a width/precision for formatting
is_formatting_arg: bool,
},
UnusedCrateDependency {
extern_crate: Symbol,
local_crate: Symbol,
},
AttributeLint(AttributeLintKind),
}

Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_metadata/src/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ use rustc_middle::bug;
use rustc_middle::ty::data_structures::IndexSet;
use rustc_middle::ty::{TyCtxt, TyCtxtFeed};
use rustc_proc_macro::bridge::client::ProcMacro;
use rustc_session::Session;
use rustc_session::config::{
CrateType, ExtendedTargetModifierInfo, ExternLocation, Externs, OptionsTargetModifiers,
TargetModifier,
};
use rustc_session::cstore::{CrateDepKind, CrateSource, ExternCrate, ExternCrateSource};
use rustc_session::lint::{self, BuiltinLintDiag};
use rustc_session::output::validate_crate_name;
use rustc_session::search_paths::PathKind;
use rustc_session::{Session, lint};
use rustc_span::def_id::DefId;
use rustc_span::edition::Edition;
use rustc_span::{DUMMY_SP, Ident, Span, Symbol, sym};
Expand Down Expand Up @@ -1211,7 +1210,7 @@ impl CStore {
lint::builtin::UNUSED_CRATE_DEPENDENCIES,
span,
ast::CRATE_NODE_ID,
BuiltinLintDiag::UnusedCrateDependency {
errors::UnusedCrateDependency {
extern_crate: name_interned,
local_crate: tcx.crate_name(LOCAL_CRATE),
},
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_metadata/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,3 +688,11 @@ pub struct RawDylibMalformed {
#[primary_span]
pub span: Span,
}

#[derive(Diagnostic)]
#[diag("extern crate `{$extern_crate}` is unused in crate `{$local_crate}`")]
#[help("remove the dependency or add `use {$extern_crate} as _;` to the crate root")]
pub(crate) struct UnusedCrateDependency {
pub extern_crate: Symbol,
pub local_crate: Symbol,
}
2 changes: 2 additions & 0 deletions library/core/src/fmt/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -594,13 +594,15 @@ impl_Debug! {
// Include wasm32 in here since it doesn't reflect the native pointer size, and
// often cares strongly about getting a smaller code size.
#[cfg(any(target_pointer_width = "64", target_arch = "wasm32"))]
#[doc(auto_cfg = false)]
mod imp {
use super::*;
impl_Display!(i8, u8, i16, u16, i32, u32, i64, u64, isize, usize; as u64 into display_u64);
impl_Exp!(i8, u8, i16, u16, i32, u32, i64, u64, isize, usize; as u64 into exp_u64);
}

#[cfg(not(any(target_pointer_width = "64", target_arch = "wasm32")))]
#[doc(auto_cfg = false)]
mod imp {
use super::*;
impl_Display!(i8, u8, i16, u16, i32, u32, isize, usize; as u32 into display_u32);
Expand Down
5 changes: 1 addition & 4 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1921,10 +1921,7 @@ impl<'test> TestCx<'test> {

// Allow tests to use internal and incomplete features.
compiler.args(&["-A", "internal_features"]);
// FIXME(#154168); temporarily exclude some directories to make the transition easier
if !input_file.iter().any(|p| p == "specialization") {
compiler.args(&["-A", "incomplete_features"]);
}
compiler.args(&["-A", "incomplete_features"]);

// Allow tests to have unused parens and braces.
// Add #![deny(unused_parens, unused_braces)] to the test file if you want to
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/specialization/assoc-ty-graph-cycle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Make sure we don't crash with a cycle error during coherence.

#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(specialization)]

trait Trait<T> {
type Assoc;
Expand Down
12 changes: 0 additions & 12 deletions tests/ui/specialization/assoc-ty-graph-cycle.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// regression test for #118987
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(specialization)]

trait Assoc {
type Output;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-impl-normalization-ambig-2.rs:2:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `u16: Assoc` is not satisfied
--> $DIR/default-impl-normalization-ambig-2.rs:17:14
|
Expand All @@ -20,6 +10,6 @@ help: the trait `Assoc` is implemented for `u8`
LL | impl Assoc for u8 {}
| ^^^^^^^^^^^^^^^^^

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

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// regression test for #73299.
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(specialization)]

trait X {
type U;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-item-normalization-ambig-1.rs:2:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default

error[E0119]: conflicting implementations of trait `Y` for type `<() as X>::U`
--> $DIR/default-item-normalization-ambig-1.rs:20:1
|
Expand All @@ -16,6 +6,6 @@ LL | impl Y for <() as X>::U {}
LL | impl Y for <i32 as X>::U {}
| ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `<() as X>::U`

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

For more information about this error, try `rustc --explain E0119`.
2 changes: 1 addition & 1 deletion tests/ui/specialization/cross-crate-defaults.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

//@ aux-build:cross_crates_defaults.rs

#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(specialization)]

extern crate cross_crates_defaults;

Expand Down
12 changes: 0 additions & 12 deletions tests/ui/specialization/cross-crate-defaults.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/specialization/ctfe/default-assoc-const.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Regression test for revealing associated types through specialization during const eval.
//@ check-pass
#![feature(specialization)]
//~^ WARNING the feature `specialization` is incomplete and may not be safe to use

trait Foo {
const ASSOC: usize;
Expand Down
12 changes: 0 additions & 12 deletions tests/ui/specialization/ctfe/default-assoc-const.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/specialization/ctfe/default-assoc-type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//! even if they rely on specialization.
//@ check-pass
#![feature(specialization)]
//~^ WARNING the feature `specialization` is incomplete and may not be safe to use

trait Foo {
type Assoc: Trait;
Expand Down
12 changes: 0 additions & 12 deletions tests/ui/specialization/ctfe/default-assoc-type.stderr

This file was deleted.

1 change: 0 additions & 1 deletion tests/ui/specialization/default-associated-type-bound-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// bounds on them.

#![feature(specialization)]
//~^ WARNING `specialization` is incomplete

trait X {
type U: Clone;
Expand Down
16 changes: 3 additions & 13 deletions tests/ui/specialization/default-associated-type-bound-1.stderr
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-associated-type-bound-1.rs:4:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/default-associated-type-bound-1.rs:18:22
--> $DIR/default-associated-type-bound-1.rs:17:22
|
LL | default type U = str;
| ^^^ the trait `Clone` is not implemented for `str`
|
help: the trait `Clone` is implemented for `String`
--> $SRC_DIR/alloc/src/string.rs:LL:COL
note: required by a bound in `X::U`
--> $DIR/default-associated-type-bound-1.rs:8:13
--> $DIR/default-associated-type-bound-1.rs:7:13
|
LL | type U: Clone;
| ^^^^^ required by this bound in `X::U`

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

For more information about this error, try `rustc --explain E0277`.
1 change: 0 additions & 1 deletion tests/ui/specialization/default-associated-type-bound-2.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Check that generic predicates are also checked for default associated types.
#![feature(specialization)]
//~^ WARNING `specialization` is incomplete

trait X<T> {
type U: PartialEq<T>;
Expand Down
16 changes: 3 additions & 13 deletions tests/ui/specialization/default-associated-type-bound-2.stderr
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-associated-type-bound-2.rs:2:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: can't compare `&'static B` with `B`
--> $DIR/default-associated-type-bound-2.rs:16:22
--> $DIR/default-associated-type-bound-2.rs:15:22
|
LL | default type U = &'static B;
| ^^^^^^^^^^ no implementation for `&'static B == B`
|
= help: the trait `PartialEq<B>` is not implemented for `&'static B`
note: required by a bound in `X::U`
--> $DIR/default-associated-type-bound-2.rs:6:13
--> $DIR/default-associated-type-bound-2.rs:5:13
|
LL | type U: PartialEq<T>;
| ^^^^^^^^^^^^ required by this bound in `X::U`
Expand All @@ -25,6 +15,6 @@ help: consider introducing a `where` clause, but there might be an alternative b
LL | impl<B: 'static, T> X<B> for T where &'static B: PartialEq<B> {
| ++++++++++++++++++++++++++++++

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

For more information about this error, try `rustc --explain E0277`.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Check that default generics associated types are validated.

#![feature(specialization)]
//~^ WARNING `specialization` is incomplete

trait X {
type U<'a>: PartialEq<&'a Self> where Self: 'a;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/default-generic-associated-type-bound.rs:3:12
|
LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^
|
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: can't compare `T` with `T`
--> $DIR/default-generic-associated-type-bound.rs:17:26
--> $DIR/default-generic-associated-type-bound.rs:16:26
|
LL | default type U<'a> = &'a T;
| ^^^^^ no implementation for `T == T`
|
= note: required for `&'a T` to implement `PartialEq`
note: required by a bound in `X::U`
--> $DIR/default-generic-associated-type-bound.rs:7:17
--> $DIR/default-generic-associated-type-bound.rs:6:17
|
LL | type U<'a>: PartialEq<&'a Self> where Self: 'a;
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `X::U`
Expand All @@ -25,6 +15,6 @@ help: consider further restricting type parameter `T` with trait `PartialEq`
LL | impl<T: 'static + std::cmp::PartialEq> X for T {
| +++++++++++++++++++++

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

For more information about this error, try `rustc --explain E0277`.
2 changes: 1 addition & 1 deletion tests/ui/specialization/defaultimpl/allowed-cross-crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

//@ aux-build:go_trait.rs

#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(specialization)]

extern crate go_trait;

Expand Down
12 changes: 0 additions & 12 deletions tests/ui/specialization/defaultimpl/allowed-cross-crate.stderr

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ui/specialization/defaultimpl/out-of-order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// Test that you can list the more specific impl before the more general one.

#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
#![feature(specialization)]

trait Foo {
type Out;
Expand Down
Loading
Loading