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

Rollup of 10 pull requests #82795

Merged
merged 73 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f45bdcc
Implement size_hint for BufReader
Xavientois Jan 15, 2021
c3e47d9
Fix implementation to specialize
Xavientois Jan 15, 2021
fa76db3
Use helper trait to follow min_specialization rules
Xavientois Jan 15, 2021
11c49f6
Add missing generic
Xavientois Jan 15, 2021
260a270
Move default to trait definition
Xavientois Jan 15, 2021
5f60a30
Fix incorrect token
Xavientois Jan 15, 2021
eea99f4
Add default keyword for specialization
Xavientois Jan 15, 2021
7e56637
Add back lower_bound as memeber
Xavientois Jan 16, 2021
442de9a
Fix semicolon
Xavientois Jan 16, 2021
1190321
Remove exposing private trait
Xavientois Jan 16, 2021
421b40c
Add dyn for SizeHint cast
Xavientois Jan 16, 2021
265db94
Fix formatting
Xavientois Jan 16, 2021
93870c8
Remove stable annotation
Xavientois Jan 16, 2021
7869371
Remove unnecessary default keyword
Xavientois Jan 16, 2021
c8e0f8a
Use fully qualified syntax to avoid dyn
Xavientois Jan 16, 2021
96255f8
Implement SizeHint trait for BufReader, Emtpy, and Chain
Xavientois Jan 16, 2021
389e638
Add tests for SizeHint implementations
Xavientois Jan 16, 2021
b837f3a
Remove trailing newline
Xavientois Jan 16, 2021
81aba38
Add space for proper indentation
Xavientois Jan 16, 2021
fc9cd4a
Fix formatting on mod
Xavientois Jan 16, 2021
7674ae1
Fix line length format
Xavientois Jan 31, 2021
7b021aa
resolve: Reduce scope of `pub_use_of_private_extern_crate` deprecatio…
petrochenkov Jan 28, 2021
a3db47a
Add suggestion for iterators in iterators
kper Feb 9, 2021
040735c
First version of noop-lint
rylev Jan 5, 2021
f49ed7a
Add tests and support two more noop methods
rylev Jan 5, 2021
a6d926d
Fix tests
rylev Jan 5, 2021
618c395
Bless test where order of error message changed
rylev Jan 6, 2021
3a86184
Fix ui-full-deps suite
rylev Jan 6, 2021
ee65416
Fix core tests
rylev Jan 6, 2021
d3b49c2
Only allow new lint when not bootstrapping - since beta doesn't know …
rylev Jan 7, 2021
c5ff54c
Fix std tests
rylev Jan 7, 2021
217c886
Improve warning
rylev Jan 8, 2021
16c4afb
Fix tidy errors
rylev Jan 8, 2021
95e330b
Update error message
rylev Jan 11, 2021
316e9db
Fix tidy error
rylev Jan 11, 2021
49f32e0
Improve error messages
rylev Jan 12, 2021
e48670c
Increase accuracy of lint trigger
estebank Jan 13, 2021
055db16
Clean up code rightward drift
estebank Jan 13, 2021
4be7052
Allow noop_method_call in clippy ui test
rylev Jan 18, 2021
6bf6652
Move unrelated ui test back to what it was before
rylev Feb 10, 2021
da3995f
Remove lint pass on borrow and deref
rylev Feb 16, 2021
1999a31
Fix borrow and deref
rylev Feb 16, 2021
25637b2
Warn in doc test
rylev Feb 17, 2021
9425e30
Avoid unnecessary Vec construction in BufReader
calebsander Dec 28, 2020
66a2606
Increment self.len in specialized ZipImpl to avoid underflow in size_…
SkiFire13 Feb 19, 2021
8b9ac4d
Add test for underflow in specialized Zip's size_hint
SkiFire13 Feb 19, 2021
aeb4ea7
Remove useless comparison since now self.index <= self.len is an inva…
SkiFire13 Feb 19, 2021
09cbcdc
Add BTreeMap::try_insert and btree_map::OccupiedError.
m-ou-se Mar 4, 2021
f6fe24a
Add HashMap::try_insert and hash_map::OccupiedError.
m-ou-se Mar 4, 2021
69d95e2
Improve Debug implementations of OccupiedError.
m-ou-se Mar 4, 2021
d85d82a
Implement Error for OccupiedError.
m-ou-se Mar 4, 2021
da01455
Ignore file length tidy warning in hash/map.rs.
m-ou-se Mar 4, 2021
1aedb4c
Remove unnecessary bound from HashMap::try_insert.
m-ou-se Mar 4, 2021
eddd4f0
Add tracking issue for map_try_insert.
m-ou-se Mar 4, 2021
eb18746
Add assert_matches!(expr, pat).
m-ou-se Mar 4, 2021
cfce60e
Allow for multiple patterns and a guard in assert_matches.
m-ou-se Mar 4, 2021
0a8e401
Add debug_assert_matches macro.
m-ou-se Mar 4, 2021
5bd1204
Fix assert_matches doc examples.
m-ou-se Mar 4, 2021
a5951d4
Add diagnostic item to `Default` trait
mgacek8 Mar 4, 2021
58d6f80
Fix comment with path to `symbols!` macro
mgacek8 Mar 4, 2021
f223aff
Don't consume the expression in assert_matches!()'s failure case.
m-ou-se Mar 4, 2021
80fcdef
Add tracking issue for assert_matches.
m-ou-se Mar 4, 2021
ad91915
Remove unused code from main.js
notriddle Mar 5, 2021
e6a6df5
Rollup merge of #80723 - rylev:noop-lint-pass, r=estebank
m-ou-se Mar 5, 2021
ec2619c
Rollup merge of #80763 - petrochenkov:pubusecrate, r=estebank
m-ou-se Mar 5, 2021
6013811
Rollup merge of #81136 - Xavientois:io_reader_size_hint, r=cramertj
m-ou-se Mar 5, 2021
20887b7
Rollup merge of #81939 - kper:fixing-81584-allocate-in-iter, r=davidtwco
m-ou-se Mar 5, 2021
ee796c6
Rollup merge of #82289 - SkiFire13:fix-issue-82282, r=m-ou-se
m-ou-se Mar 5, 2021
68f2934
Rollup merge of #82728 - calebsander:refactor/bufreader-buf, r=m-ou-se
m-ou-se Mar 5, 2021
232caad
Rollup merge of #82764 - m-ou-se:map-try-insert, r=Amanieu
m-ou-se Mar 5, 2021
04045cc
Rollup merge of #82770 - m-ou-se:assert-match, r=joshtriplett
m-ou-se Mar 5, 2021
2cd1f79
Rollup merge of #82773 - mgacek8:feature/add_diagnostic_item_to_Defau…
m-ou-se Mar 5, 2021
16518e7
Rollup merge of #82787 - notriddle:main-js-cleanup, r=GuillaumeGomez
m-ou-se Mar 5, 2021
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
Improve Debug implementations of OccupiedError.
  • Loading branch information
