Skip to content

Commit

Permalink
consistent handling of missing sysroot spans
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Nov 2, 2019
1 parent f39205b commit 05c0791
Show file tree
Hide file tree
Showing 25 changed files with 49 additions and 62 deletions.
3 changes: 1 addition & 2 deletions src/test/ui/async-await/issues/issue-62009-1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// edition:2018
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)

async fn print_dur() {}

Expand Down
12 changes: 6 additions & 6 deletions src/test/ui/async-await/issues/issue-62009-1.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/issue-62009-1.rs:8:5
--> $DIR/issue-62009-1.rs:7:5
|
LL | fn main() {
| ---- this is not `async`
LL | async { let (); }.await;
| ^^^^^^^^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/issue-62009-1.rs:10:5
--> $DIR/issue-62009-1.rs:9:5
|
LL | fn main() {
| ---- this is not `async`
Expand All @@ -19,19 +19,19 @@ LL | | }.await;
| |___________^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
--> $DIR/issue-62009-1.rs:14:5
--> $DIR/issue-62009-1.rs:13:5
|
LL | fn main() {
| ---- this is not `async`
...
LL | (|_| 2333).await;
| ^^^^^^^^^^^^^^^^ only allowed inside `async` functions and blocks

error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:14:5: 14:15]: std::future::Future` is not satisfied
--> $DIR/issue-62009-1.rs:14:5
error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:13:5: 13:15]: std::future::Future` is not satisfied
--> $DIR/issue-62009-1.rs:13:5
|
LL | (|_| 2333).await;
| ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:14:5: 14:15]`
| ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:13:5: 13:15]`
|
::: $SRC_DIR/libstd/future.rs:LL:COL
|
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/closures/closure-move-sync.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::thread;
use std::sync::mpsc::channel;

Expand Down
8 changes: 4 additions & 4 deletions src/test/ui/closures/closure-move-sync.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
--> $DIR/closure-move-sync.rs:8:13
--> $DIR/closure-move-sync.rs:7:13
|
LL | let t = thread::spawn(|| {
| ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
Expand All @@ -11,10 +11,10 @@ LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
|
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:8:27: 11:6 recv:&std::sync::mpsc::Receiver<()>]`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:7:27: 10:6 recv:&std::sync::mpsc::Receiver<()>]`

error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
--> $DIR/closure-move-sync.rs:20:5
--> $DIR/closure-move-sync.rs:19:5
|
LL | thread::spawn(|| tx.send(()).unwrap());
| ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
Expand All @@ -26,7 +26,7 @@ LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
|
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:20:19: 20:42 tx:&std::sync::mpsc::Sender<()>]`
= note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:19:19: 19:42 tx:&std::sync::mpsc::Sender<()>]`

error: aborting due to 2 previous errors

Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/consts/const-size_of-cycle.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-musl
// ignore-x86
// ignore-x86 FIXME: missing sysroot spans (#53081)
// error-pattern: cycle detected

struct Foo {
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/consts/const-size_of-cycle.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0391]: cycle detected when const-evaluating + checking `Foo::bytes::{{constant}}#0`
--> $DIR/const-size_of-cycle.rs:6:17
--> $DIR/const-size_of-cycle.rs:5:17
|
LL | bytes: [u8; std::mem::size_of::<Foo>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires const-evaluating + checking `Foo::bytes::{{constant}}#0`...
--> $DIR/const-size_of-cycle.rs:6:17
--> $DIR/const-size_of-cycle.rs:5:17
|
LL | bytes: [u8; std::mem::size_of::<Foo>()]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -23,7 +23,7 @@ LL | pub fn size_of<T>() -> usize;
= note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All, def_id: None }, value: [u8; _] }`...
= note: ...which again requires const-evaluating + checking `Foo::bytes::{{constant}}#0`, completing the cycle
note: cycle used when processing `Foo`
--> $DIR/const-size_of-cycle.rs:5:1
--> $DIR/const-size_of-cycle.rs:4:1
|
LL | struct Foo {
| ^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/impl-trait/impl-generic-mismatch.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-musl
// ignore-x86
// ignore-x86 FIXME: missing sysroot spans (#53081)

use std::fmt::Debug;

Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/impl-trait/impl-generic-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0643]: method `foo` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:11:12
--> $DIR/impl-generic-mismatch.rs:10:12
|
LL | fn foo(&self, _: &impl Debug);
| ---------- declaration in trait here
Expand All @@ -13,7 +13,7 @@ LL | fn foo(&self, _: &impl Debug) { }
| -- ^^^^^^^^^^

