Skip to content

Rollup of 11 pull requests #81392

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

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b43aa96
Print failure message on all tests that should panic, but don't
johanngan Jan 10, 2021
679f6f3
Add `unwrap_unchecked()` methods for `Option` and `Result`
ojeda Jan 10, 2021
76299b3
Add `SAFETY` annotations
ojeda Jan 10, 2021
63a1eee
Reset LateContext enclosing body in nested items
camsteffen Jan 18, 2021
21fb586
Query for TypeckResults in LateContext::qpath_res
camsteffen Jan 18, 2021
def0e9b
Fix ICE with `ReadPointerAsBytes` validation error
camelid Jan 11, 2021
a7b7a43
Move test to `src/test/ui/consts/`
camelid Jan 11, 2021
eaba3da
Remove qpath_res util function
camsteffen Jan 18, 2021
e25959b
Make more traits of the From/Into family diagnostic items
flip1995 Jan 22, 2021
3a4786d
Use UFCS instead of method calls in `derive(Debug)`. See issue 81211 …
pnkfelix Jan 23, 2021
78e57d3
Regression tests for issue 81211.
pnkfelix Jan 23, 2021
d78f0a1
Test exploring the interactions between all of the different kinds of…
pnkfelix Jan 23, 2021
aa8fdad
placate tidy.
pnkfelix Jan 23, 2021
6d4e03a
codegen: assume constants cannot fail to evaluate
RalfJung Jan 24, 2021
2be1993
Ignore test on 32-bit architectures
camelid Jan 25, 2021
26b4baf
Point to span of upvar making closure FnMut
sledgehammervampire Jan 18, 2021
088c89d
Account for generics when suggesting bound
estebank Jan 19, 2021
042facb
Fix some bugs reported by eslint
GuillaumeGomez Jan 23, 2021
0140dac
Link the reference about undefined behavior
ojeda Jan 25, 2021
01250fc
Add tracking issue
ojeda Jan 25, 2021
24149d7
Blessed change to output of flaky test.
pnkfelix Jan 25, 2021
1c0a52d
rustdoc: Document CommonMark extensions.
ehuss Jan 25, 2021
17ba456
Rollup merge of #80868 - johanngan:should-panic-msg-with-expected, r=…
jonas-schievink Jan 25, 2021
0e416cc
Rollup merge of #80876 - ojeda:option-result-unwrap_unchecked, r=m-ou-se
jonas-schievink Jan 25, 2021
8ee1696
Rollup merge of #80900 - camelid:readpointerasbytes-ice, r=oli-obk
jonas-schievink Jan 25, 2021
e4e79fa
Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011
jonas-schievink Jan 25, 2021
0652507
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
jonas-schievink Jan 25, 2021
00188e0
Rollup merge of #81195 - estebank:suggest-bound-on-trait-with-params,…
jonas-schievink Jan 25, 2021
e94b0b7
Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper
jonas-schievink Jan 25, 2021
21998ab
Rollup merge of #81294 - pnkfelix:issue-81211-use-ufcs-in-derive-debu…
jonas-schievink Jan 25, 2021
b1d6d12
Rollup merge of #81299 - GuillaumeGomez:fix-eslint-detected-bugs, r=N…
jonas-schievink Jan 25, 2021
cc7b2ce
Rollup merge of #81327 - RalfJung:codegen-no-const-fail, r=oli-obk
jonas-schievink Jan 25, 2021
c8a112d
Rollup merge of #81389 - ehuss:rustdoc-cmark-extensions, r=GuillaumeG…
jonas-schievink Jan 25, 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
Regression tests for issue 81211.
  • Loading branch information
pnkfelix committed Jan 23, 2021
commit 78e57d3a8eb83d305d7366bb7de93f6a0c0d73c7
40 changes: 40 additions & 0 deletions src/test/ui/derives/derive-Debug-use-ufcs-struct.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// run-pass
#![allow(warnings)]

#[derive(Debug)]
pub struct Bar { pub t: () }

impl<T> Access for T {}
pub trait Access {
fn field(&self, _: impl Sized, _: impl Sized) {
panic!("got into Access::field");
}

fn finish(&self) -> Result<(), std::fmt::Error> {
panic!("got into Access::finish");
}

fn debug_struct(&self, _: impl Sized, _: impl Sized) {
panic!("got into Access::debug_struct");
}
}

impl<T> MutAccess for T {}
pub trait MutAccess {
fn field(&mut self, _: impl Sized, _: impl Sized) {
panic!("got into MutAccess::field");
}

fn finish(&mut self) -> Result<(), std::fmt::Error> {
panic!("got into MutAccess::finish");
}

fn debug_struct(&mut self, _: impl Sized, _: impl Sized) {
panic!("got into MutAccess::debug_struct");
}
}

fn main() {
let bar = Bar { t: () };
assert_eq!("Bar { t: () }", format!("{:?}", bar));
}
32 changes: 32 additions & 0 deletions src/test/ui/derives/derive-Debug-use-ufcs-tuple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// run-pass
#![allow(warnings)]

#[derive(Debug)]
pub struct Foo<T>(pub T);

use std::fmt;

impl<T> Field for T {}
impl<T> Finish for T {}
impl Dt for &mut fmt::Formatter<'_> {}

pub trait Field {
fn field(&self, _: impl Sized) {
panic!("got into field");
}
}
pub trait Finish {
fn finish(&self) -> Result<(), std::fmt::Error> {
panic!("got into finish");
}
}
pub trait Dt {
fn debug_tuple(&self, _: &str) {
panic!("got into debug_tuple");
}
}

fn main() {
let foo = Foo(());
assert_eq!("Foo(())", format!("{:?}", foo));
}