m-ou-se committed Mar 4, 2021
commit 69d95e232af0fe81de85e1e4a1f8dc73d7b0f16c
5 changes: 3 additions & 2 deletions library/alloc/src/collections/btree/map/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ pub struct OccupiedError<'a, K: 'a, V: 'a> {
impl<K: Debug + Ord, V: Debug> Debug for OccupiedError<'_, K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedError")
.field("entry", &self.entry)
.field("value", &self.value)
.field("key", self.entry.key())
.field("old_value", self.entry.get())
.field("new_value", &self.value)
.finish()
}
}
Expand Down
12 changes: 11 additions & 1 deletion library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1889,14 +1889,24 @@ impl<K: Debug, V> Debug for VacantEntry<'_, K, V> {
///
/// Contains the occupied entry, and the value that was not inserted.
#[unstable(feature = "map_try_insert", issue = "none")]
#[derive(Debug)]
pub struct OccupiedError<'a, K: 'a, V: 'a> {
/// The entry in the map that was already occupied.
pub entry: OccupiedEntry<'a, K, V>,
/// The value which was not inserted, because the entry was already occupied.
pub value: V,
}

#[unstable(feature = "map_try_insert", issue = "none")]
impl<K: Debug, V: Debug> Debug for OccupiedError<'_, K, V> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("OccupiedError")
.field("key", self.entry.key())
.field("old_value", self.entry.get())
.field("new_value", &self.value)
.finish()
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, K, V, S> IntoIterator for &'a HashMap<K, V, S> {
type Item = (&'a K, &'a V);
Expand Down