Auto merge of #55347 - pietroalbini:rollup, r=pietroalbini
Rollup of 22 pull requests Successful merges: - #53507 (Add doc for impl From for Waker) - #53931 (Gradually expanding libstd's keyword documentation) - #54965 (update tcp stream documentation) - #54977 (Accept `Option<Box<$t:ty>>` in macro argument) - #55138 (in which unused-parens suggestions heed what the user actually wrote) - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type) - #55200 (Documents `From` implementations for `Stdio`) - #55245 (submodules: update clippy from5afdf8b7tob1d03437) - #55247 (Clarified code example in char primitive doc) - #55251 (Fix a typo in the documentation of RangeInclusive) - #55253 (only issue "variant of the expected type" suggestion for enums) - #55254 (Correct trailing ellipsis in name_from_pat) - #55269 (fix typos in various places) - #55282 (Remove redundant clone) - #55285 (Do some copy editing on the release notes) - #55291 (Update stdsimd submodule) - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs) - #55306 (Regression test for #54478.) - #55328 (Fix doc for new copysign functions) - #55340 (Operands no longer appear in places) - #55345 (Remove is_null) - #55348 (Update RELEASES.md after destabilization of non_modrs_mods) Failed merges: r? @ghost
This commit is contained in:
commit
8ec22e7ec7
87 changed files with 1167 additions and 290 deletions
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// run-pass
|
||||
// Test for issue #18804, #[linkage] does not propagate thorugh generic
|
||||
// Test for issue #18804, #[linkage] does not propagate through generic
|
||||
// functions. Failure results in a linker error.
|
||||
|
||||
// ignore-asmjs no weak symbol support
|
||||
|
|
|
|||
16
src/test/run-pass/macros/issue-25274.rs
Normal file
16
src/test/run-pass/macros/issue-25274.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
macro_rules! test {
|
||||
(
|
||||
fn fun() -> Option<Box<$t:ty>>;
|
||||
) => {
|
||||
fn fun(x: $t) -> Option<Box<$t>>
|
||||
{ Some(Box::new(x)) }
|
||||
}
|
||||
}
|
||||
|
||||
test! {
|
||||
fn fun() -> Option<Box<i32>>;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("{}", fun(0).unwrap());
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
// compile-flags:--test
|
||||
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
|
||||
// failure-status: 101
|
||||
// rustc-env:RUST_BACKTRACE=0
|
||||
|
||||
// doctest fails at runtime
|
||||
/// ```
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
|
||||
running 2 tests
|
||||
test $DIR/failed-doctest-output.rs - OtherStruct (line 26) ... FAILED
|
||||
test $DIR/failed-doctest-output.rs - SomeStruct (line 20) ... FAILED
|
||||
test $DIR/failed-doctest-output.rs - OtherStruct (line 27) ... FAILED
|
||||
test $DIR/failed-doctest-output.rs - SomeStruct (line 21) ... FAILED
|
||||
|
||||
failures:
|
||||
|
||||
---- $DIR/failed-doctest-output.rs - OtherStruct (line 26) stdout ----
|
||||
---- $DIR/failed-doctest-output.rs - OtherStruct (line 27) stdout ----
|
||||
error[E0425]: cannot find value `no` in this scope
|
||||
--> $DIR/failed-doctest-output.rs:27:1
|
||||
--> $DIR/failed-doctest-output.rs:28:1
|
||||
|
|
||||
3 | no
|
||||
| ^^ not found in this scope
|
||||
|
||||
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 26)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
|
||||
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test', librustdoc/test.rs:332:13
|
||||
note: Run with `RUST_BACKTRACE=1` for a backtrace.
|
||||
|
||||
---- $DIR/failed-doctest-output.rs - SomeStruct (line 20) stdout ----
|
||||
thread '$DIR/failed-doctest-output.rs - SomeStruct (line 20)' panicked at 'test executable failed:
|
||||
---- $DIR/failed-doctest-output.rs - SomeStruct (line 21) stdout ----
|
||||
thread '$DIR/failed-doctest-output.rs - SomeStruct (line 21)' panicked at 'test executable failed:
|
||||
|
||||
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
|
||||
note: Run with `RUST_BACKTRACE=1` for a backtrace.
|
||||
|
|
@ -25,8 +25,8 @@ note: Run with `RUST_BACKTRACE=1` for a backtrace.
|
|||
|
||||
|
||||
failures:
|
||||
$DIR/failed-doctest-output.rs - OtherStruct (line 26)
|
||||
$DIR/failed-doctest-output.rs - SomeStruct (line 20)
|
||||
$DIR/failed-doctest-output.rs - OtherStruct (line 27)
|
||||
$DIR/failed-doctest-output.rs - SomeStruct (line 21)
|
||||
|
||||
test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out
|
||||
|
||||
|
|
|
|||
42
src/test/rustdoc/issue-54478-demo-allocator.rs
Normal file
42
src/test/rustdoc/issue-54478-demo-allocator.rs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
// Issue #54478: regression test showing that we can demonstrate
|
||||
// `#[global_allocator]` in code blocks built by `rustdoc`.
|
||||
//
|
||||
// ## Background
|
||||
//
|
||||
// Changes in lang-item visibility injected failures that were only
|
||||
// exposed when compiling with `-C prefer-dynamic`. But `rustdoc` used
|
||||
// `-C prefer-dynamic` (and had done so for years, for reasons we did
|
||||
// not document at that time).
|
||||
//
|
||||
// Rather than try to revise the visbility semanics, we instead
|
||||
// decided to change `rustdoc` to behave more like the compiler's
|
||||
// default setting, by leaving off `-C prefer-dynamic`.
|
||||
|
||||
// compile-flags:--test
|
||||
|
||||
//! This is a doc comment
|
||||
//!
|
||||
//! ```rust
|
||||
//! use std::alloc::*;
|
||||
//!
|
||||
//! #[global_allocator]
|
||||
//! static ALLOC: A = A;
|
||||
//!
|
||||
//! static mut HIT: bool = false;
|
||||
//!
|
||||
//! struct A;
|
||||
//!
|
||||
//! unsafe impl GlobalAlloc for A {
|
||||
//! unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
//! HIT = true;
|
||||
//! System.alloc(layout)
|
||||
//! }
|
||||
//! unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout) {
|
||||
//! System.dealloc(ptr, layout);
|
||||
//! }
|
||||
//! }
|
||||
//!
|
||||
//! fn main() {
|
||||
//! assert!(unsafe { HIT });
|
||||
//! }
|
||||
//! ```
|
||||
|
|
@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/bound-lifetime-in-binding-only.rs:62:23
|
||||
|
|
||||
LL | fn elision<T: Fn() -> &i32>() {
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it a 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/bound-lifetime-in-return-only.rs:44:23
|
||||
|
|
||||
LL | fn elision(_: fn() -> &i32) {
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it a 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that we do some basic error correcton in the tokeniser (and don't spew
|
||||
// Test that we do some basic error correction in the tokeniser (and don't spew
|
||||
// too many bogus errors).
|
||||
|
||||
fn foo() -> usize {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// Test that cfg_attr doesn't emit any attributes when the
|
||||
// configuation variable is false. This mirrors `cfg-attr-multi-true.rs`
|
||||
// configuration variable is false. This mirrors `cfg-attr-multi-true.rs`
|
||||
|
||||
// compile-pass
|
||||
|
||||
|
|
|
|||
|
|
@ -20,4 +20,20 @@ fn main() {
|
|||
let n: usize = 42;
|
||||
this_function_expects_a_double_option(n);
|
||||
//~^ ERROR mismatched types
|
||||
//~| HELP try using a variant of the expected type
|
||||
}
|
||||
|
||||
|
||||
// But don't issue the "try using a variant" help if the one-"variant" ADT is
|
||||
// actually a one-field struct.
|
||||
|
||||
struct Payload;
|
||||
|
||||
struct Wrapper { payload: Payload }
|
||||
|
||||
struct Context { wrapper: Wrapper }
|
||||
|
||||
fn overton() {
|
||||
let _c = Context { wrapper: Payload{} };
|
||||
//~^ ERROR mismatched types
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,15 @@ LL | this_function_expects_a_double_option(DoubleOption::FirstSome(n));
|
|||
LL | this_function_expects_a_double_option(DoubleOption::AlternativeSome(n));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-42764.rs:37:33
|
||||
|
|
||||
LL | let _c = Context { wrapper: Payload{} };
|
||||
| ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload`
|
||||
|
|
||||
= note: expected type `Wrapper`
|
||||
found type `Payload`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
||||
|
|
|
|||
18
src/test/ui/foreign-fn-return-lifetime.fixed
Normal file
18
src/test/ui/foreign-fn-return-lifetime.fixed
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2017 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.
|
||||
|
||||
// run-rustfix
|
||||
|
||||
extern "C" {
|
||||
pub fn g(_: &u8) -> &u8; // OK
|
||||
pub fn f() -> &'static u8; //~ ERROR missing lifetime specifier
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -8,9 +8,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// run-rustfix
|
||||
|
||||
extern "C" {
|
||||
fn g(_: &u8) -> &u8; // OK
|
||||
fn f() -> &u8; //~ ERROR missing lifetime specifier
|
||||
pub fn g(_: &u8) -> &u8; // OK
|
||||
pub fn f() -> &u8; //~ ERROR missing lifetime specifier
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/foreign-fn-return-lifetime.rs:13:15
|
||||
--> $DIR/foreign-fn-return-lifetime.rs:15:19
|
||||
|
|
||||
LL | fn f() -> &u8; //~ ERROR missing lifetime specifier
|
||||
| ^ expected lifetime parameter
|
||||
LL | pub fn f() -> &u8; //~ ERROR missing lifetime specifier
|
||||
| ^ help: consider giving it a 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/issue-13497.rs:12:5
|
||||
|
|
||||
LL | &str //~ ERROR missing lifetime specifier
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it a 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -10,19 +10,17 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/issue-26638.rs:14:40
|
||||
|
|
||||
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &str { iter() }
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
|
||||
= help: consider giving it an explicit bounded or 'static lifetime
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/issue-26638.rs:17:22
|
||||
|
|
||||
LL | fn parse_type_3() -> &str { unimplemented!() }
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it a 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:12:11
|
||||
|
|
||||
LL | fn f() -> &isize { //~ ERROR missing lifetime specifier
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it a 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:33
|
||||
|
|
@ -27,28 +26,25 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:31:20
|
||||
|
|
||||
LL | fn i(_x: isize) -> &isize { //~ ERROR missing lifetime specifier
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
|
||||
= help: consider giving it an explicit bounded or 'static lifetime
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:44:24
|
||||
|
|
||||
LL | fn j(_x: StaticStr) -> &isize { //~ ERROR missing lifetime specifier
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
|
||||
= help: consider giving it an explicit bounded or 'static lifetime
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:50:49
|
||||
|
|
||||
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
|
||||
| ^ expected lifetime parameter
|
||||
| ^ help: consider giving it an explicit bounded or 'static lifetime: `&'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
|
||||
= help: consider giving it an explicit bounded or 'static lifetime
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
12
src/test/ui/lifetimes/lifetime-elision-return-type-trait.rs
Normal file
12
src/test/ui/lifetimes/lifetime-elision-return-type-trait.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
trait Future {
|
||||
type Item;
|
||||
type Error;
|
||||
}
|
||||
|
||||
use std::error::Error;
|
||||
|
||||
fn foo() -> impl Future<Item=(), Error=Box<Error>> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/lifetime-elision-return-type-trait.rs:8:44
|
||||
|
|
||||
LL | fn foo() -> impl Future<Item=(), Error=Box<Error>> {
|
||||
| ^^^^^ help: consider giving it a 'static lifetime: `Error + 'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0106`.
|
||||
|
|
@ -56,7 +56,7 @@ fn main() {
|
|||
while true {
|
||||
//~^ WARN denote infinite loops
|
||||
//~| HELP use `loop`
|
||||
let mut a = (1);
|
||||
let mut registry_no = (format!("NX-{}", 74205));
|
||||
//~^ WARN does not need to be mutable
|
||||
//~| HELP remove this `mut`
|
||||
//~| WARN unnecessary parentheses
|
||||
|
|
@ -72,6 +72,6 @@ fn main() {
|
|||
//~^ WARN this pattern is redundant
|
||||
//~| HELP remove this
|
||||
}
|
||||
println!("{} {}", a, b);
|
||||
println!("{} {}", registry_no, b);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
warning: unnecessary parentheses around assigned value
|
||||
--> $DIR/suggestions.rs:59:21
|
||||
--> $DIR/suggestions.rs:59:31
|
||||
|
|
||||
LL | let mut a = (1);
|
||||
| ^^^ help: remove these parentheses
|
||||
LL | let mut registry_no = (format!("NX-{}", 74205));
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove these parentheses
|
||||
|
|
||||
note: lint level defined here
|
||||
--> $DIR/suggestions.rs:13:21
|
||||
|
|
@ -21,8 +21,8 @@ LL | #[no_debug] // should suggest removal of deprecated attribute
|
|||
warning: variable does not need to be mutable
|
||||
--> $DIR/suggestions.rs:59:13
|
||||
|
|
||||
LL | let mut a = (1);
|
||||
| ----^
|
||||
LL | let mut registry_no = (format!("NX-{}", 74205));
|
||||
| ----^^^^^^^^^^^
|
||||
| |
|
||||
| help: remove this `mut`
|
||||
|
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ impl<F> R<F> { fn new(f: F) -> Self { R { w: 0, f } } }
|
|||
// It got pretty monotonous writing the same code over and over, and I
|
||||
// feared I would forget details. So I abstracted some desiderata into
|
||||
// macros. But I left the initialization code inline, because that's
|
||||
// where the errors for #54986 will be emited.
|
||||
// where the errors for #54986 will be emitted.
|
||||
|
||||
macro_rules! use_fully {
|
||||
(struct $s:expr) => { {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
// rust-lang/rust#52059: Regardless of whether you are moving out of a
|
||||
// Drop type or just introducing an inadvertant alias via a borrow of
|
||||
// Drop type or just introducing an inadvertent alias via a borrow of
|
||||
// one of its fields, it is useful to be reminded of the significance
|
||||
// of the fact that the type implements Drop.
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that we do some basic error correcton in the tokeniser (and don't ICE).
|
||||
// Test that we do some basic error correction in the tokeniser (and don't ICE).
|
||||
|
||||
fn main() {
|
||||
if foo {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// ignore-cloudabi no std::fs support
|
||||
|
||||
// Test that we do some basic error correcton in the tokeniser (and don't spew
|
||||
// Test that we do some basic error correction in the tokeniser (and don't spew
|
||||
// too many bogus errors).
|
||||
|
||||
pub mod raw {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// Test that we do some basic error correcton in the tokeniser.
|
||||
// Test that we do some basic error correction in the tokeniser.
|
||||
|
||||
fn main() {
|
||||
foo(bar(;
|
||||
|
|
|
|||
|
|
@ -19,22 +19,22 @@ fn main() {
|
|||
use std::ops::Range;
|
||||
|
||||
if let Range { start: _, end: _ } = true..true && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
if let Range { start: _, end: _ } = true..true || false { }
|
||||
//~^ ERROR ambigious use of `||`
|
||||
//~^ ERROR ambiguous use of `||`
|
||||
|
||||
while let Range { start: _, end: _ } = true..true && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
while let Range { start: _, end: _ } = true..true || false { }
|
||||
//~^ ERROR ambigious use of `||`
|
||||
//~^ ERROR ambiguous use of `||`
|
||||
|
||||
if let true = false && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
while let true = (1 == 2) && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
// The following cases are not an error as parenthesis are used to
|
||||
// clarify intent:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2015.rs:21:47
|
||||
|
|
||||
LL | if let Range { start: _, end: _ } = true..true && false { }
|
||||
|
|
@ -7,7 +7,7 @@ LL | if let Range { start: _, end: _ } = true..true && false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `||`
|
||||
error: ambiguous use of `||`
|
||||
--> $DIR/syntax-ambiguity-2015.rs:24:47
|
||||
|
|
||||
LL | if let Range { start: _, end: _ } = true..true || false { }
|
||||
|
|
@ -16,7 +16,7 @@ LL | if let Range { start: _, end: _ } = true..true || false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2015.rs:27:50
|
||||
|
|
||||
LL | while let Range { start: _, end: _ } = true..true && false { }
|
||||
|
|
@ -25,7 +25,7 @@ LL | while let Range { start: _, end: _ } = true..true && false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `||`
|
||||
error: ambiguous use of `||`
|
||||
--> $DIR/syntax-ambiguity-2015.rs:30:50
|
||||
|
|
||||
LL | while let Range { start: _, end: _ } = true..true || false { }
|
||||
|
|
@ -34,7 +34,7 @@ LL | while let Range { start: _, end: _ } = true..true || false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2015.rs:33:19
|
||||
|
|
||||
LL | if let true = false && false { }
|
||||
|
|
@ -43,7 +43,7 @@ LL | if let true = false && false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2015.rs:36:22
|
||||
|
|
||||
LL | while let true = (1 == 2) && false { }
|
||||
|
|
|
|||
|
|
@ -19,22 +19,22 @@ fn main() {
|
|||
use std::ops::Range;
|
||||
|
||||
if let Range { start: _, end: _ } = true..true && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
if let Range { start: _, end: _ } = true..true || false { }
|
||||
//~^ ERROR ambigious use of `||`
|
||||
//~^ ERROR ambiguous use of `||`
|
||||
|
||||
while let Range { start: _, end: _ } = true..true && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
while let Range { start: _, end: _ } = true..true || false { }
|
||||
//~^ ERROR ambigious use of `||`
|
||||
//~^ ERROR ambiguous use of `||`
|
||||
|
||||
if let true = false && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
while let true = (1 == 2) && false { }
|
||||
//~^ ERROR ambigious use of `&&`
|
||||
//~^ ERROR ambiguous use of `&&`
|
||||
|
||||
// The following cases are not an error as parenthesis are used to
|
||||
// clarify intent:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2018.rs:21:47
|
||||
|
|
||||
LL | if let Range { start: _, end: _ } = true..true && false { }
|
||||
|
|
@ -7,7 +7,7 @@ LL | if let Range { start: _, end: _ } = true..true && false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `||`
|
||||
error: ambiguous use of `||`
|
||||
--> $DIR/syntax-ambiguity-2018.rs:24:47
|
||||
|
|
||||
LL | if let Range { start: _, end: _ } = true..true || false { }
|
||||
|
|
@ -16,7 +16,7 @@ LL | if let Range { start: _, end: _ } = true..true || false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2018.rs:27:50
|
||||
|
|
||||
LL | while let Range { start: _, end: _ } = true..true && false { }
|
||||
|
|
@ -25,7 +25,7 @@ LL | while let Range { start: _, end: _ } = true..true && false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `||`
|
||||
error: ambiguous use of `||`
|
||||
--> $DIR/syntax-ambiguity-2018.rs:30:50
|
||||
|
|
||||
LL | while let Range { start: _, end: _ } = true..true || false { }
|
||||
|
|
@ -34,7 +34,7 @@ LL | while let Range { start: _, end: _ } = true..true || false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2018.rs:33:19
|
||||
|
|
||||
LL | if let true = false && false { }
|
||||
|
|
@ -43,7 +43,7 @@ LL | if let true = false && false { }
|
|||
= note: this will be a error until the `let_chains` feature is stabilized
|
||||
= note: see rust-lang/rust#53668 for more information
|
||||
|
||||
error: ambigious use of `&&`
|
||||
error: ambiguous use of `&&`
|
||||
--> $DIR/syntax-ambiguity-2018.rs:36:22
|
||||
|
|
||||
LL | while let true = (1 == 2) && false { }
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use std::fmt::{Debug, Display};
|
|||
// • one generic parameter (T) bound inline
|
||||
// • one parameter (T) with a where clause
|
||||
// • two parameters (T and U), both bound inline
|
||||
// • two paramters (T and U), one bound inline, one with a where clause
|
||||
// • two parameters (T and U), one bound inline, one with a where clause
|
||||
// • two parameters (T and U), both with where clauses
|
||||
//
|
||||
// —and for every permutation of 0, 1, or 2 lifetimes to outlive and 0 or 1
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ use std::fmt::{Debug, Display};
|
|||
// • one generic parameter (T) bound inline
|
||||
// • one parameter (T) with a where clause
|
||||
// • two parameters (T and U), both bound inline
|
||||
// • two paramters (T and U), one bound inline, one with a where clause
|
||||
// • two parameters (T and U), one bound inline, one with a where clause
|
||||
// • two parameters (T and U), both with where clauses
|
||||
//
|
||||
// —and for every permutation of 0, 1, or 2 lifetimes to outlive and 0 or 1
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// Regression test for #52050: when inserting the blanket impl `I`
|
||||
// into the tree, we had to replace the child node for `Foo`, which
|
||||
// led to the struture of the tree being messed up.
|
||||
// led to the structure of the tree being messed up.
|
||||
|
||||
use std::iter::Iterator;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,9 @@ error[E0106]: missing lifetime specifier
|
|||
--> $DIR/underscore-lifetime-binders.rs:20:29
|
||||
|
|
||||
LL | fn meh() -> Box<for<'_> Meh<'_>> //~ ERROR cannot be used here
|
||||
| ^^ expected lifetime parameter
|
||||
| ^^ help: consider giving it a 'static lifetime: `'static`
|
||||
|
|
||||
= help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
|
||||
= help: consider giving it a 'static lifetime
|
||||
|
||||
error[E0106]: missing lifetime specifier
|
||||
--> $DIR/underscore-lifetime-binders.rs:26:35
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue