Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0e0ae47
Add a new lint to rustdoc for invalid codeblocks
poliorcetics Dec 15, 2020
b11b705
Add test for issue #74824
aDotInTheVoid Dec 17, 2020
830ceaa
Remap instrument-coverage line numbers in doctests
Swatinem Dec 6, 2020
52b717f
Edit rustc_middle::lint::LintSource docs
pierwill Dec 19, 2020
4fffa74
docs: Edit rustc_middle::ty::query::on_disk_cache
pierwill Dec 19, 2020
41c4330
Make doc-test pass with the new rustdoc
poliorcetics Dec 19, 2020
c127530
Fix labels for 'Library Tracking Issue' template
camelid Dec 20, 2020
f9fa3fe
add an attribute to inner doctest fn
Swatinem Dec 20, 2020
8cfaf94
update rustfmt to v1.4.30
calebcartwright Dec 20, 2020
087101e
make path normalization compatible with mac python2
Swatinem Dec 21, 2020
a272d62
Implemented a compiler diagnostic for move async mistake
diondokter Dec 18, 2020
3abba5e
Deprecate compare_and_swap on all atomic types
faern Nov 20, 2020
4252e48
Add documentation on migrating away from compare_and_swap
faern Nov 20, 2020
828d4ac
Migrate standard library away from compare_and_swap
faern Nov 20, 2020
7f35e2d
Add doc aliases to compare_exchange[_weak]
faern Nov 22, 2020
427996a
Fix documentation typo
faern Nov 22, 2020
3eef20f
Improve documentation on `success` and `failure` arguments
faern Nov 22, 2020
865e479
Fix compare_and_swap in Windows thread_parker
faern Dec 22, 2020
454f3ed
Update library/std/src/sys/windows/thread_parker.rs
faern Dec 22, 2020
9414f0b
Revert "Remove missing_fragment_specifier lint"
wesleywiser Dec 19, 2020
f1eb88b
Revert "Promote missing_fragment_specifier to hard error"
wesleywiser Dec 19, 2020
56154a1
Add example to lint docs
wesleywiser Dec 21, 2020
9988d3a
Rollup merge of #79261 - faern:deprecate-compare-and-swap, r=Amanieu
Dylan-DPC Dec 22, 2020
7a3f751
Rollup merge of #79762 - Swatinem:remap-doctest-coverage, r=Swatinem
Dylan-DPC Dec 22, 2020
e89d541
Rollup merge of #79816 - poliorcetics:rustdoc-fail-on-deny, r=jyn514
Dylan-DPC Dec 22, 2020
9b40dd8
Rollup merge of #80136 - aDotInTheVoid:74824-test, r=Mark-Simulacrum
Dylan-DPC Dec 22, 2020
9f671ae
Rollup merge of #80160 - diondokter:move_async_fix, r=davidtwco
Dylan-DPC Dec 22, 2020
56633fa
Rollup merge of #80203 - pierwill:pierwill-rustcmiddle-lint, r=oli-obk
Dylan-DPC Dec 22, 2020
086493e
Rollup merge of #80204 - pierwill:pierwill-rustcmiddle-ondisk, r=varkor
Dylan-DPC Dec 22, 2020
0af560a
Rollup merge of #80219 - camelid:library_tracking_issue-labels, r=m-o…
Dylan-DPC Dec 22, 2020
9c98ae2
Rollup merge of #80249 - calebcartwright:update-rustfmt, r=Mark-Simul…
Dylan-DPC Dec 22, 2020
32c30b1
Rollup merge of #80296 - wesleywiser:revert_missing_fragment_specifie…
Dylan-DPC Dec 22, 2020
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
Add test for issue #74824
  • Loading branch information
aDotInTheVoid committed Dec 17, 2020
commit b11b705e52c534300565fa9a44fa4630a896ae5b
27 changes: 27 additions & 0 deletions src/test/ui/generic-associated-types/issue-74824.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#![feature(generic_associated_types)]
#![feature(associated_type_defaults)]
#![allow(incomplete_features)]

use std::ops::Deref;

trait UnsafeCopy {
type Copy<T>: Copy = Box<T>;
//~^ ERROR the trait bound `Box<T>: Copy` is not satisfied
//~^^ ERROR the trait bound `T: Clone` is not satisfied
fn copy<T>(x: &Self::Copy<T>) -> Self::Copy<T> {
*x
}
}

impl<T> UnsafeCopy for T {}

fn main() {
let b = Box::new(42usize);
let copy = <()>::copy(&b);

let raw_b = Box::deref(&b) as *const _;
let raw_copy = Box::deref(&copy) as *const _;

// assert the addresses.
assert_eq!(raw_b, raw_copy);
}
27 changes: 27 additions & 0 deletions src/test/ui/generic-associated-types/issue-74824.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
error[E0277]: the trait bound `Box<T>: Copy` is not satisfied
--> $DIR/issue-74824.rs:8:5
|
LL | type Copy<T>: Copy = Box<T>;
| ^^^^^^^^^^^^^^----^^^^^^^^^^
| | |
| | required by this bound in `UnsafeCopy::Copy`
| the trait `Copy` is not implemented for `Box<T>`

error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/issue-74824.rs:8:5
|
LL | type Copy<T>: Copy = Box<T>;
| ^^^^^^^^^^^^^^----^^^^^^^^^^
| | |
| | required by this bound in `UnsafeCopy::Copy`
| the trait `Clone` is not implemented for `T`
|
= note: required because of the requirements on the impl of `Clone` for `Box<T>`
help: consider restricting type parameter `T`
|
LL | type Copy<T: Clone>: Copy = Box<T>;
| ^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.