forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#73692 - Dylan-DPC:rollup-ehzsbfw, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - rust-lang#73638 (Remove unused crate imports in 2018 edition crates) - rust-lang#73639 (Change heuristic for determining range literal) - rust-lang#73646 (Add some regression tests) - rust-lang#73652 (Add re-exports to use suggestions) - rust-lang#73667 (Update BTreeMap::new() doc) - rust-lang#73675 (Update books) Failed merges: r? @ghost
- Loading branch information
Showing
38 changed files
with
248 additions
and
51 deletions.
There are no files selected for viewing
Submodule book
updated
4 files
+1 −1 | src/ch06-02-match.md | |
+5 −3 | src/ch10-03-lifetime-syntax.md | |
+22 −20 | src/ch14-03-cargo-workspaces.md | |
+10 −10 | src/ch19-03-advanced-traits.md |
Submodule embedded-book
updated
9 files
+ − | src/assets/crates.png | |
+15 −15 | src/concurrency/index.md | |
+13 −12 | src/peripherals/singletons.md | |
+2 −2 | src/start/exceptions.md | |
+7 −4 | src/start/hardware.md | |
+10 −3 | src/start/panicking.md | |
+4 −4 | src/start/qemu.md | |
+20 −7 | src/start/registers.md | |
+3 −3 | src/start/semihosting.md |
Submodule reference
updated
5 files
+5 −0 | src/conditional-compilation.md | |
+1 −1 | src/expressions/loop-expr.md | |
+8 −11 | src/items/extern-crates.md | |
+9 −6 | src/items/type-aliases.md | |
+3 −1 | src/whitespace.md |
Submodule rust-by-example
updated
4 files
+1 −1 | .travis.yml | |
+1 −1 | src/fn.md | |
+1 −1 | src/hello/print.md | |
+3 −3 | src/trait/supertraits.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// check-pass | ||
|
||
#![feature(impl_trait_in_bindings)] | ||
#![allow(incomplete_features)] | ||
|
||
struct A<'a>(&'a ()); | ||
|
||
trait Trait<T> {} | ||
|
||
impl<T> Trait<T> for () {} | ||
|
||
pub fn foo<'a>() { | ||
let _x: impl Trait<A<'a>> = (); | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#![feature(never_type, specialization)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::iter::{self, Empty}; | ||
|
||
trait Trait { | ||
type Out: Iterator<Item = u32>; | ||
|
||
fn f(&self) -> Option<Self::Out>; | ||
} | ||
|
||
impl<T> Trait for T { | ||
default type Out = !; //~ ERROR: `!` is not an iterator | ||
|
||
default fn f(&self) -> Option<Self::Out> { | ||
None | ||
} | ||
} | ||
|
||
struct X; | ||
|
||
impl Trait for X { | ||
type Out = Empty<u32>; | ||
|
||
fn f(&self) -> Option<Self::Out> { | ||
Some(iter::empty()) | ||
} | ||
} | ||
|
||
fn f<T: Trait>(a: T) { | ||
if let Some(iter) = a.f() { | ||
println!("Some"); | ||
for x in iter { | ||
println!("x = {}", x); | ||
} | ||
} | ||
} | ||
|
||
pub fn main() { | ||
f(10); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0277]: `!` is not an iterator | ||
--> $DIR/issue-51506.rs:13:5 | ||
| | ||
LL | type Out: Iterator<Item = u32>; | ||
| ------------------------------- required by `Trait::Out` | ||
... | ||
LL | default type Out = !; | ||
| ^^^^^^^^^^^^^^^^^^^^^ `!` is not an iterator | ||
| | ||
= help: the trait `std::iter::Iterator` is not implemented for `!` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
type Range = std::ops::Range<usize>; | ||
|
||
fn demo(r: &Range) { | ||
println!("{:?}", r); | ||
} | ||
|
||
fn tell(x: usize) -> usize { | ||
x | ||
} | ||
|
||
fn main() { | ||
demo(tell(1)..tell(10)); | ||
//~^ ERROR mismatched types | ||
demo(1..10); | ||
//~^ ERROR mismatched types | ||
} |
27 changes: 27 additions & 0 deletions
27
src/test/ui/range/issue-73553-misinterp-range-literal.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-73553-misinterp-range-literal.rs:12:10 | ||
| | ||
LL | demo(tell(1)..tell(10)); | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | | ||
| expected reference, found struct `std::ops::Range` | ||
| help: consider borrowing here: `&(tell(1)..tell(10))` | ||
| | ||
= note: expected reference `&std::ops::Range<usize>` | ||
found struct `std::ops::Range<usize>` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-73553-misinterp-range-literal.rs:14:10 | ||
| | ||
LL | demo(1..10); | ||
| ^^^^^ | ||
| | | ||
| expected reference, found struct `std::ops::Range` | ||
| help: consider borrowing here: `&(1..10)` | ||
| | ||
= note: expected reference `&std::ops::Range<usize>` | ||
found struct `std::ops::Range<{integer}>` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.