Auto merge of #47740 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 10 pull requests - Successful merges: #47534, #47609, #47679, #47691, #47700, #47702, #47717, #47721, #47726, #47729 - Failed merges:
This commit is contained in:
commit
9fd7da904b
26 changed files with 215 additions and 83 deletions
36
src/Cargo.lock
generated
36
src/Cargo.lock
generated
|
@ -179,7 +179,7 @@ dependencies = [
|
|||
"crypto-hash 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"curl 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"docopt 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"flate2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -265,6 +265,15 @@ name = "cfg-if"
|
|||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"num 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "2.29.0"
|
||||
|
@ -601,6 +610,18 @@ dependencies = [
|
|||
"regex 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"termcolor 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "error-chain"
|
||||
version = "0.8.1"
|
||||
|
@ -2654,6 +2675,16 @@ dependencies = [
|
|||
name = "tidy"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.39"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.2.1"
|
||||
|
@ -2903,6 +2934,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
"checksum cargo_metadata 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "20d6fb2b5574726329c85cdba0df0347fddfec3cf9c8b588f9931708280f5643"
|
||||
"checksum cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "deaf9ec656256bb25b404c51ef50097207b9cbb29c933d31f92cae5a8a0ffee0"
|
||||
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
|
||||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
|
||||
"checksum clap 2.29.0 (registry+https://github.com/rust-lang/crates.io-index)" = "110d43e343eb29f4f51c1db31beb879d546db27998577e5715270a54bcf41d3f"
|
||||
"checksum cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "56d741ea7a69e577f6d06b36b7dff4738f680593dc27a701ffa8506b73ce28bb"
|
||||
"checksum coco 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c06169f5beb7e31c7c67ebf5540b8b472d23e3eade3b2ec7d1f5b504a85f91bd"
|
||||
|
@ -2929,6 +2961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
"checksum enum_primitive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be4551092f4d519593039259a9ed8daedf0da12e5109c5280338073eaeb81180"
|
||||
"checksum env_logger 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f"
|
||||
"checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b"
|
||||
"checksum env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f15f0b172cb4f52ed5dbf47f774a387cd2315d1bf7894ab5af9b083ae27efa5a"
|
||||
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
|
||||
"checksum error-chain 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6930e04918388a9a2e41d518c25cf679ccafe26733fb4127dbf21993f2575d46"
|
||||
"checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82"
|
||||
|
@ -3085,6 +3118,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
"checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03"
|
||||
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
|
||||
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
|
||||
"checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098"
|
||||
"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"
|
||||
"checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e"
|
||||
"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
|
||||
|
|
|
@ -47,13 +47,6 @@ ENV \
|
|||
CC_x86_64_sun_solaris=x86_64-sun-solaris2.10-gcc \
|
||||
CXX_x86_64_sun_solaris=x86_64-sun-solaris2.10-g++
|
||||
|
||||
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It can
|
||||
# automatically pick the right compiler path.
|
||||
ENV \
|
||||
AR_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-ar \
|
||||
CC_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-clang \
|
||||
CXX_x86_64_unknown_cloudabi=x86_64-unknown-cloudabi-clang++
|
||||
|
||||
ENV TARGETS=x86_64-unknown-fuchsia
|
||||
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
|
||||
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
|
||||
|
|
|
@ -40,12 +40,6 @@ ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-c++
|
|||
ln -s ../lib/llvm-5.0/bin/lld /usr/bin/${target}-ld
|
||||
ln -s ../../${target} /usr/lib/llvm-5.0/${target}
|
||||
|
||||
# FIXME(EdSchouten): Remove this once cc ≥1.0.4 has been merged. It
|
||||
# can make use of ${target}-cc and ${target}-c++, without incorrectly
|
||||
# assuming it's MSVC.
|
||||
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang
|
||||
ln -s ../lib/llvm-5.0/bin/clang /usr/bin/${target}-clang++
|
||||
|
||||
# Install the C++ runtime libraries from CloudABI Ports.
|
||||
echo deb https://nuxi.nl/distfiles/cloudabi-ports/debian/ cloudabi cloudabi > \
|
||||
/etc/apt/sources.list.d/cloudabi.list
|
||||
|
|
|
@ -29,4 +29,4 @@ rustdoc reference.md
|
|||
An overview of how to use the `rustdoc` command is available [in the docs][1].
|
||||
Further details are available from the command line by with `rustdoc --help`.
|
||||
|
||||
[1]: https://github.com/rust-lang/rust/blob/master/src/doc/book/documentation.md
|
||||
[1]: https://github.com/rust-lang/rust/blob/master/src/doc/rustdoc/src/what-is-rustdoc.md
|
||||
|
|
|
@ -28,6 +28,7 @@ use util::nodemap::FxHashMap;
|
|||
|
||||
use syntax::ast;
|
||||
use syntax::symbol::Symbol;
|
||||
use syntax_pos::Span;
|
||||
use hir::itemlikevisit::ItemLikeVisitor;
|
||||
use hir;
|
||||
|
||||
|
@ -104,17 +105,18 @@ struct LanguageItemCollector<'a, 'tcx: 'a> {
|
|||
|
||||
impl<'a, 'v, 'tcx> ItemLikeVisitor<'v> for LanguageItemCollector<'a, 'tcx> {
|
||||
fn visit_item(&mut self, item: &hir::Item) {
|
||||
if let Some(value) = extract(&item.attrs) {
|
||||
if let Some((value, span)) = extract(&item.attrs) {
|
||||
let item_index = self.item_refs.get(&*value.as_str()).cloned();
|
||||
|
||||
if let Some(item_index) = item_index {
|
||||
let def_id = self.tcx.hir.local_def_id(item.id);
|
||||
self.collect_item(item_index, def_id);
|
||||
} else {
|
||||
let span = self.tcx.hir.span(item.id);
|
||||
span_err!(self.tcx.sess, span, E0522,
|
||||
"definition of an unknown language item: `{}`.",
|
||||
value);
|
||||
let mut err = struct_span_err!(self.tcx.sess, span, E0522,
|
||||
"definition of an unknown language item: `{}`",
|
||||
value);
|
||||
err.span_label(span, format!("definition of unknown language item `{}`", value));
|
||||
err.emit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -177,11 +179,11 @@ impl<'a, 'tcx> LanguageItemCollector<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn extract(attrs: &[ast::Attribute]) -> Option<Symbol> {
|
||||
pub fn extract(attrs: &[ast::Attribute]) -> Option<(Symbol, Span)> {
|
||||
for attribute in attrs {
|
||||
if attribute.check_name("lang") {
|
||||
if let Some(value) = attribute.value_str() {
|
||||
return Some(value)
|
||||
return Some((value, attribute.span));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
|||
}
|
||||
|
||||
pub fn link_name(attrs: &[ast::Attribute]) -> Option<Symbol> {
|
||||
lang_items::extract(attrs).and_then(|name| {
|
||||
lang_items::extract(attrs).and_then(|(name, _)| {
|
||||
$(if name == stringify!($name) {
|
||||
Some(Symbol::intern(stringify!($sym)))
|
||||
} else)* {
|
||||
|
@ -129,7 +129,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_foreign_item(&mut self, i: &hir::ForeignItem) {
|
||||
if let Some(lang_item) = lang_items::extract(&i.attrs) {
|
||||
if let Some((lang_item, _)) = lang_items::extract(&i.attrs) {
|
||||
self.register(&lang_item.as_str(), i.span);
|
||||
}
|
||||
intravisit::walk_foreign_item(self, i)
|
||||
|
|
|
@ -1273,14 +1273,6 @@ pub fn monitor<F: FnOnce() + Send + 'static>(f: F) {
|
|||
¬e,
|
||||
errors::Level::Note);
|
||||
}
|
||||
if match env::var_os("RUST_BACKTRACE") {
|
||||
Some(val) => &val != "0",
|
||||
None => false,
|
||||
} {
|
||||
handler.emit(&MultiSpan::new(),
|
||||
"run with `RUST_BACKTRACE=1` for a backtrace",
|
||||
errors::Level::Note);
|
||||
}
|
||||
|
||||
eprintln!("{}", str::from_utf8(&data.lock().unwrap()).unwrap());
|
||||
}
|
||||
|
|
|
@ -102,11 +102,18 @@ impl<'a, 'b> Visitor<'a> for UnusedImportCheckVisitor<'a, 'b> {
|
|||
}
|
||||
|
||||
if let ast::UseTreeKind::Nested(ref items) = use_tree.kind {
|
||||
// If it's the parent group, cover the entire use item
|
||||
let span = if nested {
|
||||
use_tree.span
|
||||
} else {
|
||||
self.item_span
|
||||
};
|
||||
|
||||
if items.len() == 0 {
|
||||
self.unused_imports
|
||||
.entry(self.base_id)
|
||||
.or_insert_with(NodeMap)
|
||||
.insert(id, self.item_span);
|
||||
.insert(id, span);
|
||||
}
|
||||
} else {
|
||||
let base_id = self.base_id;
|
||||
|
|
|
@ -15,7 +15,7 @@ use rustc::infer::InferOk;
|
|||
use rustc::traits::ObligationCause;
|
||||
|
||||
use syntax::ast;
|
||||
use syntax::util::parser::AssocOp;
|
||||
use syntax::util::parser::PREC_POSTFIX;
|
||||
use syntax_pos::{self, Span};
|
||||
use rustc::hir;
|
||||
use rustc::hir::print;
|
||||
|
@ -336,7 +336,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
// For now, don't suggest casting with `as`.
|
||||
let can_cast = false;
|
||||
|
||||
let needs_paren = expr.precedence().order() < (AssocOp::As.precedence() as i8);
|
||||
let needs_paren = expr.precedence().order() < (PREC_POSTFIX as i8);
|
||||
|
||||
if let Ok(src) = self.tcx.sess.codemap().span_to_snippet(expr.span) {
|
||||
let msg = format!("you can cast an `{}` to `{}`", checked_ty, expected_ty);
|
||||
|
|
|
@ -513,8 +513,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
// this isn't perfect (that is, there are cases when
|
||||
// implementing a trait would be legal but is rejected
|
||||
// here).
|
||||
(type_is_local || info.def_id.is_local())
|
||||
&& self.associated_item(info.def_id, item_name, Namespace::Value).is_some()
|
||||
(type_is_local || info.def_id.is_local()) &&
|
||||
self.associated_item(info.def_id, item_name, Namespace::Value)
|
||||
.filter(|item| {
|
||||
// We only want to suggest public or local traits (#45781).
|
||||
item.vis == ty::Visibility::Public || info.def_id.is_local()
|
||||
})
|
||||
.is_some()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
|
|
|
@ -75,12 +75,13 @@ This API is completely unstable and subject to change.
|
|||
#![feature(advanced_slice_patterns)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(conservative_impl_trait)]
|
||||
#![feature(copy_closures, clone_closures)]
|
||||
#![feature(crate_visibility_modifier)]
|
||||
#![feature(from_ref)]
|
||||
#![feature(match_default_bindings)]
|
||||
#![feature(never_type)]
|
||||
#![feature(option_filter)]
|
||||
#![feature(quote)]
|
||||
#![feature(refcell_replace_swap)]
|
||||
#![feature(rustc_diagnostic_macros)]
|
||||
|
|
|
@ -189,6 +189,10 @@ a.test-arrow {
|
|||
.stab.deprecated { background: #F3DFFF; border-color: #7F0087; }
|
||||
.stab.portability { background: #C4ECFF; border-color: #7BA5DB; }
|
||||
|
||||
.module-item .stab {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#help > div {
|
||||
background: #e9e9e9;
|
||||
border-color: #bfbfbf;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#![feature(lang_items)]
|
||||
|
||||
#[lang = "cookie"]
|
||||
fn cookie() -> ! { //~ E0522
|
||||
fn cookie() -> ! {
|
||||
//~^^ ERROR definition of an unknown language item: `cookie` [E0522]
|
||||
loop {}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
@ -8,17 +8,14 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: -Z borrowck=mir -Z nll
|
||||
|
||||
// This example comes from the NLL RFC.
|
||||
#![feature(nll)]
|
||||
|
||||
struct List<T> {
|
||||
value: T,
|
||||
next: Option<Box<List<T>>>,
|
||||
}
|
||||
|
||||
fn to_refs<T>(list: &mut List<T>) -> Vec<&mut T> {
|
||||
let mut list = list;
|
||||
fn to_refs<T>(mut list: &mut List<T>) -> Vec<&mut T> {
|
||||
let mut result = vec![];
|
||||
loop {
|
||||
result.push(&mut list.value);
|
||||
|
@ -31,4 +28,7 @@ fn to_refs<T>(list: &mut List<T>) -> Vec<&mut T> {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let mut list = List { value: 1, next: None };
|
||||
let vec = to_refs(&mut list);
|
||||
assert_eq!(vec![&mut 1], vec);
|
||||
}
|
|
@ -95,10 +95,8 @@ error[E0599]: no method named `method` found for type `Foo` in the current scope
|
|||
= note: the following traits define an item `method`, perhaps you need to implement one of them:
|
||||
candidate #1: `foo::Bar`
|
||||
candidate #2: `no_method_suggested_traits::foo::PubPub`
|
||||
candidate #3: `no_method_suggested_traits::bar::PubPriv`
|
||||
candidate #4: `no_method_suggested_traits::qux::PrivPub`
|
||||
candidate #5: `no_method_suggested_traits::quz::PrivPriv`
|
||||
candidate #6: `no_method_suggested_traits::Reexported`
|
||||
candidate #3: `no_method_suggested_traits::qux::PrivPub`
|
||||
candidate #4: `no_method_suggested_traits::Reexported`
|
||||
|
||||
error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
|
||||
--> $DIR/no-method-suggested-traits.rs:52:43
|
||||
|
@ -110,10 +108,8 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box
|
|||
= note: the following traits define an item `method`, perhaps you need to implement one of them:
|
||||
candidate #1: `foo::Bar`
|
||||
candidate #2: `no_method_suggested_traits::foo::PubPub`
|
||||
candidate #3: `no_method_suggested_traits::bar::PubPriv`
|
||||
candidate #4: `no_method_suggested_traits::qux::PrivPub`
|
||||
candidate #5: `no_method_suggested_traits::quz::PrivPriv`
|
||||
candidate #6: `no_method_suggested_traits::Reexported`
|
||||
candidate #3: `no_method_suggested_traits::qux::PrivPub`
|
||||
candidate #4: `no_method_suggested_traits::Reexported`
|
||||
|
||||
error[E0599]: no method named `method2` found for type `u64` in the current scope
|
||||
--> $DIR/no-method-suggested-traits.rs:55:10
|
||||
|
|
|
@ -38,10 +38,8 @@ error[E0599]: no method named `take` found for type `Foo` in the current scope
|
|||
`&mut Foo : std::iter::Iterator`
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
= note: the following traits define an item `take`, perhaps you need to implement one of them:
|
||||
candidate #1: `std::collections::hash::Recover`
|
||||
candidate #2: `std::io::Read`
|
||||
candidate #3: `std::iter::Iterator`
|
||||
candidate #4: `alloc::btree::Recover`
|
||||
candidate #1: `std::io::Read`
|
||||
candidate #2: `std::iter::Iterator`
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
error: unused import: `*`
|
||||
--> $DIR/owl-import-generates-unused-import-lint.rs:18:14
|
||||
|
|
||||
18 | use foo::{*, *}; //~ ERROR unused import: `*`
|
||||
| ^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/owl-import-generates-unused-import-lint.rs:12:9
|
||||
|
|
||||
12 | #![deny(unused_imports)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
|
@ -8,15 +8,9 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_nested_groups)]
|
||||
#![deny(unused_imports)]
|
||||
|
||||
mod foo {
|
||||
pub enum Bar {}
|
||||
}
|
||||
|
||||
use foo::{*, *}; //~ ERROR unused import: `*`
|
||||
struct T;
|
||||
|
||||
fn main() {
|
||||
let _: Bar;
|
||||
T::new();
|
||||
//~^ ERROR no function or associated item named `new` found for type `T` in the current scope
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
error[E0599]: no function or associated item named `new` found for type `T` in the current scope
|
||||
--> $DIR/dont-suggest-private-trait-method.rs:14:5
|
||||
|
|
||||
11 | struct T;
|
||||
| --------- function or associated item `new` not found for this
|
||||
...
|
||||
14 | T::new();
|
||||
| ^^^^^^ function or associated item not found in `T`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -312,4 +312,9 @@ fn main() {
|
|||
foo::<f32>(x_f64);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<f32>(x_f32);
|
||||
|
||||
foo::<u32>(x_u8 as u16);
|
||||
//~^ ERROR mismatched types
|
||||
foo::<i32>(-x_i8);
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
|
|
|
@ -882,5 +882,25 @@ error[E0308]: mismatched types
|
|||
312 | foo::<f32>(x_f64);
|
||||
| ^^^^^ expected f32, found f64
|
||||
|
||||
error: aborting due to 132 previous errors
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast.rs:316:16
|
||||
|
|
||||
316 | foo::<u32>(x_u8 as u16);
|
||||
| ^^^^^^^^^^^ expected u32, found u16
|
||||
help: you can cast an `u16` to `u32`, which will zero-extend the source value
|
||||
|
|
||||
316 | foo::<u32>((x_u8 as u16).into());
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/numeric-cast.rs:318:16
|
||||
|
|
||||
318 | foo::<i32>(-x_i8);
|
||||
| ^^^^^ expected i32, found i8
|
||||
help: you can cast an `i8` to `i32`, which will sign-extend the source value
|
||||
|
|
||||
318 | foo::<i32>((-x_i8).into());
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 134 previous errors
|
||||
|
||||
|
|
20
src/test/ui/unknown-language-item.rs
Normal file
20
src/test/ui/unknown-language-item.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![allow(unused)]
|
||||
#![feature(lang_items)]
|
||||
|
||||
#[lang = "foo"]
|
||||
fn bar() -> ! {
|
||||
//~^^ ERROR definition of an unknown language item: `foo`
|
||||
loop {}
|
||||
}
|
||||
|
||||
fn main() {}
|
8
src/test/ui/unknown-language-item.stderr
Normal file
8
src/test/ui/unknown-language-item.stderr
Normal file
|
@ -0,0 +1,8 @@
|
|||
error[E0522]: definition of an unknown language item: `foo`
|
||||
--> $DIR/unknown-language-item.rs:14:1
|
||||
|
|
||||
14 | #[lang = "foo"]
|
||||
| ^^^^^^^^^^^^^^^ definition of unknown language item `foo`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
35
src/test/ui/use-nested-groups-unused-imports.rs
Normal file
35
src/test/ui/use-nested-groups-unused-imports.rs
Normal file
|
@ -0,0 +1,35 @@
|
|||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(use_nested_groups)]
|
||||
#![allow(dead_code)]
|
||||
#![deny(unused_imports)]
|
||||
|
||||
mod foo {
|
||||
pub mod bar {
|
||||
pub mod baz {
|
||||
pub struct Bar();
|
||||
}
|
||||
pub mod foobar {}
|
||||
}
|
||||
|
||||
pub struct Foo();
|
||||
}
|
||||
|
||||
use foo::{Foo, bar::{baz::{}, foobar::*}, *};
|
||||
//~^ ERROR unused imports: `*`, `Foo`, `baz::{}`, `foobar::*`
|
||||
use foo::bar::baz::{*, *};
|
||||
//~^ ERROR unused import: `*`
|
||||
use foo::{};
|
||||
//~^ ERROR unused import: `use foo::{};`
|
||||
|
||||
fn main() {
|
||||
let _: Bar;
|
||||
}
|
26
src/test/ui/use-nested-groups-unused-imports.stderr
Normal file
26
src/test/ui/use-nested-groups-unused-imports.stderr
Normal file
|
@ -0,0 +1,26 @@
|
|||
error: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*`
|
||||
--> $DIR/use-nested-groups-unused-imports.rs:26:11
|
||||
|
|
||||
26 | use foo::{Foo, bar::{baz::{}, foobar::*}, *};
|
||||
| ^^^ ^^^^^^^ ^^^^^^^^^ ^
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/use-nested-groups-unused-imports.rs:13:9
|
||||
|
|
||||
13 | #![deny(unused_imports)]
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: unused import: `*`
|
||||
--> $DIR/use-nested-groups-unused-imports.rs:28:24
|
||||
|
|
||||
28 | use foo::bar::baz::{*, *};
|
||||
| ^
|
||||
|
||||
error: unused import: `use foo::{};`
|
||||
--> $DIR/use-nested-groups-unused-imports.rs:30:1
|
||||
|
|
||||
30 | use foo::{};
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
|
@ -1 +1 @@
|
|||
Subproject commit 6a8eb71f6d226f9ac869dbacd5ff6aa76deef1c4
|
||||
Subproject commit 91e36aa86c7037de50642f2fec1cf47c3d18af02
|
Loading…
Add table
Add a link
Reference in a new issue