Auto merge of #104289 - Dylan-DPC:rollup-v7wei2t, r=Dylan-DPC
Rollup of 9 pull requests Successful merges: - #100633 (Consider `#[must_use]` annotation on `async fn` as also affecting the `Future::Output`) - #103445 (`#[test]`: Point at return type if `Termination` bound is unsatisfied) - #103924 (Fix broken link in description of error code E0706) - #104146 (Retry binding TCP Socket in remote-test-server) - #104169 (Migrate `:target` rules to use CSS variables) - #104202 (Fix ICE #103748) - #104216 (Don't ICE on operator trait methods with generic methods) - #104217 (Display help message when fluent arg was referenced incorrectly) - #104245 (Reduce default configuration's dependency upon static libstdcpp library (#103606)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
7d85104b96
50 changed files with 380 additions and 147 deletions
|
|
@ -781,7 +781,7 @@ impl Config {
|
|||
config.llvm_optimize = true;
|
||||
config.ninja_in_file = true;
|
||||
config.llvm_version_check = true;
|
||||
config.llvm_static_stdcpp = true;
|
||||
config.llvm_static_stdcpp = false;
|
||||
config.backtrace = true;
|
||||
config.rust_optimize = true;
|
||||
config.rust_optimize_tests = true;
|
||||
|
|
|
|||
|
|
@ -123,6 +123,10 @@ else
|
|||
# (And PGO is its own can of worms).
|
||||
if [ "$NO_DOWNLOAD_CI_LLVM" = "" ]; then
|
||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set llvm.download-ci-llvm=if-available"
|
||||
else
|
||||
# When building for CI we want to use the static C++ Standard library
|
||||
# included with LLVM, since a dynamic libstdcpp may not be available.
|
||||
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set llvm.static-libstdcpp"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -1269,6 +1269,8 @@ h3.variant {
|
|||
|
||||
:target {
|
||||
padding-right: 3px;
|
||||
background-color: var(--target-background-color);
|
||||
border-right: 3px solid var(--target-border-color);
|
||||
}
|
||||
|
||||
.notable-traits-tooltip {
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ Original by Dempfi (https://github.com/dempfi/ayu)
|
|||
--test-arrow-background-color: rgba(57, 175, 215, 0.09);
|
||||
--test-arrow-hover-color: #c5c5c5;
|
||||
--test-arrow-hover-background-color: rgba(57, 175, 215, 0.368);
|
||||
--target-background-color: rgba(255, 236, 164, 0.06);
|
||||
--target-border-color: rgba(255, 180, 76, 0.85);
|
||||
--rust-logo-filter: drop-shadow(1px 0 0px #fff)
|
||||
drop-shadow(0 1px 0 #fff)
|
||||
drop-shadow(-1px 0 0 #fff)
|
||||
|
|
@ -168,11 +170,6 @@ details.rustdoc-toggle > summary::before {
|
|||
color: #788797;
|
||||
}
|
||||
|
||||
:target {
|
||||
background: rgba(255, 236, 164, 0.06);
|
||||
border-right: 3px solid rgba(255, 180, 76, 0.85);
|
||||
}
|
||||
|
||||
.search-failed a {
|
||||
color: #39AFD7;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@
|
|||
--test-arrow-background-color: rgba(78, 139, 202, 0.2);
|
||||
--test-arrow-hover-color: #dedede;
|
||||
--test-arrow-hover-background-color: #4e8bca;
|
||||
--target-background-color: #494a3d;
|
||||
--target-border-color: #bb7410;
|
||||
--rust-logo-filter: drop-shadow(1px 0 0px #fff)
|
||||
drop-shadow(0 1px 0 #fff)
|
||||
drop-shadow(-1px 0 0 #fff)
|
||||
|
|
@ -90,11 +92,6 @@ details.rustdoc-toggle > summary::before {
|
|||
filter: invert(100%);
|
||||
}
|
||||
|
||||
:target {
|
||||
background-color: #494a3d;
|
||||
border-right: 3px solid #bb7410;
|
||||
}
|
||||
|
||||
.search-failed a {
|
||||
color: #0089ff;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@
|
|||
--test-arrow-background-color: rgba(78, 139, 202, 0.2);
|
||||
--test-arrow-hover-color: #f5f5f5;
|
||||
--test-arrow-hover-background-color: #4e8bca;
|
||||
--target-background-color: #fdFfd3;
|
||||
--target-border-color: #ad7c37;
|
||||
--rust-logo-filter: initial;
|
||||
/* match border-color; uses https://codepen.io/sosuke/pen/Pjoqqp */
|
||||
--crate-search-div-filter: invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg)
|
||||
|
|
@ -83,11 +85,6 @@ body.source .example-wrap pre.rust a {
|
|||
background: #eee;
|
||||
}
|
||||
|
||||
:target {
|
||||
background: #FDFFD3;
|
||||
border-right: 3px solid #AD7C37;
|
||||
}
|
||||
|
||||
.search-failed a {
|
||||
color: #3873AD;
|
||||
}
|
||||
|
|
|
|||
35
src/test/rustdoc-gui/target.goml
Normal file
35
src/test/rustdoc-gui/target.goml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// Check that the targetted element has the expected styles.
|
||||
goto: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html#method.a_method"
|
||||
show-text: true
|
||||
|
||||
// Confirming that the method is the target.
|
||||
assert: "#method\.a_method:target"
|
||||
|
||||
define-function: (
|
||||
"check-style",
|
||||
(theme, background, border),
|
||||
[
|
||||
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
|
||||
("reload"),
|
||||
("assert-css", ("#method\.a_method:target", {
|
||||
"background-color": |background|,
|
||||
"border-right": "3px solid " + |border|,
|
||||
})),
|
||||
],
|
||||
)
|
||||
|
||||
call-function: ("check-style", {
|
||||
"theme": "ayu",
|
||||
"background": "rgba(255, 236, 164, 0.06)",
|
||||
"border": "rgba(255, 180, 76, 0.85)",
|
||||
})
|
||||
call-function: ("check-style", {
|
||||
"theme": "dark",
|
||||
"background": "rgb(73, 74, 61)",
|
||||
"border": "rgb(187, 116, 16)",
|
||||
})
|
||||
call-function: ("check-style", {
|
||||
"theme": "light",
|
||||
"background": "rgb(253, 255, 211)",
|
||||
"border": "rgb(173, 124, 55)",
|
||||
})
|
||||
|
|
@ -16,7 +16,7 @@ LL | / || match out_ref {
|
|||
LL | | Variant::A => (),
|
||||
LL | | Variant::B => (),
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
@ -28,7 +28,7 @@ LL | / || match here.field {
|
|||
LL | | Variant::A => (),
|
||||
LL | | Variant::B => (),
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ warning: unused `MustUseDeprecated` that must be used
|
|||
--> $DIR/cfg-attr-multi-true.rs:19:5
|
||||
|
|
||||
LL | MustUseDeprecated::new();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/cfg-attr-multi-true.rs:7:9
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ warning: unused generator that must be used
|
|||
LL | / move || {
|
||||
LL | | A.test(yield);
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
@ -16,7 +16,7 @@ LL | / static move || {
|
|||
LL | | yield *y.borrow();
|
||||
LL | | return "Done";
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | | loop {
|
|||
LL | | yield
|
||||
LL | | }
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LL | | match Enum::A(String::new()) {
|
|||
... |
|
||||
LL | | }
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LL | | yield;
|
|||
... |
|
||||
LL | | *bar = 2;
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LL | | // and it should also find out that `a` is not live.
|
|||
... |
|
||||
LL | | let _ = &a;
|
||||
LL | | };
|
||||
| |__________^
|
||||
| |_________^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ LL | / || {
|
|||
LL | | let b = true;
|
||||
LL | | foo(yield, &b);
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LL | | let _t = box (&x, yield 0, &y);
|
|||
... |
|
||||
LL | | }
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ LL | | // See https://github.com/rust-lang/rust/issues/52792
|
|||
... |
|
||||
LL | | }
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ LL | / || {
|
|||
LL | | yield a;
|
||||
LL | | yield b;
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ warning: unused closure that must be used
|
|||
--> $DIR/issue-1460.rs:6:5
|
||||
|
|
||||
LL | {|i: u32| if 1 == i { }};
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ warning: unused closure that must be used
|
|||
--> $DIR/issue-16256.rs:6:5
|
||||
|
|
||||
LL | |c: u8| buf.push(c);
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ warning: unused return value of `need_to_use_this_value` that must be used
|
|||
--> $DIR/fn_must_use.rs:55:5
|
||||
|
|
||||
LL | need_to_use_this_value();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: it's important
|
||||
note: the lint level is defined here
|
||||
|
|
@ -15,13 +15,13 @@ warning: unused return value of `MyStruct::need_to_use_this_method_value` that m
|
|||
--> $DIR/fn_must_use.rs:60:5
|
||||
|
|
||||
LL | m.need_to_use_this_method_value();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused return value of `EvenNature::is_even` that must be used
|
||||
--> $DIR/fn_must_use.rs:61:5
|
||||
|
|
||||
LL | m.is_even(); // trait method!
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: no side effects
|
||||
|
||||
|
|
@ -29,19 +29,19 @@ warning: unused return value of `MyStruct::need_to_use_this_associated_function_
|
|||
--> $DIR/fn_must_use.rs:64:5
|
||||
|
|
||||
LL | MyStruct::need_to_use_this_associated_function_value();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
warning: unused return value of `std::cmp::PartialEq::eq` that must be used
|
||||
--> $DIR/fn_must_use.rs:70:5
|
||||
|
|
||||
LL | 2.eq(&3);
|
||||
| ^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
||||
warning: unused return value of `std::cmp::PartialEq::eq` that must be used
|
||||
--> $DIR/fn_must_use.rs:71:5
|
||||
|
|
||||
LL | m.eq(&n);
|
||||
| ^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
||||
warning: unused comparison that must be used
|
||||
--> $DIR/fn_must_use.rs:74:5
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ warning: unused return value of `Box::<T>::from_raw` that must be used
|
|||
--> $DIR/must-use-box-from-raw.rs:8:5
|
||||
|
|
||||
LL | Box::from_raw(ptr);
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
|
||||
note: the lint level is defined here
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unused array of `S` that must be used
|
|||
--> $DIR/must_use-array.rs:39:5
|
||||
|
|
||||
LL | singleton();
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/must_use-array.rs:1:9
|
||||
|
|
@ -14,7 +14,7 @@ error: unused array of `S` that must be used
|
|||
--> $DIR/must_use-array.rs:40:5
|
||||
|
|
||||
LL | many();
|
||||
| ^^^^^^^
|
||||
| ^^^^^^
|
||||
|
||||
error: unused array of `S` in tuple element 0 that must be used
|
||||
--> $DIR/must_use-array.rs:41:6
|
||||
|
|
@ -26,7 +26,7 @@ error: unused array of implementers of `T` that must be used
|
|||
--> $DIR/must_use-array.rs:42:5
|
||||
|
|
||||
LL | array_of_impl_trait();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unused array of boxed `T` trait objects in tuple element 1 that must be used
|
||||
--> $DIR/must_use-array.rs:43:5
|
||||
|
|
@ -38,7 +38,7 @@ error: unused array of arrays of arrays of `S` that must be used
|
|||
--> $DIR/must_use-array.rs:45:5
|
||||
|
|
||||
LL | array_of_arrays_of_arrays();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unused implementer of `Iterator` that must be used
|
|||
--> $DIR/must_use-in-stdlib-traits.rs:42:4
|
||||
|
|
||||
LL | iterator();
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^^^^
|
||||
|
|
||||
= note: iterators are lazy and do nothing unless consumed
|
||||
note: the lint level is defined here
|
||||
|
|
@ -15,7 +15,7 @@ error: unused implementer of `Future` that must be used
|
|||
--> $DIR/must_use-in-stdlib-traits.rs:43:4
|
||||
|
|
||||
LL | future();
|
||||
| ^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: futures do nothing unless you `.await` or poll them
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ error: unused implementer of `FnOnce` that must be used
|
|||
--> $DIR/must_use-in-stdlib-traits.rs:44:4
|
||||
|
|
||||
LL | square_fn_once();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ error: unused implementer of `FnMut` that must be used
|
|||
--> $DIR/must_use-in-stdlib-traits.rs:45:4
|
||||
|
|
||||
LL | square_fn_mut();
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ error: unused implementer of `Fn` that must be used
|
|||
--> $DIR/must_use-in-stdlib-traits.rs:46:4
|
||||
|
|
||||
LL | square_fn();
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unused implementer of `Critical` that must be used
|
|||
--> $DIR/must_use-trait.rs:33:5
|
||||
|
|
||||
LL | get_critical();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/must_use-trait.rs:1:9
|
||||
|
|
@ -14,13 +14,13 @@ error: unused boxed `Critical` trait object that must be used
|
|||
--> $DIR/must_use-trait.rs:34:5
|
||||
|
|
||||
LL | get_boxed_critical();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unused boxed boxed `Critical` trait object that must be used
|
||||
--> $DIR/must_use-trait.rs:35:5
|
||||
|
|
||||
LL | get_nested_boxed_critical();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unused boxed `Critical` trait object in tuple element 1 that must be used
|
||||
--> $DIR/must_use-trait.rs:37:5
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unused return value of `foo` that must be used
|
|||
--> $DIR/must_use-unit.rs:13:5
|
||||
|
|
||||
LL | foo();
|
||||
| ^^^^^^
|
||||
| ^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/must_use-unit.rs:2:9
|
||||
|
|
@ -14,7 +14,7 @@ error: unused return value of `bar` that must be used
|
|||
--> $DIR/must_use-unit.rs:15:5
|
||||
|
|
||||
LL | bar();
|
||||
| ^^^^^^
|
||||
| ^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,24 +1,43 @@
|
|||
// edition:2018
|
||||
// run-pass
|
||||
#![allow(dead_code)]
|
||||
#![deny(unused_must_use)]
|
||||
|
||||
|
||||
#[must_use]
|
||||
//~^ WARNING `must_use`
|
||||
async fn test() -> i32 {
|
||||
async fn foo() -> i32 {
|
||||
1
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
fn bar() -> impl std::future::Future<Output=i32> {
|
||||
async {
|
||||
42
|
||||
}
|
||||
}
|
||||
|
||||
async fn baz() -> i32 {
|
||||
0
|
||||
}
|
||||
|
||||
struct Wowee {}
|
||||
|
||||
impl Wowee {
|
||||
#[must_use]
|
||||
//~^ WARNING `must_use`
|
||||
async fn test_method() -> i32 {
|
||||
1
|
||||
}
|
||||
}
|
||||
|
||||
async fn test() {
|
||||
foo(); //~ ERROR unused return value of `foo` that must be used
|
||||
//~^ ERROR unused implementer of `Future` that must be used
|
||||
foo().await; //~ ERROR unused output of future returned by `foo` that must be used
|
||||
bar(); //~ ERROR unused return value of `bar` that must be used
|
||||
//~^ ERROR unused implementer of `Future` that must be used
|
||||
bar().await; //~ ERROR unused output of future returned by `bar` that must be used
|
||||
baz(); //~ ERROR unused implementer of `Future` that must be used
|
||||
baz().await; // ok
|
||||
}
|
||||
|
||||
/* FIXME(guswynn) update this test when async-fn-in-traits works
|
||||
trait Doer {
|
||||
#[must_use]
|
||||
|
|
|
|||
|
|
@ -1,26 +1,55 @@
|
|||
warning: `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
|
||||
--> $DIR/unused-async.rs:5:1
|
||||
error: unused implementer of `Future` that must be used
|
||||
--> $DIR/unused-async.rs:31:5
|
||||
|
|
||||
LL | #[must_use]
|
||||
| ^^^^^^^^^^^
|
||||
LL |
|
||||
LL | / async fn test() -> i32 {
|
||||
LL | | 1
|
||||
LL | | }
|
||||
| |_- this attribute does nothing, the `Future`s returned by async functions are already `must_use`
|
||||
LL | foo();
|
||||
| ^^^^^
|
||||
|
|
||||
= note: `#[warn(unused_attributes)]` on by default
|
||||
|
||||
warning: `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
|
||||
--> $DIR/unused-async.rs:15:5
|
||||
= note: futures do nothing unless you `.await` or poll them
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unused-async.rs:2:9
|
||||
|
|
||||
LL | #[must_use]
|
||||
| ^^^^^^^^^^^
|
||||
LL |
|
||||
LL | / async fn test_method() -> i32 {
|
||||
LL | | 1
|
||||
LL | | }
|
||||
| |_____- this attribute does nothing, the `Future`s returned by async functions are already `must_use`
|
||||
LL | #![deny(unused_must_use)]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
warning: 2 warnings emitted
|
||||
error: unused return value of `foo` that must be used
|
||||
--> $DIR/unused-async.rs:31:5
|
||||
|
|
||||
LL | foo();
|
||||
| ^^^^^
|
||||
|
||||
error: unused output of future returned by `foo` that must be used
|
||||
--> $DIR/unused-async.rs:33:5
|
||||
|
|
||||
LL | foo().await;
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: unused implementer of `Future` that must be used
|
||||
--> $DIR/unused-async.rs:34:5
|
||||
|
|
||||
LL | bar();
|
||||
| ^^^^^
|
||||
|
|
||||
= note: futures do nothing unless you `.await` or poll them
|
||||
|
||||
error: unused return value of `bar` that must be used
|
||||
--> $DIR/unused-async.rs:34:5
|
||||
|
|
||||
LL | bar();
|
||||
| ^^^^^
|
||||
|
||||
error: unused output of future returned by `bar` that must be used
|
||||
--> $DIR/unused-async.rs:36:5
|
||||
|
|
||||
LL | bar().await;
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: unused implementer of `Future` that must be used
|
||||
--> $DIR/unused-async.rs:37:5
|
||||
|
|
||||
LL | baz();
|
||||
| ^^^^^
|
||||
|
|
||||
= note: futures do nothing unless you `.await` or poll them
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error: unused closure that must be used
|
|||
LL | / || {
|
||||
LL | | println!("Hello!");
|
||||
LL | | };
|
||||
| |______^
|
||||
| |_____^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
note: the lint level is defined here
|
||||
|
|
@ -17,7 +17,7 @@ error: unused implementer of `Future` that must be used
|
|||
--> $DIR/unused-closure.rs:13:5
|
||||
|
|
||||
LL | async {};
|
||||
| ^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: futures do nothing unless you `.await` or poll them
|
||||
|
||||
|
|
@ -25,7 +25,7 @@ error: unused closure that must be used
|
|||
--> $DIR/unused-closure.rs:14:5
|
||||
|
|
||||
LL | || async {};
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ error: unused closure that must be used
|
|||
--> $DIR/unused-closure.rs:15:5
|
||||
|
|
||||
LL | async || {};
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ error: unused array of boxed arrays of closures that must be used
|
|||
--> $DIR/unused-closure.rs:18:5
|
||||
|
|
||||
LL | [Box::new([|| {}; 10]); 1];
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ error: unused closure that must be used
|
|||
--> $DIR/unused-closure.rs:20:5
|
||||
|
|
||||
LL | vec![|| "a"].pop().unwrap();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ error: unused closure that must be used
|
|||
--> $DIR/unused-closure.rs:23:9
|
||||
|
|
||||
LL | || true;
|
||||
| ^^^^^^^^
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: closures are lazy and do nothing unless called
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unused `MustUse` that must be used
|
|||
--> $DIR/unused-result.rs:21:5
|
||||
|
|
||||
LL | foo::<MustUse>();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unused-result.rs:2:25
|
||||
|
|
@ -14,7 +14,7 @@ error: unused `MustUseMsg` that must be used
|
|||
--> $DIR/unused-result.rs:22:5
|
||||
|
|
||||
LL | foo::<MustUseMsg>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: some message
|
||||
|
||||
|
|
@ -34,13 +34,13 @@ error: unused `MustUse` that must be used
|
|||
--> $DIR/unused-result.rs:35:5
|
||||
|
|
||||
LL | foo::<MustUse>();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unused `MustUseMsg` that must be used
|
||||
--> $DIR/unused-result.rs:36:5
|
||||
|
|
||||
LL | foo::<MustUseMsg>();
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: some message
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: unused implementer of `Iterator` that must be used
|
|||
--> $DIR/unused-supertrait.rs:9:5
|
||||
|
|
||||
LL | it();
|
||||
| ^^^^^
|
||||
| ^^^^
|
||||
|
|
||||
= note: iterators are lazy and do nothing unless consumed
|
||||
note: the lint level is defined here
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ error: unused `X` that must be used
|
|||
--> $DIR/unused_attributes-must_use.rs:103:5
|
||||
|
|
||||
LL | X;
|
||||
| ^^
|
||||
| ^
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/unused_attributes-must_use.rs:2:28
|
||||
|
|
@ -151,37 +151,37 @@ error: unused `Y` that must be used
|
|||
--> $DIR/unused_attributes-must_use.rs:104:5
|
||||
|
|
||||
LL | Y::Z;
|
||||
| ^^^^^
|
||||
| ^^^^
|
||||
|
||||
error: unused `U` that must be used
|
||||
--> $DIR/unused_attributes-must_use.rs:105:5
|
||||
|
|
||||
LL | U { unit: () };
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: unused return value of `U::method` that must be used
|
||||
--> $DIR/unused_attributes-must_use.rs:106:5
|
||||
|
|
||||
LL | U::method();
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^
|
||||
|
||||
error: unused return value of `foo` that must be used
|
||||
--> $DIR/unused_attributes-must_use.rs:107:5
|
||||
|
|
||||
LL | foo();
|
||||
| ^^^^^^
|
||||
| ^^^^^
|
||||
|
||||
error: unused return value of `foreign_foo` that must be used
|
||||
--> $DIR/unused_attributes-must_use.rs:110:9
|
||||
|
|
||||
LL | foreign_foo();
|
||||
| ^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: unused return value of `Use::get_four` that must be used
|
||||
--> $DIR/unused_attributes-must_use.rs:118:5
|
||||
|
|
||||
LL | ().get_four();
|
||||
| ^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 28 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ warning: unused generator that must be used
|
|||
--> $DIR/issue-48623-generator.rs:15:5
|
||||
|
|
||||
LL | move || { d; yield; &mut *r };
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: generators are lazy and do nothing unless resumed
|
||||
= note: `#[warn(unused_must_use)]` on by default
|
||||
|
|
|
|||
8
src/test/ui/parser/issue-103748-ICE-wrong-braces.rs
Normal file
8
src/test/ui/parser/issue-103748-ICE-wrong-braces.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#![crate_type = "lib"]
|
||||
|
||||
struct Apple((Apple, Option(Banana ? Citron)));
|
||||
//~^ ERROR invalid `?` in type
|
||||
//~| ERROR expected one of `)` or `,`, found `Citron`
|
||||
//~| ERROR cannot find type `Citron` in this scope [E0412]
|
||||
//~| ERROR parenthesized type parameters may only be used with a `Fn` trait [E0214]
|
||||
//~| ERROR recursive type `Apple` has infinite size [E0072]
|
||||
51
src/test/ui/parser/issue-103748-ICE-wrong-braces.stderr
Normal file
51
src/test/ui/parser/issue-103748-ICE-wrong-braces.stderr
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
error: invalid `?` in type
|
||||
--> $DIR/issue-103748-ICE-wrong-braces.rs:3:36
|
||||
|
|
||||
LL | struct Apple((Apple, Option(Banana ? Citron)));
|
||||
| ^ `?` is only allowed on expressions, not types
|
||||
|
|
||||
help: if you meant to express that the type might not contain a value, use the `Option` wrapper type
|
||||
|
|
||||
LL | struct Apple((Apple, Option(Option<Banana > Citron)));
|
||||
| +++++++ ~
|
||||
|
||||
error: expected one of `)` or `,`, found `Citron`
|
||||
--> $DIR/issue-103748-ICE-wrong-braces.rs:3:38
|
||||
|
|
||||
LL | struct Apple((Apple, Option(Banana ? Citron)));
|
||||
| -^^^^^^ expected one of `)` or `,`
|
||||
| |
|
||||
| help: missing `,`
|
||||
|
||||
error[E0412]: cannot find type `Citron` in this scope
|
||||
--> $DIR/issue-103748-ICE-wrong-braces.rs:3:38
|
||||
|
|
||||
LL | struct Apple((Apple, Option(Banana ? Citron)));
|
||||
| ^^^^^^ not found in this scope
|
||||
|
||||
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
|
||||
--> $DIR/issue-103748-ICE-wrong-braces.rs:3:22
|
||||
|
|
||||
LL | struct Apple((Apple, Option(Banana ? Citron)));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses
|
||||
|
|
||||
help: use angle brackets instead
|
||||
|
|
||||
LL | struct Apple((Apple, Option<Banana ? Citron>));
|
||||
| ~ ~
|
||||
|
||||
error[E0072]: recursive type `Apple` has infinite size
|
||||
--> $DIR/issue-103748-ICE-wrong-braces.rs:3:1
|
||||
|
|
||||
LL | struct Apple((Apple, Option(Banana ? Citron)));
|
||||
| ^^^^^^^^^^^^ ----- recursive without indirection
|
||||
|
|
||||
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
||||
|
|
||||
LL | struct Apple((Box<Apple>, Option(Banana ? Citron)));
|
||||
| ++++ +
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0072, E0214, E0412.
|
||||
For more information about an error, try `rustc --explain E0072`.
|
||||
|
|
@ -1,12 +1,10 @@
|
|||
error[E0277]: the trait bound `f32: Termination` is not satisfied
|
||||
--> $DIR/termination-trait-test-wrong-type.rs:6:1
|
||||
--> $DIR/termination-trait-test-wrong-type.rs:6:31
|
||||
|
|
||||
LL | #[test]
|
||||
| ------- in this procedural macro expansion
|
||||
LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> {
|
||||
LL | | "0".parse()
|
||||
LL | | }
|
||||
| |_^ the trait `Termination` is not implemented for `f32`
|
||||
LL | #[test]
|
||||
| ------- in this procedural macro expansion
|
||||
LL | fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Termination` is not implemented for `f32`
|
||||
|
|
||||
= note: required for `Result<f32, ParseFloatError>` to implement `Termination`
|
||||
note: required by a bound in `assert_test_result`
|
||||
|
|
|
|||
23
src/test/ui/traits/invalid_operator_trait.rs
Normal file
23
src/test/ui/traits/invalid_operator_trait.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#![crate_type = "lib"]
|
||||
#![feature(lang_items)]
|
||||
#![feature(no_core)]
|
||||
#![no_core]
|
||||
|
||||
#[lang="sized"]
|
||||
pub trait Sized {
|
||||
// Empty.
|
||||
}
|
||||
|
||||
#[lang = "add"]
|
||||
trait Add<RHS=Self> {
|
||||
type Output;
|
||||
|
||||
fn add<Y>(self, _: RHS) -> Self::Output;
|
||||
//~^ ERROR `add` must not have any generic parameters
|
||||
}
|
||||
|
||||
#[allow(unreachable_code)]
|
||||
fn ice(a: usize) {
|
||||
let r = loop {};
|
||||
r = r + a;
|
||||
}
|
||||
8
src/test/ui/traits/invalid_operator_trait.stderr
Normal file
8
src/test/ui/traits/invalid_operator_trait.stderr
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
error: `add` must not have any generic parameters
|
||||
--> $DIR/invalid_operator_trait.rs:15:5
|
||||
|
|
||||
LL | fn add<Y>(self, _: RHS) -> Self::Output;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
@ -39,6 +39,8 @@ macro_rules! t {
|
|||
}
|
||||
|
||||
static TEST: AtomicUsize = AtomicUsize::new(0);
|
||||
const RETRY_INTERVAL: u64 = 1;
|
||||
const NUMBER_OF_RETRIES: usize = 5;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
struct Config {
|
||||
|
|
@ -115,7 +117,7 @@ fn main() {
|
|||
let config = Config::parse_args();
|
||||
println!("starting test server");
|
||||
|
||||
let listener = t!(TcpListener::bind(config.bind));
|
||||
let listener = bind_socket(config.bind);
|
||||
let (work, tmp): (PathBuf, PathBuf) = if cfg!(target_os = "android") {
|
||||
("/data/local/tmp/work".into(), "/data/local/tmp/work/tmp".into())
|
||||
} else {
|
||||
|
|
@ -159,6 +161,16 @@ fn main() {
|
|||
}
|
||||
}
|
||||
|
||||
fn bind_socket(addr: SocketAddr) -> TcpListener {
|
||||
for _ in 0..(NUMBER_OF_RETRIES - 1) {
|
||||
if let Ok(x) = TcpListener::bind(addr) {
|
||||
return x;
|
||||
}
|
||||
std::thread::sleep(std::time::Duration::from_secs(RETRY_INTERVAL));
|
||||
}
|
||||
TcpListener::bind(addr).unwrap()
|
||||
}
|
||||
|
||||
fn handle_push(socket: TcpStream, work: &Path, config: Config) {
|
||||
let mut reader = BufReader::new(socket);
|
||||
let dst = recv(&work, &mut reader);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue