Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e5796c4
Apply path remapping to DW_AT_GNU_dwo_name
cbeuw Dec 5, 2021
4abed50
Provide .dwo paths to llvm-dwp explicitly
cbeuw Dec 6, 2021
3281022
Produce .dwo file for Packed as well
cbeuw Dec 6, 2021
95fd357
Correct test which wasn't failing correctly
cbeuw Dec 6, 2021
42190bb
Remove redundant path join
cbeuw Dec 6, 2021
3d16a20
Remap path in MCOptions
cbeuw Dec 11, 2021
707f72c
Revert "Produce .dwo file for Packed as well"
cbeuw Dec 13, 2021
5e481d0
Provide object files to llvm-dwp instead of .dwo
cbeuw Dec 13, 2021
8679e17
Remove `in_band_lifetimes` from `rustc_metadata`
SylvanB Dec 14, 2021
4937a55
Remove `in_band_lifetimes` from `rustc_codegen_llvm`
LegionMammal978 Dec 14, 2021
c41fd76
rustc_codegen_llvm: Give each codegen unit a unique DWARF name on all
pcwalton Dec 17, 2021
a1f91aa
Use a const ParamEnv when in default_method_body_is_const
fee1-dead Dec 17, 2021
2699def
Set `RUST_BACKTRACE=0` when running location-detail tests
Aaron1011 Dec 17, 2021
afdd356
Add space and 2 grave accents
Dec 17, 2021
1c42199
Rollup merge of #91566 - cbeuw:remap-dwo-name, r=davidtwco
matthiaskrgr Dec 18, 2021
9e720a8
Rollup merge of #91926 - SylvanB:remove_in_band_lifetimes_from_rustc_…
matthiaskrgr Dec 18, 2021
ca3d129
Rollup merge of #91931 - LegionMammal978:less-inband-codegen_llvm, r=…
matthiaskrgr Dec 18, 2021
53a95ea
Rollup merge of #92024 - pcwalton:per-codegen-unit-names, r=davidtwco
matthiaskrgr Dec 18, 2021
cc043aa
Rollup merge of #92037 - fee1-dead:fix_env_dmbic, r=oli-obk
matthiaskrgr Dec 18, 2021
fd25904
Rollup merge of #92047 - Aaron1011:location-detail-backtrace, r=Mark-…
matthiaskrgr Dec 18, 2021
1ac1f24
Rollup merge of #92050 - r00ster91:patch-5, r=camelid
matthiaskrgr Dec 18, 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
8 changes: 7 additions & 1 deletion compiler/rustc_ty_utils/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_middle::ty::subst::Subst;
use rustc_middle::ty::{self, Binder, Predicate, PredicateKind, ToPredicate, Ty, TyCtxt};
use rustc_span::Span;
use rustc_span::{sym, Span};
use rustc_trait_selection::traits;

fn sized_constraint_for_ty<'tcx>(
Expand Down Expand Up @@ -285,6 +285,12 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {

let constness = match hir_id {
Some(hir_id) => match tcx.hir().get(hir_id) {
hir::Node::TraitItem(hir::TraitItem { kind: hir::TraitItemKind::Fn(..), .. })
if tcx.has_attr(def_id, sym::default_method_body_is_const) =>
{
hir::Constness::Const
}

hir::Node::Item(hir::Item { kind: hir::ItemKind::Const(..), .. })
| hir::Node::Item(hir::Item { kind: hir::ItemKind::Static(..), .. })
| hir::Node::TraitItem(hir::TraitItem {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#![feature(const_fn_trait_bound)]
#![feature(const_trait_impl)]

trait Tr {}
impl Tr for () {}

const fn foo<T>() where T: ~const Tr {}

pub trait Foo {
#[default_method_body_is_const]
fn foo() {
foo::<()>();
//~^ ERROR the trait bound `(): Tr` is not satisfied
}
}

fn main() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
error[E0277]: the trait bound `(): Tr` is not satisfied
--> $DIR/default-method-body-is-const-body-checking.rs:12:15
|
LL | foo::<()>();
| ^^ the trait `Tr` is not implemented for `()`
|
note: required by a bound in `foo`
--> $DIR/default-method-body-is-const-body-checking.rs:7:28
|
LL | const fn foo<T>() where T: ~const Tr {}
| ^^^^^^^^^ required by this bound in `foo`
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | pub trait Foo where (): Tr {
| ++++++++++++

error: aborting due to previous error

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