Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove meaningless comments in src/test #63411

Closed
wants to merge 190 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
0a227f3
stabilize duration_float
newpavlov Jul 17, 2019
ad36324
unconstify methods
newpavlov Jul 17, 2019
55ee8fe
mark div_duration methods as unstable, update tracking issue
newpavlov Jul 30, 2019
4281e61
fix tests
newpavlov Jul 30, 2019
8ae8bc2
Fix various issues with making items reachable through macros
matthewjasper Aug 5, 2019
7b41fd2
Make some items in core::unicode private
matthewjasper Aug 5, 2019
d9d9246
Remove gensym from format_args
matthewjasper Aug 5, 2019
ffa4d7e
Sort the fat LTO modules to produce deterministic output.
jgalenson Aug 7, 2019
5b2c5e1
Sort fat LTO modules later and add a test.
jgalenson Aug 8, 2019
a46e36f
Fix fat LTO determinism test so it fails without the fix.
jgalenson Aug 8, 2019
3e6a927
Explain why we're sorting the modules.
jgalenson Aug 8, 2019
3a6a29b
Use associated_type_bounds where applicable - closes #61738
iluuu1994 Jul 31, 2019
322a7d6
Add test for issue 36804
jackh726 Aug 8, 2019
642ee70
Add test for issue-43623
JohnTitor Aug 8, 2019
55f15d7
Add test for issue-44405
JohnTitor Aug 8, 2019
36c4873
Try to fix test on Windows.
jgalenson Aug 8, 2019
fd7ac6b
Deprecate `try!` macro
Jun 23, 2019
90fa790
Postpone deprecating try! until 1.39.0
tesuji Jul 15, 2019
6842316
Allow deprecated try macro in test crates
tesuji Jul 14, 2019
e9ee2cb
Improve test output for libcore/time
ohsayan Aug 9, 2019
623debf
Improve tests for libcore/slice
ohsayan Aug 9, 2019
33445ae
Improve tests for liballoc/btree/set
ohsayan Aug 9, 2019
fb3a013
Merge pull request #1 from rust-lang/master
ohsayan Aug 9, 2019
c5687e3
enable flt2dec tests in Miri
RalfJung Aug 9, 2019
c7e16c5
Check links on all platforms when running locally
mati865 Aug 6, 2019
29ca428
Miri is really slow
RalfJung Aug 9, 2019
3d231ac
Add missing #![feature(associated_type_bounds)]
iluuu1994 Aug 8, 2019
73edef7
reduce some test sizes in Miri
RalfJung Aug 9, 2019
77bfd7f
Don't use associated type bounds in docs until it is stable
iluuu1994 Aug 9, 2019
78caca0
explain Miri disabling
RalfJung Aug 9, 2019
03c524e
Rollup merge of #62672 - lzutao:deprecated-try-macro, r=Centril
Centril Aug 9, 2019
a038726
Rollup merge of #62950 - mati865:linkcheck, r=alexcrichton
Centril Aug 9, 2019
714c8ea
Rollup merge of #63114 - matthewjasper:hygienic-format-args, r=petroc…
Centril Aug 9, 2019
7a25162
Rollup merge of #63397 - JohnTitor:add-tests-for-ices, r=Centril
Centril Aug 9, 2019
171e845
Rollup merge of #63403 - sntdevco:master, r=Centril
Centril Aug 9, 2019
14ec32e
Rollup merge of #63404 - RalfJung:flt2dec, r=Centril
Centril Aug 9, 2019
4e3c209
Rollup merge of #63407 - RalfJung:miri-test-sizes, r=Centril
Centril Aug 9, 2019
534b423
Auto merge of #63408 - Centril:rollup-skqrez3, r=Centril
bors Aug 9, 2019
b81e887
Remove meaningless comments in src/test
sd234678 Aug 9, 2019
c076392
Tweak mismatched types error on break expressions
estebank Aug 6, 2019
799b13a
Do not suggest using ! with break
estebank Aug 7, 2019
4fbbf99
Be more accurate when mentioning type of found match arms
estebank Aug 7, 2019
01a6139
Change wording for function without return value
estebank Aug 7, 2019
94fe8a3
Suggest calling function on type error when finding bare fn
estebank Aug 7, 2019
195d837
When suggesting fn call use an appropriate number of placeholder argu…
estebank Aug 8, 2019
b7f7756
Recover parser from `foo(_, _)`
estebank Aug 8, 2019
0d53f69
review comments
estebank Aug 8, 2019
efa62d6
Tweak wording of fn without explicit return
estebank Aug 8, 2019
52da091
Differentiate between tuple structs and tuple variants
estebank Aug 8, 2019
5a54945
Extend suggestion support for traits and foreign items
estebank Aug 8, 2019
33d1082
review comment: review wording or missing return error
estebank Aug 8, 2019
bc1a4f5
review comments: typo and rewording
estebank Aug 8, 2019
740f8db
Add FIXME-s that some types should be transparent
MikailBag Jun 19, 2019
45a5bc7
fix tests
estebank Aug 9, 2019
7c96d90
More explicit diagnostic when using a `vec![]` in a pattern
estebank Aug 9, 2019
3af92cb
update Miri
RalfJung Aug 9, 2019
b6767b3
Stop test from running on Windows.
jgalenson Aug 9, 2019
75c5ad2
review comments: use structured suggestion
estebank Aug 9, 2019
d8ae1dc
Update LLVM submodule
nikic Aug 9, 2019
214028d
Update stderr files with --bless
sd234678 Aug 9, 2019
a9f0452
Update stderr files with --bless
sd234678 Aug 9, 2019
dcb21b6
Rebase onto master
sd234678 Aug 9, 2019
1d0def5
Merge branch 'remove-meaningless-comments-in-src/test' of github.com:…
sd234678 Aug 9, 2019
4dd96d2
check against more collisions for TypeId of fn pointer
RalfJung Aug 9, 2019
b9865d9
Mention that tuple structs are private if their fields are
estebank Aug 9, 2019
cbcc7dd
Give built-in macros stable addresses in the standard library
petrochenkov Jul 27, 2019
0ff76ad
Auto merge of #63415 - nikic:bump-llvm-2, r=alexcrichton
bors Aug 9, 2019
1ee37cd
Cleanup historical stability comments
Mark-Simulacrum Aug 9, 2019
be8bbb0
Auto merge of #62756 - newpavlov:stabilize_dur_float, r=alexcrichton
bors Aug 10, 2019
eb44561
Rollup merge of #63056 - petrochenkov:macstd2, r=alexcrichton
Centril Aug 10, 2019
52f9e80
Rollup merge of #63337 - estebank:break-ee0308, r=Centril
Centril Aug 10, 2019
6743ad6
Rollup merge of #63350 - iluuu1994:use-associated-type-bounds, r=Centril
Centril Aug 10, 2019
5ed195b
Rollup merge of #63394 - jackh726:issue-36804, r=jonas-schievink
Centril Aug 10, 2019
9e613c7
Rollup merge of #63399 - estebank:vec-in-pat, r=Centril
Centril Aug 10, 2019
a029ce8
Rollup merge of #63419 - RalfJung:typeid, r=alexcrichton
Centril Aug 10, 2019
019f6fe
Rollup merge of #63423 - estebank:priv-tuple, r=zackmdavis
Centril Aug 10, 2019
d19a359
Auto merge of #63428 - Centril:rollup-c2ru1z1, r=Centril
bors Aug 10, 2019
352c6d0
.gitignore: Readd `/tmp/`
Centril Aug 10, 2019
87a8c57
Explain why `/tmp/` is ignored
Centril Aug 10, 2019
83b837a
.gitignore: Explain why `/obj/` is ignored
Centril Aug 10, 2019
6f70adc
Auto merge of #63352 - jgalenson:reproducible-lto, r=alexcrichton
bors Aug 10, 2019
e2e8746
resolve: Move late resolution into a separate visitor
petrochenkov Aug 5, 2019
ff85d1c
resolve: Move late resolution visitor into a separate file
petrochenkov Aug 7, 2019
df03e42
resolve: Track whole parent scope in the visitors
petrochenkov Aug 8, 2019
6a347f3
resolve: Remove `Deref<Target=Resolver>` implementations
petrochenkov Aug 8, 2019
9c86ce7
resolve: Turn `resolve_error` into a method on `Resolver`
petrochenkov Aug 8, 2019
f360d79
resolve: Move some more code around
petrochenkov Aug 8, 2019
8cc8133
Fix calls to resolver from rustdoc and HIR lowering
petrochenkov Aug 8, 2019
8758d7f
Cleanup & Simplify stuff in lowering.
Centril Aug 10, 2019
319f0de
resolve: Address FIXME from the previous commit
petrochenkov Aug 9, 2019
3710002
Make fields of RustdocVisitor private
Mark-Simulacrum Jul 24, 2019
03e95ae
Miri shouldn't look at types
RalfJung Aug 10, 2019
2d18504
Remove Option from resolver
Mark-Simulacrum Jul 24, 2019
2fadc45
Represent ownership transfer in RustdocVisitor::visit
Mark-Simulacrum Jul 24, 2019
6c5d212
Make exact_paths a non-optional field on RustdocVisitor
Mark-Simulacrum Jul 24, 2019
11735b6
Gather stability information during cleaning
Mark-Simulacrum Jul 24, 2019
4beb751
Gather deprecation information during cleaning
Mark-Simulacrum Jul 24, 2019
c36e0c0
Remove NodeId from doctree::Module
Mark-Simulacrum Jul 24, 2019
78d9088
Replace is_doc_reachable with is_public
Mark-Simulacrum Jul 24, 2019
32f144a
Implement Clean<Crate> on hir::Crate directly
Mark-Simulacrum Aug 10, 2019
62f1e8a
fix test
RalfJung Aug 10, 2019
2358e3e
Revert "Rollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJung"
ishitatsuyuki Aug 7, 2019
9d76a93
Rollup merge of #63400 - petrochenkov:resplit, r=eddyb
Centril Aug 10, 2019
ad8b0a0
Rollup merge of #63425 - Mark-Simulacrum:clean-stability-doc, r=eddyb
Centril Aug 10, 2019
219336a
Rollup merge of #63429 - rust-lang:gitignore-readd-tmp, r=Mark-Simula…
Centril Aug 10, 2019
808f983
Rollup merge of #63432 - Centril:simplify-lowering, r=eddyb
Centril Aug 10, 2019
be3fb0c
Auto merge of #63437 - Centril:rollup-ryx881p, r=Centril
bors Aug 10, 2019
440a5c8
rename RUST_CTFE_BACKTRACE to RUSTC_CTFE_BACKTRACE
RalfJung Aug 10, 2019
d809d6e
Derive Debug for CrateInfo
bjorn3 Aug 10, 2019
93839c3
Add an example to show how to insert item to a sorted vec
tesuji Aug 10, 2019
30ba4bd
Use Result::unwrap_or_else instead of matching
tesuji Aug 10, 2019
9703ef6
Auto merge of #62955 - Mark-Simulacrum:rustdoc-clean-1, r=eddyb
bors Aug 10, 2019
cf20d8c
lowering: move lower_expr -> expr.rs
Centril Aug 10, 2019
c817596
lowering: extract lower_expr_try
Centril Aug 10, 2019
9d739ca
lowering: extract lower_expr_for
Centril Aug 10, 2019
45d507d
lowering: extract lower_expr_yield
Centril Aug 10, 2019
1194992
lowering: extract lower_expr_asm
Centril Aug 10, 2019
c789e7a
lowering: extract lower_expr_range
Centril Aug 10, 2019
309bf2f
lowering: extract lower_expr_range_closed
Centril Aug 10, 2019
ca19e32
lowering: extract lower_expr_async_closure
Centril Aug 10, 2019
548e309
lowering: extract lower_expr_closure
Centril Aug 10, 2019
e450dca
lowering: move lower_await -> expr.rs
Centril Aug 10, 2019
8ddd173
lowering: extract lower_expr_try_block
Centril Aug 10, 2019
c8b3b2e
lowering: move wrap_in_try_constructor -> expr.rs
Centril Aug 10, 2019
11251b9
lowering: extract lower_expr_while_in_loop_scope
Centril Aug 10, 2019
ed1e943
lowering: extract lower_expr_if
Centril Aug 10, 2019
199d585
lowering: extract lower_expr_let
Centril Aug 10, 2019
5cba0ac
lowering: move make_async_expr -> expr.rs
Centril Aug 10, 2019
94876c2
lowering: move expr builder methods -> expr.rs
Centril Aug 10, 2019
e71f6e1
lowering: move lower_field -> expr.rs
Centril Aug 10, 2019
961ace3
lowering: move lower_{unop,binop} -> expr.rs
Centril Aug 10, 2019
29e9b5d
lowering: refactor label/dest -> expr.rs
Centril Aug 10, 2019
93570b0
lowering: move field -> expr.rs
Centril Aug 10, 2019
7f52215
lowering: move {lower_arm,arm} -> expr.rs
Centril Aug 10, 2019
5ab7345
lowering: refactor into item.rs
Centril Aug 10, 2019
28af533
lowering: move scope & capture_clause stuff -> expr.rs
Centril Aug 10, 2019
eb229bc
lowering: move lower_arg -> item.rs
Centril Aug 10, 2019
e18ad70
diagnostics: Describe crate root modules in `DefKind::Mod` as "crate"
petrochenkov Aug 3, 2019
26d26eb
Update cargo
petrochenkov Aug 10, 2019
8fd7df6
Auto merge of #63250 - petrochenkov:descrate, r=davidtwco
bors Aug 10, 2019
ee36cfa
Auto merge of #63413 - RalfJung:miri, r=oli-obk
bors Aug 11, 2019
2b78e10
Auto merge of #63343 - ishitatsuyuki:revert-62150, r=RalfJung
bors Aug 11, 2019
da6fbb1
add basic lint testing for misuse of mem::zeroed and mem::uninitialized
RalfJung Aug 6, 2019
ca1e94b
warn for more cases
RalfJung Aug 7, 2019
fbd5613
fix a comment
RalfJung Aug 7, 2019
8e6fbbe
add tuple_fields convenience method and use it in a few places
RalfJung Aug 7, 2019
4b062a1
note a FIXME
RalfJung Aug 7, 2019
3972d05
proper doc comment for 'recovered' field of variant
RalfJung Aug 7, 2019
c5a6356
allow the lint if a few UB-demonstrating doc tests
RalfJung Aug 7, 2019
5c77a17
note down some more future plans
RalfJung Aug 7, 2019
0930747
update clippy
RalfJung Aug 11, 2019
81e6b50
parser: split into expr.rs
Centril Aug 11, 2019
e742de2
parser: split into pat.rs
Centril Aug 11, 2019
8a06869
Auto merge of #63446 - Centril:refactor-lowering, r=oli-obk
bors Aug 11, 2019
65ea7b7
rustdoc: Replace HirVec with slices in doctree
Mark-Simulacrum Aug 10, 2019
19c85a8
Move def_id_to_path to use site in visit_ast
Mark-Simulacrum Aug 10, 2019
00d7bc7
Remove crate_name from DocContext
Mark-Simulacrum Aug 10, 2019
8f80a8d
Use entry API in store_path
Mark-Simulacrum Aug 10, 2019
c574810
Remove ReentrantMutex
Mark-Simulacrum Aug 10, 2019
6be2857
Replace Arc with Rc around external_traits
Mark-Simulacrum Aug 10, 2019
0031951
Store typed Passes
Mark-Simulacrum Aug 10, 2019
0347480
Don't store all traits in DocContext
Mark-Simulacrum Aug 10, 2019
eea2f87
Use a HashSet instead of Vec
Mark-Simulacrum Aug 10, 2019
ade8b02
Remove unnecessary channel
Mark-Simulacrum Aug 10, 2019
dbad77f
Remove thread-local for playground config
Mark-Simulacrum Aug 10, 2019
c250b5f
Remove fmt::Display impls on Markdown structs
Mark-Simulacrum Aug 10, 2019
1aa0964
Drop RefCell from IdMap in markdown rendering
Mark-Simulacrum Aug 10, 2019
3b8a24d
Reduce nesting in externalfiles implementation
Mark-Simulacrum Aug 10, 2019
b204232
Derive Debug for NativeLibrary and NativeLibraryKind
bjorn3 Aug 11, 2019
43de341
Copy ty::Instance instead of passing by reference
Mark-Simulacrum Aug 11, 2019
e81347c
parser: split into {item,module}.rs
Centril Aug 11, 2019
3dbfbaf
parser: split into {ty, path}.rs
Centril Aug 11, 2019
848ec4a
parser: move parse_ident_or_underscore into item.rs
Centril Aug 11, 2019
28db7c5
parser: move parse_fn_block_decl into expr.rs
Centril Aug 11, 2019
d6d93b3
parser: move into stmt.rs
Centril Aug 11, 2019
385d07f
parser: move into generics.rs
Centril Aug 11, 2019
bcfcbfc
parser: {check,expect}_lifetime into ty.rs
Centril Aug 11, 2019
c8a2855
Update RLS
Xanewok Aug 11, 2019
8862977
Rollup merge of #61969 - MikailBag:master, r=Centril
Mark-Simulacrum Aug 11, 2019
061245e
Rollup merge of #63346 - RalfJung:zeroed-lint, r=eddyb
Mark-Simulacrum Aug 11, 2019
24a8337
Rollup merge of #63433 - RalfJung:miri-call, r=oli-obk
Mark-Simulacrum Aug 11, 2019
8122a01
Rollup merge of #63440 - RalfJung:ctfe-backtrace, r=oli-obk
Mark-Simulacrum Aug 11, 2019
c805a38
Rollup merge of #63441 - bjorn3:patch-1, r=Mark-Simulacrum
Mark-Simulacrum Aug 11, 2019
e16b12f
Rollup merge of #63442 - lzutao:vec-bin-search-insert, r=Mark-Simulacrum
Mark-Simulacrum Aug 11, 2019
86ceab4
Rollup merge of #63453 - Mark-Simulacrum:rustdoc-clean-2, r=Guillaume…
Mark-Simulacrum Aug 11, 2019
4229dc3
Rollup merge of #63464 - Mark-Simulacrum:deref-instance, r=eddyb
Mark-Simulacrum Aug 11, 2019
00ee1b4
Auto merge of #63471 - Mark-Simulacrum:rollup-m756lnx, r=Mark-Simulacrum
bors Aug 11, 2019
899efd5
Auto merge of #63472 - Xanewok:update-rls, r=Mark-Simulacrum
bors Aug 11, 2019
72f8043
Auto merge of #63469 - Centril:refactor-parser, r=petrochenkov
bors Aug 12, 2019
2d5c26c
Remove meaningless comments in src/test
sd234678 Aug 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use associated_type_bounds where applicable - closes #61738
iluuu1994 committed Aug 8, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
nWidart Nicolas Widart
commit 3a6a29b4ecfdb7f641ca699fcd66a09b4baaae6a
12 changes: 6 additions & 6 deletions src/liballoc/borrow.rs
Original file line number Diff line number Diff line change
@@ -329,8 +329,8 @@ impl<'a, B: ?Sized> PartialOrd for Cow<'a, B>

