Merge branch 'master' into compiler/E0384-reduce-assertiveness

This commit is contained in:
James Addison 2021-04-14 12:52:06 +01:00
commit ff47e97838
47 changed files with 299 additions and 135 deletions

View File

@ -50,6 +50,8 @@ Libraries
- [`io::Empty` now implements `io::Seek`.][78044]
- [`rc::Weak<T>` and `sync::Weak<T>`'s methods such as `as_ptr` are now implemented for
`T: ?Sized` types.][80764]
- [`Div` and `Rem` by their `NonZero` variant is now implemented for all unsigned integers.][79134]
Stabilized APIs
---------------
@ -72,6 +74,8 @@ Stabilized APIs
- [`str::split_inclusive`]
- [`sync::OnceState`]
- [`task::Wake`]
- [`VecDeque::range`]
- [`VecDeque::range_mut`]
Cargo
-----
@ -115,6 +119,7 @@ Compatibility Notes
- `thumbv7neon-unknown-linux-gnueabihf`
- `armv7-unknown-linux-gnueabi`
- `x86_64-unknown-linux-gnux32`
- [`atomic::spin_loop_hint` has been deprecated.][80966] It's recommended to use `hint::spin_loop` instead.
Internal Only
-------------
@ -145,6 +150,8 @@ Internal Only
[80764]: https://github.com/rust-lang/rust/pull/80764
[80749]: https://github.com/rust-lang/rust/pull/80749
[80662]: https://github.com/rust-lang/rust/pull/80662
[79134]: https://github.com/rust-lang/rust/pull/79134
[80966]: https://github.com/rust-lang/rust/pull/80966
[cargo/8997]: https://github.com/rust-lang/cargo/pull/8997
[cargo/9112]: https://github.com/rust-lang/cargo/pull/9112
[feature-resolver@2.0]: https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2
@ -166,6 +173,8 @@ Internal Only
[`Seek::stream_position`]: https://doc.rust-lang.org/nightly/std/io/trait.Seek.html#method.stream_position
[`Peekable::next_if`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if
[`Peekable::next_if_eq`]: https://doc.rust-lang.org/nightly/std/iter/struct.Peekable.html#method.next_if_eq
[`VecDeque::range`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range
[`VecDeque::range_mut`]: https://doc.rust-lang.org/nightly/std/collections/struct.VecDeque.html#method.range_mut
Version 1.50.0 (2021-02-11)
============================

View File

@ -857,11 +857,10 @@ declare_lint! {
/// ```
///
/// This syntax is now a hard error in the 2018 edition. In the 2015
/// edition, this lint is "allow" by default, because the old code is
/// still valid, and warning for all old code can be noisy. This lint
/// edition, this lint is "warn" by default. This lint
/// enables the [`cargo fix`] tool with the `--edition` flag to
/// automatically transition old code from the 2015 edition to 2018. The
/// tool will switch this lint to "warn" and will automatically apply the
/// tool will run this lint and automatically apply the
/// suggested fix from the compiler (which is to add `_` to each
/// parameter). This provides a completely automated way to update old
/// code for a new edition. See [issue #41686] for more details.
@ -869,7 +868,7 @@ declare_lint! {
/// [issue #41686]: https://github.com/rust-lang/rust/issues/41686
/// [`cargo fix`]: https://doc.rust-lang.org/cargo/commands/cargo-fix.html
pub ANONYMOUS_PARAMETERS,
Allow,
Warn,
"detects anonymous parameters",
@future_incompatible = FutureIncompatibleInfo {
reference: "issue #41686 <https://github.com/rust-lang/rust/issues/41686>",
@ -884,6 +883,10 @@ declare_lint_pass!(
impl EarlyLintPass for AnonymousParameters {
fn check_trait_item(&mut self, cx: &EarlyContext<'_>, it: &ast::AssocItem) {
if cx.sess.edition() != Edition::Edition2015 {
// This is a hard error in future editions; avoid linting and erroring
return;
}
if let ast::AssocItemKind::Fn(box FnKind(_, ref sig, _, _)) = it.kind {
for arg in sig.decl.inputs.iter() {
if let ast::PatKind::Ident(_, ident, None) = arg.pat.kind {

View File

@ -666,21 +666,23 @@ impl<'a> Parser<'a> {
);
match x {
Ok((_, _, false)) => {
self.bump(); // `>`
match self.parse_expr() {
Ok(_) => {
e.span_suggestion_verbose(
binop.span.shrink_to_lo(),
TURBOFISH_SUGGESTION_STR,
"::".to_string(),
Applicability::MaybeIncorrect,
);
e.emit();
*expr = self.mk_expr_err(expr.span.to(self.prev_token.span));
return Ok(());
}
Err(mut err) => {
err.cancel();
if self.eat(&token::Gt) {
match self.parse_expr() {
Ok(_) => {
e.span_suggestion_verbose(
binop.span.shrink_to_lo(),
TURBOFISH_SUGGESTION_STR,
"::".to_string(),
Applicability::MaybeIncorrect,
);
e.emit();
*expr =
self.mk_expr_err(expr.span.to(self.prev_token.span));
return Ok(());
}
Err(mut err) => {
err.cancel();
}
}
}
}

View File

@ -1446,8 +1446,8 @@ impl Target {
let get_req_field = |name: &str| {
obj.find(name)
.map(|s| s.as_string())
.and_then(|os| os.map(|s| s.to_string()))
.and_then(Json::as_string)
.map(str::to_string)
.ok_or_else(|| format!("Field {} in target specification is required", name))
};

View File

@ -82,7 +82,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
if param_type.is_suggestable() {
err.span_suggestion(
tcx.def_span(src_def_id),
"consider changing this type paramater to a `const`-generic",
"consider changing this type parameter to be a `const` generic",
format!("const {}: {}", param_name, param_type),
Applicability::MaybeIncorrect,
);

View File

@ -940,7 +940,6 @@ impl<K, V> BTreeMap<K, V> {
/// # Examples
///
/// ```
/// #![feature(btree_retain)]
/// use std::collections::BTreeMap;
///
/// let mut map: BTreeMap<i32, i32> = (0..8).map(|x| (x, x*10)).collect();
@ -949,7 +948,7 @@ impl<K, V> BTreeMap<K, V> {
/// assert!(map.into_iter().eq(vec![(0, 0), (2, 20), (4, 40), (6, 60)]));
/// ```
#[inline]
#[unstable(feature = "btree_retain", issue = "79025")]
#[stable(feature = "btree_retain", since = "1.53.0")]
pub fn retain<F>(&mut self, mut f: F)
where
K: Ord,

View File

@ -851,7 +851,6 @@ impl<T> BTreeSet<T> {
/// # Examples
///
/// ```
/// #![feature(btree_retain)]
/// use std::collections::BTreeSet;
///
/// let xs = [1, 2, 3, 4, 5, 6];
@ -860,7 +859,7 @@ impl<T> BTreeSet<T> {
/// set.retain(|&k| k % 2 == 0);
/// assert!(set.iter().eq([2, 4, 6].iter()));
/// ```
#[unstable(feature = "btree_retain", issue = "79025")]
#[stable(feature = "btree_retain", since = "1.53.0")]
pub fn retain<F>(&mut self, mut f: F)
where
T: Ord,

View File

@ -2567,7 +2567,7 @@ impl<T, A: Allocator> Vec<T, A> {
/// # let some_predicate = |x: &mut i32| { *x == 2 || *x == 3 || *x == 6 };
/// # let mut vec = vec![1, 2, 3, 4, 5, 6];
/// let mut i = 0;
/// while i != vec.len() {
/// while i < vec.len() {
/// if some_predicate(&mut vec[i]) {
/// let val = vec.remove(i);
/// // your code here

View File

@ -2268,7 +2268,7 @@ impl<T: ?Sized + Debug> Debug for RefMut<'_, T> {
}
#[stable(feature = "core_impl_debug", since = "1.9.0")]
impl<T: ?Sized + Debug> Debug for UnsafeCell<T> {
impl<T: ?Sized> Debug for UnsafeCell<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> Result {
f.pad("UnsafeCell")
}

View File

@ -1543,7 +1543,7 @@ extern "rust-intrinsic" {
/// let num_trailing = unsafe { cttz_nonzero(x) };
/// assert_eq!(num_trailing, 3);
/// ```
#[rustc_const_unstable(feature = "const_cttz", issue = "none")]
#[rustc_const_stable(feature = "const_cttz", since = "1.53.0")]
pub fn cttz_nonzero<T: Copy>(x: T) -> T;
/// Reverses the bytes in an integer type `T`.

View File

@ -79,7 +79,6 @@
#![feature(const_int_unchecked_arith)]
#![feature(const_mut_refs)]
#![feature(const_refs_to_cell)]
#![feature(const_cttz)]
#![feature(const_panic)]
#![feature(const_pin)]
#![feature(const_fn)]

View File

@ -500,7 +500,6 @@ impl f32 {
/// Returns `true` if the number is [subnormal].
///
/// ```
/// #![feature(is_subnormal)]
/// let min = f32::MIN_POSITIVE; // 1.17549435e-38f32
/// let max = f32::MAX;
/// let lower_than_min = 1.0e-40_f32;
@ -516,7 +515,7 @@ impl f32 {
/// assert!(lower_than_min.is_subnormal());
/// ```
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[unstable(feature = "is_subnormal", issue = "79288")]
#[stable(feature = "is_subnormal", since = "1.53.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub const fn is_subnormal(self) -> bool {

View File

@ -499,7 +499,6 @@ impl f64 {
/// Returns `true` if the number is [subnormal].
///
/// ```
/// #![feature(is_subnormal)]
/// let min = f64::MIN_POSITIVE; // 2.2250738585072014e-308_f64
/// let max = f64::MAX;
/// let lower_than_min = 1.0e-308_f64;
@ -515,7 +514,7 @@ impl f64 {
/// assert!(lower_than_min.is_subnormal());
/// ```
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[unstable(feature = "is_subnormal", issue = "79288")]
#[stable(feature = "is_subnormal", since = "1.53.0")]
#[rustc_const_unstable(feature = "const_float_classify", issue = "72505")]
#[inline]
pub const fn is_subnormal(self) -> bool {

View File

@ -191,13 +191,12 @@ macro_rules! nonzero_leading_trailing_zeros {
/// Basic usage:
///
/// ```
/// #![feature(nonzero_leading_trailing_zeros)]
#[doc = concat!("let n = std::num::", stringify!($Ty), "::new(", stringify!($LeadingTestExpr), ").unwrap();")]
///
/// assert_eq!(n.leading_zeros(), 0);
/// ```
#[unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
#[rustc_const_unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
#[stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
#[rustc_const_stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
#[inline]
pub const fn leading_zeros(self) -> u32 {
// SAFETY: since `self` can not be zero it is safe to call ctlz_nonzero
@ -214,13 +213,12 @@ macro_rules! nonzero_leading_trailing_zeros {
/// Basic usage:
///
/// ```
/// #![feature(nonzero_leading_trailing_zeros)]
#[doc = concat!("let n = std::num::", stringify!($Ty), "::new(0b0101000).unwrap();")]
///
/// assert_eq!(n.trailing_zeros(), 3);
/// ```
#[unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
#[rustc_const_unstable(feature = "nonzero_leading_trailing_zeros", issue = "79143")]
#[stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
#[rustc_const_stable(feature = "nonzero_leading_trailing_zeros", since = "1.53.0")]
#[inline]
pub const fn trailing_zeros(self) -> u32 {
// SAFETY: since `self` can not be zero it is safe to call cttz_nonzero

View File

@ -124,14 +124,13 @@ impl Duration {
/// # Examples
///
/// ```
/// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// let duration = Duration::ZERO;
/// assert!(duration.is_zero());
/// assert_eq!(duration.as_nanos(), 0);
/// ```
#[unstable(feature = "duration_zero", issue = "73544")]
#[stable(feature = "duration_zero", since = "1.53.0")]
pub const ZERO: Duration = Duration::from_nanos(0);
/// The maximum duration.
@ -269,7 +268,6 @@ impl Duration {
/// # Examples
///
/// ```
/// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// assert!(Duration::ZERO.is_zero());
@ -281,7 +279,8 @@ impl Duration {
/// assert!(!Duration::from_nanos(1).is_zero());
/// assert!(!Duration::from_secs(1).is_zero());
/// ```
#[unstable(feature = "duration_zero", issue = "73544")]
#[stable(feature = "duration_zero", since = "1.53.0")]
#[rustc_const_stable(feature = "duration_zero", since = "1.53.0")]
#[inline]
pub const fn is_zero(&self) -> bool {
self.secs == 0 && self.nanos == 0
@ -536,7 +535,6 @@ impl Duration {
/// # Examples
///
/// ```
/// #![feature(duration_zero)]
/// use std::time::Duration;
///
/// assert_eq!(Duration::new(0, 1).saturating_sub(Duration::new(0, 0)), Duration::new(0, 1));

View File

@ -24,7 +24,6 @@
#![feature(div_duration)]
#![feature(duration_consts_2)]
#![feature(duration_constants)]
#![feature(duration_zero)]
#![feature(exact_size_is_empty)]
#![feature(extern_types)]
#![feature(flt2dec)]
@ -67,7 +66,6 @@
#![feature(ptr_metadata)]
#![feature(once_cell)]
#![feature(unsized_tuple_coercion)]
#![feature(nonzero_leading_trailing_zeros)]
#![feature(const_option)]
#![feature(integer_atomics)]
#![feature(slice_group_by)]

View File

@ -234,7 +234,7 @@ impl<R: Seek> BufReader<R> {
/// the buffer will not be flushed, allowing for more efficient seeks.
/// This method does not return the location of the underlying reader, so the caller
/// must track this information themselves if it is required.
#[unstable(feature = "bufreader_seek_relative", issue = "31100")]
#[stable(feature = "bufreader_seek_relative", since = "1.53.0")]
pub fn seek_relative(&mut self, offset: i64) -> io::Result<()> {
let pos = self.pos as u64;
if offset < 0 {

View File

@ -1768,6 +1768,7 @@ mod super_keyword {}
/// In the 2015 edition the parameters pattern was not needed for traits:
///
/// ```rust,edition2015
/// # #![allow(anonymous_parameters)]
/// trait Tr {
/// fn f(i32);
/// }

View File

@ -261,7 +261,6 @@
#![cfg_attr(not(bootstrap), feature(doc_notable_trait))]
#![feature(dropck_eyepatch)]
#![feature(duration_constants)]
#![feature(duration_zero)]
#![feature(edition_panic)]
#![feature(exact_size_is_empty)]
#![feature(exhaustive_patterns)]

View File

@ -73,6 +73,7 @@ impl<'a, 'tcx> DocFolder for BareUrlsLinter<'a, 'tcx> {
.unwrap_or(item.span.inner());
cx.tcx.struct_span_lint_hir(crate::lint::BARE_URLS, hir_id, sp, |lint| {
lint.build(msg)
.note("bare URLs are not automatically turned into clickable links")
.span_suggestion(
sp,
"use an automatic link instead",

View File

@ -9,102 +9,135 @@ note: the lint level is defined here
|
LL | #![deny(rustdoc::bare_urls)]
| ^^^^^^^^^^^^^^^^^^
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:7:5
|
LL | /// https://somewhere.com/a
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:9:5
|
LL | /// https://www.somewhere.com
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:11:5
|
LL | /// https://www.somewhere.com/a
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://www.somewhere.com/a>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:13:5
|
LL | /// https://subdomain.example.com
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://subdomain.example.com>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:15:5
|
LL | /// https://somewhere.com?
| ^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:17:5
|
LL | /// https://somewhere.com/a?
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:19:5
|
LL | /// https://somewhere.com?hello=12
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:21:5
|
LL | /// https://somewhere.com/a?hello=12
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:23:5
|
LL | /// https://example.com?hello=12#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com?hello=12#xyz>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:25:5
|
LL | /// https://example.com/a?hello=12#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a?hello=12#xyz>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:27:5
|
LL | /// https://example.com#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com#xyz>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:29:5
|
LL | /// https://example.com/a#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://example.com/a#xyz>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:31:5
|
LL | /// https://somewhere.com?hello=12&bye=11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:33:5
|
LL | /// https://somewhere.com/a?hello=12&bye=11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:35:5
|
LL | /// https://somewhere.com?hello=12&bye=11#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com?hello=12&bye=11#xyz>`
|
= note: bare URLs are not automatically turned into clickable links
error: this URL is not a hyperlink
--> $DIR/bare-urls.rs:37:10
|
LL | /// hey! https://somewhere.com/a?hello=12&bye=11#xyz
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://somewhere.com/a?hello=12&bye=11#xyz>`
|
= note: bare URLs are not automatically turned into clickable links
error: aborting due to 17 previous errors

View File

@ -31,6 +31,7 @@ note: the lint level is defined here
|
LL | #![deny(rustdoc::non_autolinks)]
| ^^^^^^^^^^^^^^^^^^^^^^
= note: bare URLs are not automatically turned into clickable links
error: aborting due to 2 previous errors; 1 warning emitted

View File

@ -2,6 +2,9 @@
// edition:2018
// aux-build:anon-params-edition-hygiene.rs
// This warning is still surfaced
#![allow(anonymous_parameters)]
#[macro_use]
extern crate anon_params_edition_hygiene;

View File

@ -1,6 +1,6 @@
// Checks that #[naked] attribute can be placed on function definitions only.
//
// ignore-wasm32 asm unsupported
// needs-asm-support
#![feature(asm)]
#![feature(naked_functions)]
#![naked] //~ ERROR should be applied to a function definition

View File

@ -31,9 +31,12 @@ error[E0747]: type provided when a constant was expected
--> $DIR/diagnostics.rs:12:19
|
LL | impl<N> Foo for B<N> {}
| - ^
| |
| help: consider changing this type paramater to a `const`-generic: `const N: u8`
| ^
|
help: consider changing this type parameter to be a `const` generic
|
LL | impl<const N: u8> Foo for B<N> {}
| ^^^^^^^^^^^
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/diagnostics.rs:16:32

View File

@ -186,4 +186,13 @@ const _: i32 = unsafe { std::intrinsics::unchecked_rem(i32::MIN, -1) };
//~^ ERROR any use of this value will cause an error
//~| WARN this was previously accepted by the compiler but is being phased out
// capture fault with zero value
const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) };
//~^ ERROR any use of this value will cause an error
//~| WARN this was previously accepted by the compiler but is being phased out
const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) };
//~^ ERROR any use of this value will cause an error
//~| WARN this was previously accepted by the compiler but is being phased out
fn main() {}

View File

@ -516,5 +516,27 @@ LL | const _: i32 = unsafe { std::intrinsics::unchecked_rem(i32::MIN, -1) };
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 47 previous errors
error: any use of this value will cause an error
--> $DIR/const-int-unchecked.rs:191:25
|
LL | const _: u32 = unsafe { std::intrinsics::ctlz_nonzero(0) };
| ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| `ctlz_nonzero` called on 0
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: any use of this value will cause an error
--> $DIR/const-int-unchecked.rs:194:25
|
LL | const _: u32 = unsafe { std::intrinsics::cttz_nonzero(0) };
| ------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| `cttz_nonzero` called on 0
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
error: aborting due to 49 previous errors

View File

@ -1,3 +1,4 @@
// needs-asm-support
#![feature(asm)]
#[naked]

View File

@ -1,5 +1,5 @@
error[E0658]: the `#[naked]` attribute is an experimental feature
--> $DIR/feature-gate-naked_functions.rs:3:1
--> $DIR/feature-gate-naked_functions.rs:4:1
|
LL | #[naked]
| ^^^^^^^^
@ -8,7 +8,7 @@ LL | #[naked]
= help: add `#![feature(naked_functions)]` to the crate attributes to enable
error[E0658]: the `#[naked]` attribute is an experimental feature
--> $DIR/feature-gate-naked_functions.rs:9:1
--> $DIR/feature-gate-naked_functions.rs:10:1
|
LL | #[naked]
| ^^^^^^^^

View File

@ -12,7 +12,7 @@ trait NonObjectSafe3 {
}
trait NonObjectSafe4 {
fn foo(&self, &Self);
fn foo(&self, s: &Self);
}
fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) {

View File

@ -57,12 +57,12 @@ LL | fn return_non_object_safe_rc() -> std::rc::Rc<dyn NonObjectSafe4> {
|
= help: consider moving `foo` to another trait
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
--> $DIR/feature-gate-object_safe_for_dispatch.rs:15:19
--> $DIR/feature-gate-object_safe_for_dispatch.rs:15:22
|
LL | trait NonObjectSafe4 {
| -------------- this trait cannot be made into an object...
LL | fn foo(&self, &Self);
| ^^^^^ ...because method `foo` references the `Self` type in this parameter
LL | fn foo(&self, s: &Self);
| ^^^^^ ...because method `foo` references the `Self` type in this parameter
error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:38:16

View File

@ -4,7 +4,7 @@ fn server() -> impl {
}
trait FilterBase2 {
fn map2<F>(self, F) -> Map2<F> {}
fn map2<F>(self, f: F) -> Map2<F> {}
//~^ ERROR mismatched types
//~^^ ERROR the size for values of type `Self` cannot be known at compilation time
}

View File

@ -25,10 +25,10 @@ LL | struct Map2<Segment2, F> {
| ^^^
error[E0308]: mismatched types
--> $DIR/issue-78720.rs:7:36
--> $DIR/issue-78720.rs:7:39
|
LL | fn map2<F>(self, F) -> Map2<F> {}
| ^^ expected struct `Map2`, found `()`
LL | fn map2<F>(self, f: F) -> Map2<F> {}
| ^^ expected struct `Map2`, found `()`
|
= note: expected struct `Map2<F>`
found unit type `()`
@ -36,17 +36,17 @@ LL | fn map2<F>(self, F) -> Map2<F> {}
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-78720.rs:7:16
|
LL | fn map2<F>(self, F) -> Map2<F> {}
LL | fn map2<F>(self, f: F) -> Map2<F> {}
| ^^^^ doesn't have a size known at compile-time
|
= help: unsized fn params are gated as an unstable feature
help: consider further restricting `Self`
|
LL | fn map2<F>(self, F) -> Map2<F> where Self: Sized {}
| ^^^^^^^^^^^^^^^^^
LL | fn map2<F>(self, f: F) -> Map2<F> where Self: Sized {}
| ^^^^^^^^^^^^^^^^^
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn map2<F>(&self, F) -> Map2<F> {}
LL | fn map2<F>(&self, f: F) -> Map2<F> {}
| ^
error: aborting due to 4 previous errors

View File

@ -0,0 +1,9 @@
fn main() {
let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
//~^ ERROR expected one of `>`, a const expression
//~| ERROR expected one of `>`, a const expression, lifetime, or type, found `}`
//~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
//~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
//~| ERROR expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
}
//~^ ERROR expected one of `,`, `:`, `=`, or `>`, found `}`

View File

@ -0,0 +1,49 @@
error: expected one of `>`, a const expression, lifetime, or type, found `}`
--> $DIR/issue-84117.rs:2:67
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ------------ ^ expected one of `>`, a const expression, lifetime, or type
| | |
| | help: use `=` if you meant to assign
| while parsing the type for `inner_local`
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:65
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ^ expected one of 7 possible tokens
error: expected one of `,`, `:`, `=`, or `>`, found `}`
--> $DIR/issue-84117.rs:8:1
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ------------ help: use `=` if you meant to assign - expected one of `,`, `:`, `=`, or `>`
| |
| while parsing the type for `outer_local`
...
LL | }
| ^ unexpected token
error: expected one of `>`, a const expression, lifetime, or type, found `}`
--> $DIR/issue-84117.rs:2:67
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ------------ ^ expected one of `>`, a const expression, lifetime, or type
| | |
| | help: use `=` if you meant to assign
| while parsing the type for `inner_local`
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:65
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ^ expected one of 7 possible tokens
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
--> $DIR/issue-84117.rs:2:33
|
LL | let outer_local:e_outer<&str, { let inner_local:e_inner<&str, }
| ^ expected one of 7 possible tokens
error: aborting due to 6 previous errors

View File

@ -1,4 +1,5 @@
#![feature(c_variadic)]
#![allow(anonymous_parameters)]
fn main() {}

View File

@ -1,203 +1,203 @@
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:5:19
--> $DIR/variadic-ffi-semantic-restrictions.rs:6:19
|
LL | fn f1_1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
--> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
|
LL | fn f1_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:8:9
--> $DIR/variadic-ffi-semantic-restrictions.rs:9:9
|
LL | fn f1_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:12:30
--> $DIR/variadic-ffi-semantic-restrictions.rs:13:30
|
LL | extern "C" fn f2_1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:16:20
|
LL | extern "C" fn f2_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:15:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:16:20
|
LL | extern "C" fn f2_2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:20:20
|
LL | extern "C" fn f2_3(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:19:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:20:20
|
LL | extern "C" fn f2_3(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:23:30
--> $DIR/variadic-ffi-semantic-restrictions.rs:24:30
|
LL | extern "C" fn f3_1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:26:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:27:20
|
LL | extern "C" fn f3_2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:26:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:27:20
|
LL | extern "C" fn f3_2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:31:20
|
LL | extern "C" fn f3_3(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:30:20
--> $DIR/variadic-ffi-semantic-restrictions.rs:31:20
|
LL | extern "C" fn f3_3(..., x: isize) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:35:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:36:13
|
LL | fn e_f1(...);
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:37:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:38:13
|
LL | fn e_f2(..., x: isize);
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:44:23
--> $DIR/variadic-ffi-semantic-restrictions.rs:45:23
|
LL | fn i_f1(x: isize, ...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:47:13
|
LL | fn i_f2(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:46:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:47:13
|
LL | fn i_f2(...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:50:13
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:49:28
--> $DIR/variadic-ffi-semantic-restrictions.rs:50:28
|
LL | fn i_f3(..., x: isize, ...) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:54:13
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:53:28
--> $DIR/variadic-ffi-semantic-restrictions.rs:54:28
|
LL | fn i_f4(..., x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:60:23
--> $DIR/variadic-ffi-semantic-restrictions.rs:61:23
|
LL | fn t_f1(x: isize, ...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:62:23
--> $DIR/variadic-ffi-semantic-restrictions.rs:63:23
|
LL | fn t_f2(x: isize, ...);
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
|
LL | fn t_f3(...) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:64:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:65:13
|
LL | fn t_f3(...) {}
| ^^^
error: C-variadic function must be declared with at least one named argument
--> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:68:13
|
LL | fn t_f4(...);
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:67:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:68:13
|
LL | fn t_f4(...);
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:71:13
|
LL | fn t_f5(..., x: isize) {}
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:70:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:71:13
|
LL | fn t_f5(..., x: isize) {}
| ^^^
error: `...` must be the last argument of a C-variadic function
--> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:74:13
|
LL | fn t_f6(..., x: isize);
| ^^^
error: only foreign or `unsafe extern "C" functions may be C-variadic
--> $DIR/variadic-ffi-semantic-restrictions.rs:73:13
--> $DIR/variadic-ffi-semantic-restrictions.rs:74:13
|
LL | fn t_f6(..., x: isize);
| ^^^

View File

@ -3,6 +3,8 @@
// check-pass
// aux-build:test-macros.rs
#![allow(anonymous_parameters)]
#[macro_use]
extern crate test_macros;

View File

@ -1,3 +1,4 @@
// needs-asm-support
#![feature(asm, naked_functions)]
#[track_caller] //~ ERROR cannot use `#[track_caller]` with `#[naked]`

View File

@ -1,11 +1,11 @@
error[E0736]: cannot use `#[track_caller]` with `#[naked]`
--> $DIR/error-with-naked.rs:3:1
--> $DIR/error-with-naked.rs:4:1
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^
error[E0736]: cannot use `#[track_caller]` with `#[naked]`
--> $DIR/error-with-naked.rs:12:5
--> $DIR/error-with-naked.rs:13:5
|
LL | #[track_caller]
| ^^^^^^^^^^^^^^^

View File

@ -1,6 +1,7 @@
// aux-build:ident-mac.rs
#![feature(c_variadic)]
#![allow(anonymous_parameters)]
extern crate ident_mac;
use ident_mac::id;

View File

@ -1,173 +1,173 @@
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:10:23
--> $DIR/proc-macro-cannot-be-used.rs:11:23
|
LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); }
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:10:40
--> $DIR/proc-macro-cannot-be-used.rs:11:40
|
LL | extern "C" { fn ffi(#[id] arg1: i32, #[id] ...); }
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:14:40
--> $DIR/proc-macro-cannot-be-used.rs:15:40
|
LL | unsafe extern "C" fn cvar(arg1: i32, #[id] mut args: ...) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:17:30
--> $DIR/proc-macro-cannot-be-used.rs:18:30
|
LL | type Alias = extern "C" fn(#[id] u8, #[id] ...);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:17:40
--> $DIR/proc-macro-cannot-be-used.rs:18:40
|
LL | type Alias = extern "C" fn(#[id] u8, #[id] ...);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:21:11
--> $DIR/proc-macro-cannot-be-used.rs:22:11
|
LL | fn free(#[id] arg1: u8) {
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:23:18
--> $DIR/proc-macro-cannot-be-used.rs:24:18
|
LL | let lam = |#[id] W(x), #[id] y: usize| ();
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:23:30
--> $DIR/proc-macro-cannot-be-used.rs:24:30
|
LL | let lam = |#[id] W(x), #[id] y: usize| ();
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:29:20
--> $DIR/proc-macro-cannot-be-used.rs:30:20
|
LL | fn inherent1(#[id] self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:29:32
--> $DIR/proc-macro-cannot-be-used.rs:30:32
|
LL | fn inherent1(#[id] self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:32:20
--> $DIR/proc-macro-cannot-be-used.rs:33:20
|
LL | fn inherent2(#[id] &self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:32:33
--> $DIR/proc-macro-cannot-be-used.rs:33:33
|
LL | fn inherent2(#[id] &self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:35:24
--> $DIR/proc-macro-cannot-be-used.rs:36:24
|
LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:35:44
--> $DIR/proc-macro-cannot-be-used.rs:36:44
|
LL | fn inherent3<'a>(#[id] &'a mut self, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:38:24
--> $DIR/proc-macro-cannot-be-used.rs:39:24
|
LL | fn inherent4<'a>(#[id] self: Box<Self>, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:38:47
--> $DIR/proc-macro-cannot-be-used.rs:39:47
|
LL | fn inherent4<'a>(#[id] self: Box<Self>, #[id] arg1: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:41:40
--> $DIR/proc-macro-cannot-be-used.rs:42:40
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:41:56
--> $DIR/proc-macro-cannot-be-used.rs:42:56
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8) {}
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:47:17
--> $DIR/proc-macro-cannot-be-used.rs:48:17
|
LL | fn trait1(#[id] self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:47:29
--> $DIR/proc-macro-cannot-be-used.rs:48:29
|
LL | fn trait1(#[id] self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:50:17
--> $DIR/proc-macro-cannot-be-used.rs:51:17
|
LL | fn trait2(#[id] &self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:50:30
--> $DIR/proc-macro-cannot-be-used.rs:51:30
|
LL | fn trait2(#[id] &self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:53:21
--> $DIR/proc-macro-cannot-be-used.rs:54:21
|
LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:53:41
--> $DIR/proc-macro-cannot-be-used.rs:54:41
|
LL | fn trait3<'a>(#[id] &'a mut self, #[id] arg1: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:56:21
--> $DIR/proc-macro-cannot-be-used.rs:57:21
|
LL | fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:56:44
--> $DIR/proc-macro-cannot-be-used.rs:57:44
|
LL | fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:56:60
--> $DIR/proc-macro-cannot-be-used.rs:57:60
|
LL | fn trait4<'a>(#[id] self: Box<Self>, #[id] arg1: u8, #[id] Vec<u8>);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:60:40
--> $DIR/proc-macro-cannot-be-used.rs:61:40
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8);
| ^^ not a non-macro attribute
error: expected non-macro attribute, found attribute macro `id`
--> $DIR/proc-macro-cannot-be-used.rs:60:56
--> $DIR/proc-macro-cannot-be-used.rs:61:56
|
LL | fn issue_64682_associated_fn<'a>(#[id] arg1: u8, #[id] arg2: u8);
| ^^ not a non-macro attribute

View File

@ -18,7 +18,7 @@ impl FromA<u8> for u16 {
}
trait FromA<T> {
fn from(T) -> Self;
fn from(t: T) -> Self;
}
impl<T: A, U: A + FromA<T>> FromA<T> for U {

View File

@ -17,7 +17,7 @@ pub unsafe trait Array {
pub trait Index : PartialEq + Copy {
fn to_usize(self) -> usize;
fn from(usize) -> Self;
fn from(i: usize) -> Self;
}
impl Index for usize {

View File

@ -44,6 +44,7 @@ impl EarlyProps {
let mut props = EarlyProps::default();
let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
let rustc_has_sanitizer_support = env::var_os("RUSTC_SANITIZER_SUPPORT").is_some();
let has_asm_support = util::has_asm_support(&config.target);
let has_asan = util::ASAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_lsan = util::LSAN_SUPPORTED_TARGETS.contains(&&*config.target);
let has_msan = util::MSAN_SUPPORTED_TARGETS.contains(&&*config.target);
@ -76,6 +77,10 @@ impl EarlyProps {
props.ignore = true;
}
if !has_asm_support && config.parse_name_directive(ln, "needs-asm-support") {
props.ignore = true;
}
if !rustc_has_profiler_support && config.parse_needs_profiler_support(ln) {
props.ignore = true;
}

View File

@ -223,6 +223,17 @@ fn sanitizers() {
assert!(parse_rs(&config, "// needs-sanitizer-thread").ignore);
}
#[test]
fn asm_support() {
let mut config = config();
config.target = "avr-unknown-gnu-atmega328".to_owned();
assert!(parse_rs(&config, "// needs-asm-support").ignore);
config.target = "i686-unknown-netbsd".to_owned();
assert!(!parse_rs(&config, "// needs-asm-support").ignore);
}
#[test]
fn test_extract_version_range() {
use super::{extract_llvm_version, extract_version_range};

View File

@ -128,6 +128,15 @@ const BIG_ENDIAN: &[&str] = &[
"sparcv9",
];
static ASM_SUPPORTED_ARCHS: &[&str] = &[
"x86", "x86_64", "arm", "aarch64", "riscv32", "riscv64", "nvptx64", "hexagon", "mips",
"mips64", "spirv", "wasm32",
];
pub fn has_asm_support(triple: &str) -> bool {
ASM_SUPPORTED_ARCHS.contains(&get_arch(triple))
}
pub fn matches_os(triple: &str, name: &str) -> bool {
// For the wasm32 bare target we ignore anything also ignored on emscripten
// and then we also recognize `wasm32-bare` as the os for the target