Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
59d4bae
Add validation for `link` attribute position.
ehuss Jan 9, 2022
b59e743
Mark windows_subsytem and no_builtins as crate-only attributes.
ehuss Jan 9, 2022
012910d
Canonicalize const variables correctly
compiler-errors Jan 7, 2022
9bf9fe0
Don't leak inference variables in array unsizing
compiler-errors Jan 7, 2022
7bf0cb7
Add new tests, fix up old tests
compiler-errors Jan 7, 2022
a7092f9
Typos fix
maxwase Jan 13, 2022
5431d5b
Add rustc_diagnostic_item attribute to AtomicBool
llogiq Jan 13, 2022
c4b994f
Pick themes on settings page, not every page
jsha Jan 6, 2022
04f0402
Add support for "always theme" in setting
jsha Jan 7, 2022
9c6d8ef
htmldocck: Add support for `/text()` in `@snapshot`
camelid Jan 15, 2022
1a37262
Exclude llvm-libunwind from the self-contained set on s390x-musl targ…
kaniini Jan 15, 2022
47de5b4
Remove `collect`
vacuus Jan 15, 2022
e6aef25
Add `~const` bound test for negative impls
lilasta Jan 17, 2022
853feb6
update codegen test for LLVM 14
Jan 17, 2022
e4607ff
update test assertion
Jan 17, 2022
43b9268
Rustdoc style cleanups
jsha Jan 12, 2022
b71f1fb
Hide mobile sidebar on some clicks
jsha Jan 12, 2022
7b5b3cf
Abstract the pretty printer's ringbuffer to be infinitely sized
dtolnay Jan 15, 2022
e012b9a
Stabilize vec_spare_capacity
Amanieu Jan 17, 2022
ae99e23
Add staged_api for tests
jsha Jan 15, 2022
d501ead
Rollup merge of #92629 - jsha:theme-picker-local-only-2, r=GuillaumeG…
matthiaskrgr Jan 18, 2022
cb5ecff
Rollup merge of #92640 - compiler-errors:array-deref-on-newtype, r=lcnr
matthiaskrgr Jan 18, 2022
804072f
Rollup merge of #92701 - ehuss:even-more-attr-validation, r=matthewja…
matthiaskrgr Jan 18, 2022
cc2339c
Rollup merge of #92803 - jsha:hide-sidebar, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
deee6f7
Rollup merge of #92830 - jsha:style-cleanups, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
ae8f39e
Rollup merge of #92866 - maxwase:does_exist_typo, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
6a5663e
Rollup merge of #92870 - llogiq:atomic_bool_sym, r=Manishearth
matthiaskrgr Jan 18, 2022
be3d25b
Rollup merge of #92914 - camelid:snapshot-text, r=GuillaumeGomez
matthiaskrgr Jan 18, 2022
04b2073
Rollup merge of #92923 - dtolnay:ringbuffer, r=petrochenkov
matthiaskrgr Jan 18, 2022
b05be97
Rollup merge of #92946 - kaniini:chore/llvm-libunwind-s390x, r=Mark-S…
matthiaskrgr Jan 18, 2022
71e5bfe
Rollup merge of #92947 - vacuus:rustdoc-core-visit-path, r=camelid
matthiaskrgr Jan 18, 2022
baeff67
Rollup merge of #92997 - woppopo:test92114, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
b8c544d
Rollup merge of #93004 - krasimirgg:threadlocal-llvm-up, r=nikic
matthiaskrgr Jan 18, 2022
83b1a94
Rollup merge of #93016 - Amanieu:vec_spare_capacity, r=Mark-Simulacrum
matthiaskrgr Jan 18, 2022
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 new tests, fix up old tests
  • Loading branch information
compiler-errors committed Jan 12, 2022
commit 7bf0cb76710e723ac71257e04f4a1bfbbfc87c3c
17 changes: 17 additions & 0 deletions src/test/ui/autoref-autoderef/deref-into-array.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// check-pass

struct Test<T>([T; 1]);

impl<T> std::ops::Deref for Test<T> {
type Target = [T; 1];

fn deref(&self) -> &[T; 1] {
&self.0
}
}

fn main() {
let out = Test([(); 1]);
let blah = out.len();
println!("{}", blah);
}
27 changes: 27 additions & 0 deletions src/test/ui/const-generics/deref-into-array-generic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// check-pass

struct Test<T, const N: usize>([T; N]);

impl<T: Copy + Default, const N: usize> Default for Test<T, N> {
fn default() -> Self {
Self([T::default(); N])
}
}

impl<T, const N: usize> std::ops::Deref for Test<T, N> {
type Target = [T; N];

fn deref(&self) -> &[T; N] {
&self.0
}
}

fn test() -> Test<u64, 16> {
let test = Test::default();
println!("{}", test.len());
test
}

fn main() {
test();
}