#[stable(feature = "rust1", since = "1.0.0")]
impl<B: ?Sized> fmt::Debug for Cow<'_, B>
where B: fmt::Debug + ToOwned,
<B as ToOwned>::Owned: fmt::Debug
where
B: fmt::Debug + ToOwned<Owned: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
@@ -342,8 +342,8 @@ impl<B: ?Sized> fmt::Debug for Cow<'_, B>

#[stable(feature = "rust1", since = "1.0.0")]
impl<B: ?Sized> fmt::Display for Cow<'_, B>
where B: fmt::Display + ToOwned,
<B as ToOwned>::Owned: fmt::Display
where
B: fmt::Display + ToOwned<Owned: fmt::Display>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
@@ -355,8 +355,8 @@ impl<B: ?Sized> fmt::Display for Cow<'_, B>

#[stable(feature = "default", since = "1.11.0")]
impl<B: ?Sized> Default for Cow<'_, B>
where B: ToOwned,
<B as ToOwned>::Owned: Default
where
B: ToOwned<Owned: Default>,
{
/// Creates an owned Cow<'a, B> with the default value for the contained owned value.
fn default() -> Self {
1 change: 1 addition & 0 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
@@ -122,6 +122,7 @@
#![feature(alloc_layout_extra)]
#![feature(try_trait)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]

// Allow testing this library

10 changes: 6 additions & 4 deletions src/liballoc/tests/str.rs
Original file line number Diff line number Diff line change
@@ -1638,10 +1638,12 @@ mod pattern {
}
}

fn cmp_search_to_vec<'a, P: Pattern<'a>>(rev: bool, pat: P, haystack: &'a str,
right: Vec<SearchStep>)
where P::Searcher: ReverseSearcher<'a>
{
fn cmp_search_to_vec<'a>(
rev: bool,
pat: impl Pattern<'a, Searcher: ReverseSearcher<'a>>,
haystack: &'a str,
right: Vec<SearchStep>
) {
let mut searcher = pat.into_searcher(haystack);
let mut v = vec![];
loop {
4 changes: 2 additions & 2 deletions src/libcore/convert.rs
Original file line number Diff line number Diff line change
@@ -513,7 +513,7 @@ impl<T: ?Sized, U: ?Sized> AsRef<U> for &mut T where T: AsRef<U>

// FIXME (#45742): replace the above impls for &/&mut with the following more general one:
// // As lifts over Deref
// impl<D: ?Sized + Deref, U: ?Sized> AsRef<U> for D where D::Target: AsRef<U> {
// impl<D: ?Sized + Deref<Target: AsRef<U>>, U: ?Sized> AsRef<U> for D {
// fn as_ref(&self) -> &U {
// self.deref().as_ref()
// }
@@ -530,7 +530,7 @@ impl<T: ?Sized, U: ?Sized> AsMut<U> for &mut T where T: AsMut<U>

// FIXME (#45742): replace the above impl for &mut with the following more general one:
// // AsMut lifts over DerefMut
// impl<D: ?Sized + Deref, U: ?Sized> AsMut<U> for D where D::Target: AsMut<U> {
// impl<D: ?Sized + Deref<Target: AsMut<U>>, U: ?Sized> AsMut<U> for D {
// fn as_mut(&mut self) -> &mut U {
// self.deref_mut().as_mut()
// }
3 changes: 1 addition & 2 deletions src/libcore/future/future.rs
Original file line number Diff line number Diff line change
@@ -111,8 +111,7 @@ impl<F: ?Sized + Future + Unpin> Future for &mut F {
#[stable(feature = "futures_api", since = "1.36.0")]
impl<P> Future for Pin<P>
where
P: Unpin + ops::DerefMut,
P::Target: Future,
P: Unpin + ops::DerefMut<Target: Future>,
{
type Output = <<P as ops::Deref>::Target as Future>::Output;

61 changes: 37 additions & 24 deletions src/libcore/iter/adapters/flatten.rs
Original file line number Diff line number Diff line change
@@ -24,15 +24,17 @@ impl<I: Iterator, U: IntoIterator, F: FnMut(I::Item) -> U> FlatMap<I, U, F> {
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<I: Clone, U: Clone + IntoIterator, F: Clone> Clone for FlatMap<I, U, F>
where <U as IntoIterator>::IntoIter: Clone
impl<I: Clone, U, F: Clone> Clone for FlatMap<I, U, F>
where
U: Clone + IntoIterator<IntoIter: Clone>,
{
fn clone(&self) -> Self { FlatMap { inner: self.inner.clone() } }
}

#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<I: fmt::Debug, U: IntoIterator, F> fmt::Debug for FlatMap<I, U, F>
where U::IntoIter: fmt::Debug
impl<I: fmt::Debug, U, F> fmt::Debug for FlatMap<I, U, F>
where
U: IntoIterator<IntoIter: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("FlatMap").field("inner", &self.inner).finish()
@@ -68,9 +70,10 @@ impl<I: Iterator, U: IntoIterator, F> Iterator for FlatMap<I, U, F>

#[stable(feature = "rust1", since = "1.0.0")]
impl<I: DoubleEndedIterator, U, F> DoubleEndedIterator for FlatMap<I, U, F>
where F: FnMut(I::Item) -> U,
U: IntoIterator,
U::IntoIter: DoubleEndedIterator
where
F: FnMut(I::Item) -> U,
U: IntoIterator,
U::IntoIter: DoubleEndedIterator,
{
#[inline]
fn next_back(&mut self) -> Option<U::Item> { self.inner.next_back() }
@@ -105,20 +108,23 @@ impl<I, U, F> FusedIterator for FlatMap<I, U, F>
#[must_use = "iterators are lazy and do nothing unless consumed"]
#[stable(feature = "iterator_flatten", since = "1.29.0")]
pub struct Flatten<I: Iterator>
where I::Item: IntoIterator {
where
I::Item: IntoIterator,
{
inner: FlattenCompat<I, <I::Item as IntoIterator>::IntoIter>,
}
impl<I: Iterator> Flatten<I>
where I::Item: IntoIterator {

impl<I: Iterator<Item: IntoIterator>> Flatten<I> {
pub(in super::super) fn new(iter: I) -> Flatten<I> {
Flatten { inner: FlattenCompat::new(iter) }
}
}

#[stable(feature = "iterator_flatten", since = "1.29.0")]
impl<I, U> fmt::Debug for Flatten<I>
where I: Iterator + fmt::Debug, U: Iterator + fmt::Debug,
I::Item: IntoIterator<IntoIter = U, Item = U::Item>,
where
I: fmt::Debug + Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: fmt::Debug + Iterator,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Flatten").field("inner", &self.inner).finish()
@@ -127,16 +133,18 @@ impl<I, U> fmt::Debug for Flatten<I>

#[stable(feature = "iterator_flatten", since = "1.29.0")]
impl<I, U> Clone for Flatten<I>
where I: Iterator + Clone, U: Iterator + Clone,
I::Item: IntoIterator<IntoIter = U, Item = U::Item>,
where
I: Clone + Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: Clone + Iterator,
{
fn clone(&self) -> Self { Flatten { inner: self.inner.clone() } }
}

#[stable(feature = "iterator_flatten", since = "1.29.0")]
impl<I, U> Iterator for Flatten<I>
where I: Iterator, U: Iterator,
I::Item: IntoIterator<IntoIter = U, Item = U::Item>
where
I: Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: Iterator,
{
type Item = U::Item;

@@ -163,8 +171,9 @@ impl<I, U> Iterator for Flatten<I>

#[stable(feature = "iterator_flatten", since = "1.29.0")]
impl<I, U> DoubleEndedIterator for Flatten<I>
where I: DoubleEndedIterator, U: DoubleEndedIterator,
I::Item: IntoIterator<IntoIter = U, Item = U::Item>
where
I: DoubleEndedIterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: DoubleEndedIterator,
{
#[inline]
fn next_back(&mut self) -> Option<U::Item> { self.inner.next_back() }
@@ -186,8 +195,10 @@ impl<I, U> DoubleEndedIterator for Flatten<I>

#[stable(feature = "iterator_flatten", since = "1.29.0")]
impl<I, U> FusedIterator for Flatten<I>
where I: FusedIterator, U: Iterator,
I::Item: IntoIterator<IntoIter = U, Item = U::Item> {}
where
I: FusedIterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: Iterator,
{}

/// Real logic of both `Flatten` and `FlatMap` which simply delegate to
/// this type.
@@ -205,8 +216,9 @@ impl<I, U> FlattenCompat<I, U> {
}

impl<I, U> Iterator for FlattenCompat<I, U>
where I: Iterator, U: Iterator,
I::Item: IntoIterator<IntoIter = U, Item = U::Item>
where
I: Iterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: Iterator,
{
type Item = U::Item;

@@ -274,8 +286,9 @@ impl<I, U> Iterator for FlattenCompat<I, U>
}

impl<I, U> DoubleEndedIterator for FlattenCompat<I, U>
where I: DoubleEndedIterator, U: DoubleEndedIterator,
I::Item: IntoIterator<IntoIter = U, Item = U::Item>
where
I: DoubleEndedIterator<Item: IntoIterator<IntoIter = U, Item = U::Item>>,
U: DoubleEndedIterator,
{
#[inline]
fn next_back(&mut self) -> Option<U::Item> {
4 changes: 2 additions & 2 deletions src/libcore/iter/traits/collect.rs
Original file line number Diff line number Diff line change
@@ -195,8 +195,8 @@ pub trait FromIterator<A>: Sized {
///
/// ```rust
/// fn collect_as_strings<T>(collection: T) -> Vec<String>
/// where T: IntoIterator,
/// T::Item: std::fmt::Debug,
/// where
/// T: IntoIterator<Item: std::fmt::Debug>,
/// {
/// collection
/// .into_iter()
1 change: 1 addition & 0 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
@@ -132,6 +132,7 @@
#![feature(maybe_uninit_slice, maybe_uninit_array)]
#![feature(external_doc)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]

#[prelude_import]
#[allow(unused)]
10 changes: 2 additions & 8 deletions src/libcore/pin.rs
Original file line number Diff line number Diff line change
@@ -439,10 +439,7 @@ where
}
}

impl<P: Deref> Pin<P>
where
P::Target: Unpin,
{
impl<P: Deref<Target: Unpin>> Pin<P> {
/// Construct a new `Pin<P>` around a pointer to some data of a type that
/// implements [`Unpin`].
///
@@ -730,10 +727,7 @@ impl<P: Deref> Deref for Pin<P> {
}

#[stable(feature = "pin", since = "1.33.0")]
impl<P: DerefMut> DerefMut for Pin<P>
where
P::Target: Unpin
{
impl<P: DerefMut<Target: Unpin>> DerefMut for Pin<P> {
fn deref_mut(&mut self) -> &mut P::Target {
Pin::get_mut(Pin::as_mut(self))
}
116 changes: 74 additions & 42 deletions src/libcore/str/mod.rs
Original file line number Diff line number Diff line change
@@ -851,8 +851,9 @@ unsafe impl TrustedRandomAccess for Bytes<'_> {
/// wrapper types of the form X<'a, P>
macro_rules! derive_pattern_clone {
(clone $t:ident with |$s:ident| $e:expr) => {
impl<'a, P: Pattern<'a>> Clone for $t<'a, P>
where P::Searcher: Clone
impl<'a, P> Clone for $t<'a, P>
where
P: Pattern<'a, Searcher: Clone>,
{
fn clone(&self) -> Self {
let $s = self;
@@ -928,8 +929,9 @@ macro_rules! generate_pattern_iterators {
pub struct $forward_iterator<'a, P: Pattern<'a>>($internal_iterator<'a, P>);

$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> fmt::Debug for $forward_iterator<'a, P>
where P::Searcher: fmt::Debug
impl<'a, P> fmt::Debug for $forward_iterator<'a, P>
where
P: Pattern<'a, Searcher: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple(stringify!($forward_iterator))
@@ -949,8 +951,9 @@ macro_rules! generate_pattern_iterators {
}

$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> Clone for $forward_iterator<'a, P>
where P::Searcher: Clone
impl<'a, P> Clone for $forward_iterator<'a, P>
where
P: Pattern<'a, Searcher: Clone>,
{
fn clone(&self) -> Self {
$forward_iterator(self.0.clone())
@@ -962,8 +965,9 @@ macro_rules! generate_pattern_iterators {
pub struct $reverse_iterator<'a, P: Pattern<'a>>($internal_iterator<'a, P>);

$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> fmt::Debug for $reverse_iterator<'a, P>
where P::Searcher: fmt::Debug
impl<'a, P> fmt::Debug for $reverse_iterator<'a, P>
where
P: Pattern<'a, Searcher: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple(stringify!($reverse_iterator))
@@ -973,8 +977,9 @@ macro_rules! generate_pattern_iterators {
}

$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> Iterator for $reverse_iterator<'a, P>
where P::Searcher: ReverseSearcher<'a>
impl<'a, P> Iterator for $reverse_iterator<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
type Item = $iterty;

@@ -985,8 +990,9 @@ macro_rules! generate_pattern_iterators {
}

$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> Clone for $reverse_iterator<'a, P>
where P::Searcher: Clone
impl<'a, P> Clone for $reverse_iterator<'a, P>
where
P: Pattern<'a, Searcher: Clone>,
{
fn clone(&self) -> Self {
$reverse_iterator(self.0.clone())
@@ -997,8 +1003,10 @@ macro_rules! generate_pattern_iterators {
impl<'a, P: Pattern<'a>> FusedIterator for $forward_iterator<'a, P> {}

#[stable(feature = "fused", since = "1.26.0")]
impl<'a, P: Pattern<'a>> FusedIterator for $reverse_iterator<'a, P>
where P::Searcher: ReverseSearcher<'a> {}
impl<'a, P> FusedIterator for $reverse_iterator<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{}

generate_pattern_iterators!($($t)* with $(#[$common_stability_attribute])*,
$forward_iterator,
@@ -1010,8 +1018,9 @@ macro_rules! generate_pattern_iterators {
$reverse_iterator:ident, $iterty:ty
} => {
$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> DoubleEndedIterator for $forward_iterator<'a, P>
where P::Searcher: DoubleEndedSearcher<'a>
impl<'a, P> DoubleEndedIterator for $forward_iterator<'a, P>
where
P: Pattern<'a, Searcher: DoubleEndedSearcher<'a>>,
{
#[inline]
fn next_back(&mut self) -> Option<$iterty> {
@@ -1020,8 +1029,9 @@ macro_rules! generate_pattern_iterators {
}

$(#[$common_stability_attribute])*
impl<'a, P: Pattern<'a>> DoubleEndedIterator for $reverse_iterator<'a, P>
where P::Searcher: DoubleEndedSearcher<'a>
impl<'a, P> DoubleEndedIterator for $reverse_iterator<'a, P>
where
P: Pattern<'a, Searcher: DoubleEndedSearcher<'a>>,
{
#[inline]
fn next_back(&mut self) -> Option<$iterty> {
@@ -1049,7 +1059,10 @@ struct SplitInternal<'a, P: Pattern<'a>> {
finished: bool,
}

impl<'a, P: Pattern<'a>> fmt::Debug for SplitInternal<'a, P> where P::Searcher: fmt::Debug {
impl<'a, P> fmt::Debug for SplitInternal<'a, P>
where
P: Pattern<'a, Searcher: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("SplitInternal")
.field("start", &self.start)
@@ -1166,7 +1179,10 @@ struct SplitNInternal<'a, P: Pattern<'a>> {
count: usize,
}

impl<'a, P: Pattern<'a>> fmt::Debug for SplitNInternal<'a, P> where P::Searcher: fmt::Debug {
impl<'a, P> fmt::Debug for SplitNInternal<'a, P>
where
P: Pattern<'a, Searcher: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("SplitNInternal")
.field("iter", &self.iter)
@@ -1222,7 +1238,10 @@ derive_pattern_clone!{

struct MatchIndicesInternal<'a, P: Pattern<'a>>(P::Searcher);

impl<'a, P: Pattern<'a>> fmt::Debug for MatchIndicesInternal<'a, P> where P::Searcher: fmt::Debug {
impl<'a, P> fmt::Debug for MatchIndicesInternal<'a, P>
where
P: Pattern<'a, Searcher: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("MatchIndicesInternal")
.field(&self.0)
@@ -1273,7 +1292,10 @@ derive_pattern_clone!{

struct MatchesInternal<'a, P: Pattern<'a>>(P::Searcher);

impl<'a, P: Pattern<'a>> fmt::Debug for MatchesInternal<'a, P> where P::Searcher: fmt::Debug {
impl<'a, P> fmt::Debug for MatchesInternal<'a, P>
where
P: Pattern<'a, Searcher: fmt::Debug>,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_tuple("MatchesInternal")
.field(&self.0)
@@ -2882,8 +2904,9 @@ impl str {
/// assert!(!bananas.ends_with("nana"));
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn ends_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool
where P::Searcher: ReverseSearcher<'a>
pub fn ends_with<'a, P>(&'a self, pat: P) -> bool
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
pat.is_suffix_of(self)
}
@@ -2975,8 +2998,9 @@ impl str {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rfind<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize>
where P::Searcher: ReverseSearcher<'a>
pub fn rfind<'a, P>(&'a self, pat: P) -> Option<usize>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
pat.into_searcher(self).next_match_back().map(|(i, _)| i)
}
@@ -3142,8 +3166,9 @@ impl str {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rsplit<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplit<'a, P>
where P::Searcher: ReverseSearcher<'a>
pub fn rsplit<'a, P>(&'a self, pat: P) -> RSplit<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
RSplit(self.split(pat).0)
}
@@ -3233,8 +3258,9 @@ impl str {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rsplit_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> RSplitTerminator<'a, P>
where P::Searcher: ReverseSearcher<'a>
pub fn rsplit_terminator<'a, P>(&'a self, pat: P) -> RSplitTerminator<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
RSplitTerminator(self.split_terminator(pat).0)
}
@@ -3333,8 +3359,9 @@ impl str {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn rsplitn<'a, P: Pattern<'a>>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where P::Searcher: ReverseSearcher<'a>
pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
RSplitN(self.splitn(n, pat).0)
}
@@ -3406,8 +3433,9 @@ impl str {
/// ```
#[stable(feature = "str_matches", since = "1.2.0")]
#[inline]
pub fn rmatches<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatches<'a, P>
where P::Searcher: ReverseSearcher<'a>
pub fn rmatches<'a, P>(&'a self, pat: P) -> RMatches<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
RMatches(self.matches(pat).0)
}
@@ -3491,8 +3519,9 @@ impl str {
/// ```
#[stable(feature = "str_match_indices", since = "1.5.0")]
#[inline]
pub fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
where P::Searcher: ReverseSearcher<'a>
pub fn rmatch_indices<'a, P>(&'a self, pat: P) -> RMatchIndices<'a, P>
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
RMatchIndices(self.match_indices(pat).0)
}
@@ -3700,8 +3729,9 @@ impl str {
#[must_use = "this returns the trimmed string as a new slice, \
without modifying the original"]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn trim_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
where P::Searcher: DoubleEndedSearcher<'a>
pub fn trim_matches<'a, P>(&'a self, pat: P) -> &'a str
where
P: Pattern<'a, Searcher: DoubleEndedSearcher<'a>>,
{
let mut i = 0;
let mut j = 0;
@@ -3792,8 +3822,9 @@ impl str {
#[must_use = "this returns the trimmed string as a new slice, \
without modifying the original"]
#[stable(feature = "trim_direction", since = "1.30.0")]
pub fn trim_end_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
where P::Searcher: ReverseSearcher<'a>
pub fn trim_end_matches<'a, P>(&'a self, pat: P) -> &'a str
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
let mut j = 0;
let mut matcher = pat.into_searcher(self);
@@ -3880,8 +3911,9 @@ impl str {
reason = "superseded by `trim_end_matches`",
suggestion = "trim_end_matches",
)]
pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str
where P::Searcher: ReverseSearcher<'a>
pub fn trim_right_matches<'a, P>(&'a self, pat: P) -> &'a str
where
P: Pattern<'a, Searcher: ReverseSearcher<'a>>,
{
self.trim_end_matches(pat)
}
1 change: 1 addition & 0 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
@@ -61,6 +61,7 @@
#![feature(proc_macro_hygiene)]
#![feature(log_syntax)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]

#![recursion_limit="512"]

2 changes: 1 addition & 1 deletion src/librustc/traits/select.rs
Original file line number Diff line number Diff line change
@@ -3901,7 +3901,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
// each predicate must be preceded by the obligations required
// to normalize it.
// for example, if we have:
// impl<U: Iterator, V: Iterator<Item=U>> Foo for V where U::Item: Copy
// impl<U: Iterator<Item: Copy>, V: Iterator<Item = U>> Foo for V
// the impl will have the following predicates:
// <V as Iterator>::Item = U,
// U: Iterator, U: Sized,
6 changes: 2 additions & 4 deletions src/librustc/traits/structural_impls.rs
Original file line number Diff line number Diff line change
@@ -980,17 +980,15 @@ EnumTypeFoldableImpl! {
(chalk_engine::DelayedLiteral::Negative)(a),
(chalk_engine::DelayedLiteral::Positive)(a, b),
} where
C: chalk_engine::context::Context + Clone,
C::CanonicalConstrainedSubst: TypeFoldable<'tcx>,
C: chalk_engine::context::Context<CanonicalConstrainedSubst: TypeFoldable<'tcx>> + Clone,
}

EnumTypeFoldableImpl! {
impl<'tcx, C> TypeFoldable<'tcx> for chalk_engine::Literal<C> {
(chalk_engine::Literal::Negative)(a),
(chalk_engine::Literal::Positive)(a),
} where
C: chalk_engine::context::Context + Clone,
C::GoalInEnvironment: Clone + TypeFoldable<'tcx>,
C: chalk_engine::context::Context<GoalInEnvironment: Clone + TypeFoldable<'tcx>> + Clone,
}

CloneTypeFoldableAndLiftImpls! {
4 changes: 2 additions & 2 deletions src/librustc/ty/context.rs
Original file line number Diff line number Diff line change
@@ -2663,8 +2663,8 @@ impl<'tcx> TyCtxt<'tcx> {
unsafety: hir::Unsafety,
abi: abi::Abi)
-> <I::Item as InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>>::Output
where I: Iterator,
I::Item: InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>
where
I: Iterator<Item: InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>>,
{
inputs.chain(iter::once(output)).intern_with(|xs| ty::FnSig {
inputs_and_output: self.intern_type_list(xs),
6 changes: 3 additions & 3 deletions src/librustc/ty/layout.rs
Original file line number Diff line number Diff line change
@@ -2027,9 +2027,9 @@ impl ty::query::TyCtxtAt<'tcx> {

impl<'tcx, C> TyLayoutMethods<'tcx, C> for Ty<'tcx>
where
C: LayoutOf<Ty = Ty<'tcx>> + HasTyCtxt<'tcx>,
C::TyLayout: MaybeResult<TyLayout<'tcx>>,
C: HasParamEnv<'tcx>,
C: LayoutOf<Ty = Ty<'tcx>, TyLayout: MaybeResult<TyLayout<'tcx>>>
+ HasTyCtxt<'tcx>
+ HasParamEnv<'tcx>,
{
fn for_variant(this: TyLayout<'tcx>, cx: &C, variant_index: VariantIdx) -> TyLayout<'tcx> {
let details = match this.variants {
3 changes: 1 addition & 2 deletions src/librustc/ty/query/on_disk_cache.rs
Original file line number Diff line number Diff line change
@@ -1055,9 +1055,8 @@ fn encode_query_results<'a, 'tcx, Q, E>(
query_result_index: &mut EncodedQueryResultIndex,
) -> Result<(), E::Error>
where
Q: super::config::QueryDescription<'tcx>,
Q: super::config::QueryDescription<'tcx, Value: Encodable>,
E: 'a + TyEncoder,
Q::Value: Encodable,
{
let desc = &format!("encode_query_results for {}",
::std::any::type_name::<Q>());
4 changes: 2 additions & 2 deletions src/librustc_codegen_ssa/back/command.rs
Original file line number Diff line number Diff line change
@@ -50,8 +50,8 @@ impl Command {
}

pub fn args<I>(&mut self, args: I) -> &mut Command
where I: IntoIterator,
I::Item: AsRef<OsStr>,
where
I: IntoIterator<Item: AsRef<OsStr>>,
{
for arg in args {
self._arg(arg.as_ref());
1 change: 1 addition & 0 deletions src/librustc_codegen_ssa/lib.rs
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
#![feature(nll)]
#![feature(trusted_len)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]

#![recursion_limit="256"]

1 change: 1 addition & 0 deletions src/librustc_data_structures/lib.rs
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@
#![feature(core_intrinsics)]
#![feature(integer_atomics)]
#![feature(test)]
#![feature(associated_type_bounds)]

#![cfg_attr(unix, feature(libc))]

8 changes: 6 additions & 2 deletions src/librustc_data_structures/owning_ref/mod.rs
Original file line number Diff line number Diff line change
@@ -847,7 +847,9 @@ pub trait ToHandleMut {
}

impl<O, H> OwningHandle<O, H>
where O: StableAddress, O::Target: ToHandle<Handle = H>, H: Deref,
where
O: StableAddress<Target: ToHandle<Handle = H>>,
H: Deref,
{
/// Creates a new `OwningHandle` for a type that implements `ToHandle`. For types
/// that don't implement `ToHandle`, callers may invoke `new_with_fn`, which accepts
@@ -858,7 +860,9 @@ impl<O, H> OwningHandle<O, H>
}

impl<O, H> OwningHandle<O, H>
where O: StableAddress, O::Target: ToHandleMut<HandleMut = H>, H: DerefMut,
where
O: StableAddress<Target: ToHandleMut<HandleMut = H>>,
H: DerefMut,
{
/// Creates a new mutable `OwningHandle` for a type that implements `ToHandleMut`.
pub fn new_mut(o: O) -> Self {
11 changes: 3 additions & 8 deletions src/librustc_mir/dataflow/mod.rs
Original file line number Diff line number Diff line change
@@ -589,10 +589,8 @@ impl<E:Idx> GenKillSet<E> {
self.gen_set.insert(e);
self.kill_set.remove(e);
}
fn gen_all<I>(&mut self, i: I)
where I: IntoIterator,
I::Item: Borrow<E>
{

fn gen_all(&mut self, i: impl IntoIterator<Item: Borrow<E>>) {
for j in i {
self.gen(*j.borrow());
}
@@ -603,10 +601,7 @@ impl<E:Idx> GenKillSet<E> {
self.kill_set.insert(e);
}

fn kill_all<I>(&mut self, i: I)
where I: IntoIterator,
I::Item: Borrow<E>
{
fn kill_all(&mut self, i: impl IntoIterator<Item: Borrow<E>>) {
for j in i {
self.kill(*j.borrow());
}
1 change: 1 addition & 0 deletions src/librustc_mir/lib.rs
Original file line number Diff line number Diff line change
@@ -23,6 +23,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(trusted_len)]
#![feature(try_blocks)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]

#![recursion_limit="256"]

10 changes: 2 additions & 8 deletions src/libserialize/collection_impls.rs
Original file line number Diff line number Diff line change
@@ -9,10 +9,7 @@ use std::sync::Arc;

use smallvec::{Array, SmallVec};

impl<A> Encodable for SmallVec<A>
where A: Array,
A::Item: Encodable
{
impl<A: Array<Item: Encodable>> Encodable for SmallVec<A> {
fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
s.emit_seq(self.len(), |s| {
for (i, e) in self.iter().enumerate() {
@@ -23,10 +20,7 @@ impl<A> Encodable for SmallVec<A>
}
}

impl<A> Decodable for SmallVec<A>
where A: Array,
A::Item: Decodable
{
impl<A: Array<Item: Decodable>> Decodable for SmallVec<A> {
fn decode<D: Decoder>(d: &mut D) -> Result<SmallVec<A>, D::Error> {
d.read_seq(|d, len| {
let mut vec = SmallVec::with_capacity(len);
1 change: 1 addition & 0 deletions src/libserialize/lib.rs
Original file line number Diff line number Diff line change
@@ -13,6 +13,7 @@ Core encoding and decoding interfaces.
#![feature(specialization)]
#![feature(never_type)]
#![feature(nll)]
#![feature(associated_type_bounds)]
#![cfg_attr(test, feature(test))]

pub use self::serialize::{Decoder, Encoder, Decodable, Encodable};
12 changes: 10 additions & 2 deletions src/libstd/sys/sgx/abi/usercalls/alloc.rs
Original file line number Diff line number Diff line change
@@ -522,7 +522,11 @@ impl<T: ?Sized> Drop for User<T> where T: UserSafe {
impl<T: CoerceUnsized<U>, U> CoerceUnsized<UserRef<U>> for UserRef<T> {}

#[unstable(feature = "sgx_platform", issue = "56975")]
impl<T, I: SliceIndex<[T]>> Index<I> for UserRef<[T]> where [T]: UserSafe, I::Output: UserSafe {
impl<T, I> Index<I> for UserRef<[T]>
where
[T]: UserSafe,
I: SliceIndex<[T], Output: UserSafe>,
{
type Output = UserRef<I::Output>;

#[inline]
@@ -538,7 +542,11 @@ impl<T, I: SliceIndex<[T]>> Index<I> for UserRef<[T]> where [T]: UserSafe, I::Ou
}

#[unstable(feature = "sgx_platform", issue = "56975")]
impl<T, I: SliceIndex<[T]>> IndexMut<I> for UserRef<[T]> where [T]: UserSafe, I::Output: UserSafe {
impl<T, I> IndexMut<I> for UserRef<[T]>
where
[T]: UserSafe,
I: SliceIndex<[T], Output: UserSafe>,
{
#[inline]
fn index_mut(&mut self, index: I) -> &mut UserRef<I::Output> {
unsafe {