error[E0643]: method `bar` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:20:23
--> $DIR/impl-generic-mismatch.rs:19:23
|
LL | fn bar<U: Debug>(&self, _: &U);
| - declaration in trait here
Expand All @@ -27,7 +27,7 @@ LL | fn bar<U: Debug>(&self, _: &U) { }
| ^^^^^^^^^^ ^

error[E0643]: method `hash` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:31:33
--> $DIR/impl-generic-mismatch.rs:30:33
|
LL | fn hash(&self, hasher: &mut impl Hasher) {}
| ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
// aux-build:two_macros.rs

macro_rules! define_vec {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: macro-expanded `extern crate` items cannot shadow names passed with `--extern`
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:21:9
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:20:9
|
LL | extern crate std as core;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -8,13 +8,13 @@ LL | define_other_core!();
| --------------------- in this macro invocation

error[E0659]: `Vec` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:15:9
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:14:9
|
LL | Vec::panic!();
| ^^^ ambiguous name
|
note: `Vec` could refer to the crate imported here
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:7:9
--> $DIR/extern-prelude-extern-crate-restricted-shadowing.rs:6:9
|
LL | extern crate std as Vec;
| ^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::ops::Deref;
trait Trait {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: `impl` item signature doesn't match `trait` item signature
--> $DIR/mismatched_trait_impl-2.rs:10:5
--> $DIR/mismatched_trait_impl-2.rs:9:5
|
LL | fn deref(&self) -> &dyn Trait {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found fn(&Struct) -> &dyn Trait
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/interior-mutability/interior-mutability.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::cell::Cell;
use std::panic::catch_unwind;
fn main() {
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/interior-mutability/interior-mutability.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
--> $DIR/interior-mutability.rs:7:5
--> $DIR/interior-mutability.rs:6:5
|
LL | catch_unwind(|| { x.set(23); });
| ^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
Expand All @@ -12,7 +12,7 @@ LL | pub fn catch_unwind<F: FnOnce() -> R + UnwindSafe, R>(f: F) -> Result<R> {
= help: within `std::cell::Cell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>`
= note: required because it appears within the type `std::cell::Cell<i32>`
= note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::Cell<i32>`
= note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:7:18: 7:35 x:&std::cell::Cell<i32>]`
= note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:6:18: 6:35 x:&std::cell::Cell<i32>]`

error: aborting due to previous error

Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/issues/issue-21160.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
struct Bar;

impl Bar {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-21160.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the trait bound `Bar: std::hash::Hash` is not satisfied
--> $DIR/issue-21160.rs:10:12
--> $DIR/issue-21160.rs:9:12
|
LL | struct Foo(Bar);
| ^^^ the trait `std::hash::Hash` is not implemented for `Bar`
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/issues/issue-27033.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
fn main() {
match Some(1) {
None @ _ => {} //~ ERROR match bindings cannot shadow unit variants
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-27033.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0530]: match bindings cannot shadow unit variants
--> $DIR/issue-27033.rs:5:9
--> $DIR/issue-27033.rs:4:9
|
LL | None @ _ => {}
| ^^^^ cannot be named the same as a unit variant
Expand All @@ -10,7 +10,7 @@ LL | pub use crate::option::Option::{self, Some, None};
| ---- the unit variant `None` is defined here

error[E0530]: match bindings cannot shadow constants
--> $DIR/issue-27033.rs:9:9
--> $DIR/issue-27033.rs:8:9
|
LL | const C: u8 = 1;
| ---------------- the constant `C` is defined here
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/no-send-res-ports.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::thread;
use std::rc::Rc;

Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/no-send-res-ports.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely
--> $DIR/no-send-res-ports.rs:27:5
--> $DIR/no-send-res-ports.rs:26:5
|
LL | thread::spawn(move|| {
| ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely
Expand All @@ -9,10 +9,10 @@ LL | thread::spawn(move|| {
LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
| ---- required by this bound in `std::thread::spawn`
|
= help: within `[closure@$DIR/no-send-res-ports.rs:27:19: 31:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= help: within `[closure@$DIR/no-send-res-ports.rs:26:19: 30:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
= note: required because it appears within the type `Port<()>`
= note: required because it appears within the type `main::Foo`
= note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:27:19: 31:6 x:main::Foo]`
= note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:26:19: 30:6 x:main::Foo]`

error: aborting due to previous error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// compile-flags: --test
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)

use std::num::ParseFloatError;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: `main` has invalid return type `std::result::Result<f32, std::num::ParseFloatError>`
--> $DIR/termination-trait-test-wrong-type.rs:8:1
--> $DIR/termination-trait-test-wrong-type.rs:7:1
|
LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> {
LL | | "0".parse()
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/traits/trait-suggest-where-clause.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-x86
// ^ due to stderr output differences
// ignore-x86 FIXME: missing sysroot spans (#53081)
use std::mem;

struct Misc<T:?Sized>(T);
Expand Down
14 changes: 7 additions & 7 deletions src/test/ui/traits/trait-suggest-where-clause.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:9:20
--> $DIR/trait-suggest-where-clause.rs:8:20
|
LL | fn check<T: Iterator, U: ?Sized>() {
| -- help: consider further restricting this bound: `U: std::marker::Sized +`
Expand All @@ -16,7 +16,7 @@ LL | pub const fn size_of<T>() -> usize {
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:12:5
--> $DIR/trait-suggest-where-clause.rs:11:5
|
LL | fn check<T: Iterator, U: ?Sized>() {
| -- help: consider further restricting this bound: `U: std::marker::Sized +`
Expand All @@ -34,31 +34,31 @@ LL | pub const fn size_of<T>() -> usize {
= note: required because it appears within the type `Misc<U>`

error[E0277]: the trait bound `u64: std::convert::From<T>` is not satisfied
--> $DIR/trait-suggest-where-clause.rs:17:5
--> $DIR/trait-suggest-where-clause.rs:16:5
|
LL | <u64 as From<T>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<T>` is not implemented for `u64`
|
= note: required by `std::convert::From::from`

error[E0277]: the trait bound `u64: std::convert::From<<T as std::iter::Iterator>::Item>` is not satisfied
--> $DIR/trait-suggest-where-clause.rs:20:5
--> $DIR/trait-suggest-where-clause.rs:19:5
|
LL | <u64 as From<<T as Iterator>::Item>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<<T as std::iter::Iterator>::Item>` is not implemented for `u64`
|
= note: required by `std::convert::From::from`

error[E0277]: the trait bound `Misc<_>: std::convert::From<T>` is not satisfied
--> $DIR/trait-suggest-where-clause.rs:25:5
--> $DIR/trait-suggest-where-clause.rs:24:5
|
LL | <Misc<_> as From<T>>::from;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<T>` is not implemented for `Misc<_>`
|
= note: required by `std::convert::From::from`

error[E0277]: the size for values of type `[T]` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:30:20
--> $DIR/trait-suggest-where-clause.rs:29:20
|
LL | mem::size_of::<[T]>();
| ^^^ doesn't have a size known at compile-time
Expand All @@ -72,7 +72,7 @@ LL | pub const fn size_of<T>() -> usize {
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>

error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
--> $DIR/trait-suggest-where-clause.rs:33:5
--> $DIR/trait-suggest-where-clause.rs:32:5
|
LL | mem::size_of::<[&U]>();
| ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/type_length_limit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-musl
// ignore-x86
// ignore-x86 FIXME: missing sysroot spans (#53081)
// error-pattern: reached the type-length limit while instantiating

// Test that the type length limit can be changed.
Expand Down

0 comments on commit 05c0791

Please sign in to comment.