Update deprecation messages

This commit is contained in:
0xd4d 2020-12-28 18:30:21 +01:00
parent 12559a6987
commit f6cf7197fd
6 changed files with 164 additions and 164 deletions

View File

@ -178,7 +178,7 @@ namespace Generator.Encoder.Rust {
const TryMethodKind kind = TryMethodKind.Panic;
Action docsWriteError = () => writeError(kind);
WriteDocs(ctx.Writer, ctx.Method, kind, docsWriteError);
ctx.Writer.WriteLine($"#[deprecated(since = \"1.10.0\", note = \"Use {ctx.TryMethodName}() instead\")]");
ctx.Writer.WriteLine($"#[deprecated(since = \"1.10.0\", note = \"This method can panic, use {ctx.TryMethodName}() instead\")]");
WriteMethod(ctx.Writer, ctx.Method, ctx.MethodName, kind, GenTryFlags.None);
using (ctx.Writer.Indent()) {
sb.Clear();

View File

@ -701,7 +701,7 @@ impl<'a> Decoder<'a> {
/// assert_eq!(3, decoder.position());
/// ```
#[inline]
#[deprecated(since = "1.11.0", note = "Use try_set_position() instead")]
#[deprecated(since = "1.11.0", note = "This method can panic, use try_set_position() instead")]
pub fn set_position(&mut self, new_pos: usize) {
self.try_set_position(new_pos).unwrap();
}

View File

@ -193,7 +193,7 @@ impl Encoder {
/// * `bitness`: 16, 32 or 64
/// * `capacity`: Initial capacity of the `u8` buffer
#[cfg_attr(has_must_use, must_use)]
#[deprecated(since = "1.10.0", note = "Use try_with_capacity() instead")]
#[deprecated(since = "1.10.0", note = "This method can panic, use try_with_capacity() instead")]
#[inline]
pub fn with_capacity(bitness: u32, capacity: usize) -> Self {
Self::try_with_capacity(bitness, capacity).unwrap()

View File

@ -1224,7 +1224,7 @@ impl OpCodeInfo {
/// * `operand`: Operand number, 0-4
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[deprecated(since = "1.11.0", note = "Use try_op_kind() instead")]
#[deprecated(since = "1.11.0", note = "This method can panic, use try_op_kind() instead")]
pub fn op_kind(&self, operand: u32) -> OpCodeOperandKind {
self.try_op_kind(operand).unwrap()
}

View File

@ -226,7 +226,7 @@ impl UsedMemory {
/// * Arg 3: `element_size`: Only used if it's a vsib memory operand. Size in bytes of elements in vector index register (4 or 8).
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[deprecated(since = "1.11.0", note = "Use try_virtual_address() instead")]
#[deprecated(since = "1.11.0", note = "This method can panic, use try_virtual_address() instead")]
pub fn virtual_address<F>(&self, element_index: usize, mut get_register_value: F) -> u64
where
F: FnMut(Register, usize, usize) -> u64,
@ -497,7 +497,7 @@ impl InstructionInfo {
/// * `operand`: Operand number, 0-4
#[cfg_attr(has_must_use, must_use)]
#[inline]
#[deprecated(since = "1.11.0", note = "Use try_op_access() instead")]
#[deprecated(since = "1.11.0", note = "This method can panic, use try_op_access() instead")]
pub fn op_access(&self, operand: u32) -> OpAccess {
self.try_op_access(operand).unwrap()
}

File diff suppressed because it is too large Load Diff